From d09d8ac2ad0866215b6c44ffb2127074a07476cc Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 1 Jul 2026 12:24:17 +0530 Subject: [PATCH 001/146] fix(datastore): resolve create_or_update mixed-tree serialization regression DatastoreOperations.create_or_update was migrated to the arm_ml_service client (which serializes the request body via json.dumps(body, cls=SdkJSONEncoder)) in PR #47554, but the datastore ENTITIES still returned v2023_04_01_preview msrest Datastore models. SdkJSONEncoder can only serialize arm hybrid models, so every datastore create/update raised: TypeError: Object of type Datastore is not JSON serializable The bug was invisible to CI: unit tests mock the client (body never serialized), the datastore create e2e tests are skip/live_test_only, and notebook samples reuse the workspace default datastore instead of creating one. Fix: migrate the datastore entities (Blob/File/ADLS Gen2/Gen1/OneLake) and the shared datastore credentials to the arm_ml_service hybrid models so _to_rest_object() serializes cleanly through the operation client's encoder. Adds tests/datastore/unittests/test_datastore_serialization_regression.py: an offline Class-A (mixed-tree) guard that serializes each datastore body via SdkJSONEncoder exactly as the operation does. Note: the experimental HDFS on-prem datastore (model absent in arm_ml_service) is migrated separately via JSON-direct in the broader version migration. --- .../ai/ml/_schema/_datastore/one_lake.py | 2 +- .../azure/ai/ml/entities/_credentials.py | 18 ++-- .../ai/ml/entities/_datastore/adls_gen1.py | 6 +- .../ml/entities/_datastore/azure_storage.py | 10 +- .../ai/ml/entities/_datastore/datastore.py | 4 +- .../ai/ml/entities/_datastore/one_lake.py | 10 +- .../unittests/test_datastore_schema.py | 15 +-- ...test_datastore_serialization_regression.py | 95 +++++++++++++++++++ 8 files changed, 128 insertions(+), 32 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/one_lake.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/one_lake.py index 4b5e7b6664db..bfae4510cec5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/one_lake.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/one_lake.py @@ -8,7 +8,7 @@ from marshmallow import Schema, fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import DatastoreType, OneLakeArtifactType +from azure.ai.ml._restclient.arm_ml_service.models import DatastoreType, OneLakeArtifactType from azure.ai.ml._schema.core.fields import NestedField, PathAwareSchema, StringTransformedEnum, UnionField from azure.ai.ml._utils.utils import camel_to_snake 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 9299fa232d96..f488f3e0e98c 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 @@ -27,28 +27,28 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionUsernamePassword as RestWorkspaceConnectionUsernamePassword, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AccountKeyDatastoreCredentials as RestAccountKeyDatastoreCredentials, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AccountKeyDatastoreSecrets as RestAccountKeyDatastoreSecrets, ) from azure.ai.ml._restclient.v2023_04_01_preview.models import AmlToken as RestAmlToken -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( CertificateDatastoreCredentials as RestCertificateDatastoreCredentials, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import CertificateDatastoreSecrets, CredentialsType +from azure.ai.ml._restclient.arm_ml_service.models import CertificateDatastoreSecrets, CredentialsType from azure.ai.ml._restclient.v2023_04_01_preview.models import IdentityConfiguration as RestJobIdentityConfiguration from azure.ai.ml._restclient.v2023_04_01_preview.models import IdentityConfigurationType from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedIdentity as RestJobManagedIdentity from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedServiceIdentity as RestRegistryManagedIdentity -from azure.ai.ml._restclient.v2023_04_01_preview.models import NoneDatastoreCredentials as RestNoneDatastoreCredentials -from azure.ai.ml._restclient.v2023_04_01_preview.models import SasDatastoreCredentials as RestSasDatastoreCredentials -from azure.ai.ml._restclient.v2023_04_01_preview.models import SasDatastoreSecrets as RestSasDatastoreSecrets -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import NoneDatastoreCredentials as RestNoneDatastoreCredentials +from azure.ai.ml._restclient.arm_ml_service.models import SasDatastoreCredentials as RestSasDatastoreCredentials +from azure.ai.ml._restclient.arm_ml_service.models import SasDatastoreSecrets as RestSasDatastoreSecrets +from azure.ai.ml._restclient.arm_ml_service.models import ( ServicePrincipalDatastoreCredentials as RestServicePrincipalDatastoreCredentials, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServicePrincipalDatastoreSecrets as RestServicePrincipalDatastoreSecrets, ) from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py index c26107034bd3..d97f6acccc22 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py @@ -7,11 +7,11 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AzureDataLakeGen1Datastore as RestAzureDatalakeGen1Datastore, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import Datastore as DatastoreData -from azure.ai.ml._restclient.v2023_04_01_preview.models import DatastoreType +from azure.ai.ml._restclient.arm_ml_service.models import Datastore as DatastoreData +from azure.ai.ml._restclient.arm_ml_service.models import DatastoreType from azure.ai.ml._schema._datastore.adls_gen1 import AzureDataLakeGen1Schema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, TYPE from azure.ai.ml.entities._credentials import CertificateConfiguration, ServicePrincipalConfiguration diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py index 0fff1925177a..d1fa19a40cd1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py @@ -8,13 +8,13 @@ from typing import Any, Dict, Optional, Union from azure.ai.ml._azure_environments import _get_storage_endpoint_from_metadata -from azure.ai.ml._restclient.v2023_04_01_preview.models import AzureBlobDatastore as RestAzureBlobDatastore -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AzureBlobDatastore as RestAzureBlobDatastore +from azure.ai.ml._restclient.arm_ml_service.models import ( AzureDataLakeGen2Datastore as RestAzureDataLakeGen2Datastore, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import AzureFileDatastore as RestAzureFileDatastore -from azure.ai.ml._restclient.v2023_04_01_preview.models import Datastore as DatastoreData -from azure.ai.ml._restclient.v2023_04_01_preview.models import DatastoreType +from azure.ai.ml._restclient.arm_ml_service.models import AzureFileDatastore as RestAzureFileDatastore +from azure.ai.ml._restclient.arm_ml_service.models import Datastore as DatastoreData +from azure.ai.ml._restclient.arm_ml_service.models import DatastoreType from azure.ai.ml._schema._datastore import AzureBlobSchema, AzureDataLakeGen2Schema, AzureFileSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, TYPE from azure.ai.ml.entities._credentials import ( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/datastore.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/datastore.py index bc933cfbfb2c..59640968113c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/datastore.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/datastore.py @@ -9,8 +9,8 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import Datastore as DatastoreData -from azure.ai.ml._restclient.v2023_04_01_preview.models import DatastoreType +from azure.ai.ml._restclient.arm_ml_service.models import Datastore as DatastoreData +from azure.ai.ml._restclient.arm_ml_service.models import DatastoreType from azure.ai.ml._utils.utils import camel_to_snake, dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, CommonYamlFields from azure.ai.ml.entities._credentials import ( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py index 9bc06d927255..e2184924cc23 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py @@ -8,11 +8,11 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import Datastore as DatastoreData -from azure.ai.ml._restclient.v2023_04_01_preview.models import DatastoreType -from azure.ai.ml._restclient.v2023_04_01_preview.models import LakeHouseArtifact as RestLakeHouseArtifact -from azure.ai.ml._restclient.v2023_04_01_preview.models import NoneDatastoreCredentials as RestNoneDatastoreCredentials -from azure.ai.ml._restclient.v2023_04_01_preview.models import OneLakeDatastore as RestOneLakeDatastore +from azure.ai.ml._restclient.arm_ml_service.models import Datastore as DatastoreData +from azure.ai.ml._restclient.arm_ml_service.models import DatastoreType +from azure.ai.ml._restclient.arm_ml_service.models import LakeHouseArtifact as RestLakeHouseArtifact +from azure.ai.ml._restclient.arm_ml_service.models import NoneDatastoreCredentials as RestNoneDatastoreCredentials +from azure.ai.ml._restclient.arm_ml_service.models import OneLakeDatastore as RestOneLakeDatastore from azure.ai.ml._schema._datastore.one_lake import OneLakeSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, TYPE diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py index 846bac6ca93a..d7b52e28ca2d 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py @@ -3,16 +3,17 @@ import azure.ai.ml._schema._datastore as DatastoreSchemaDir from azure.ai.ml import load_datastore +from azure.ai.ml._restclient.arm_ml_service import models as models_arm from azure.ai.ml._restclient.v2023_04_01_preview import models as models_preview -from azure.ai.ml._restclient.v2023_04_01_preview.models import AzureBlobDatastore as RestAzureBlobDatastore -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AzureBlobDatastore as RestAzureBlobDatastore +from azure.ai.ml._restclient.arm_ml_service.models import ( AzureDataLakeGen1Datastore as RestAzureDataLakeGen1Datastore, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AzureDataLakeGen2Datastore as RestAzureDataLakeGen2Datastore, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import AzureFileDatastore as RestAzureFileDatastore -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AzureFileDatastore as RestAzureFileDatastore +from azure.ai.ml._restclient.arm_ml_service.models import ( NoneDatastoreCredentials, ServicePrincipalDatastoreCredentials, ) @@ -271,7 +272,7 @@ def test_credential_less_one_lake_schema(self): datastore_resource.name = internal_ds.name ds_properties = datastore_resource.properties assert ds_properties - assert isinstance(ds_properties, models_preview.OneLakeDatastore) + assert isinstance(ds_properties, models_arm.OneLakeDatastore) assert isinstance(ds_properties.credentials, NoneDatastoreCredentials) assert ds_properties.one_lake_workspace_name == cfg["one_lake_workspace_name"] assert ds_properties.endpoint == cfg["endpoint"] @@ -315,7 +316,7 @@ def validate_one_lake_schema_with_service_principal(self, test_yaml_file_path, a datastore_resource.name = internal_ds.name ds_properties = datastore_resource.properties assert ds_properties - assert isinstance(ds_properties, models_preview.OneLakeDatastore) + assert isinstance(ds_properties, models_arm.OneLakeDatastore) assert isinstance(ds_properties.credentials, ServicePrincipalDatastoreCredentials) assert ds_properties.one_lake_workspace_name == cfg["one_lake_workspace_name"] assert ds_properties.endpoint == cfg["endpoint"] diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py new file mode 100644 index 000000000000..052d496acce3 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py @@ -0,0 +1,95 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Regression test for the datastore create_or_update mixed-tree serialization bug. + +Context (production regression, azure-ai-ml 1.34.0/1.35.0): +``DatastoreOperations.create_or_update`` was migrated to the arm_ml_service client (its operation +serializes the request body with ``json.dumps(body, cls=SdkJSONEncoder, ...)``), but the datastore +ENTITIES still returned an old ``v2023_04_01_preview`` msrest ``Datastore`` model. ``SdkJSONEncoder`` +can only serialize arm hybrid models, so a msrest datastore body raised +``TypeError: Object of type Datastore is not JSON serializable`` on every create/update — a hard +failure for customers, invisible to the mocked unit tests and the (skipped/live-only) e2e tests. + +This test freezes the fix: every datastore entity's ``_to_rest_object()`` must serialize cleanly +through the arm operation's encoder. It is the offline Class-A (mixed-tree) guard the original +migration lacked. +""" +import json + +import pytest + +from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder +from azure.ai.ml.entities._credentials import ( + AccountKeyConfiguration, + ServicePrincipalConfiguration, +) +from azure.ai.ml.entities._datastore.adls_gen1 import AzureDataLakeGen1Datastore +from azure.ai.ml.entities._datastore.azure_storage import ( + AzureBlobDatastore, + AzureDataLakeGen2Datastore, + AzureFileDatastore, +) +from azure.ai.ml.entities._datastore.one_lake import OneLakeDatastore + + +def _serializes_via_arm_operation(rest_obj) -> dict: + """Serialize exactly the way ``DatastoreOperations.create_or_update`` does on the arm client.""" + return json.loads(json.dumps(rest_obj, cls=SdkJSONEncoder, exclude_readonly=True)) + + +@pytest.mark.unittest +@pytest.mark.data_experiences_test +class TestDatastoreSerializationRegression: + def test_blob_datastore_body_serializes(self) -> None: + ds = AzureBlobDatastore( + name="ds", + account_name="acct", + container_name="container", + credentials=AccountKeyConfiguration(account_key="fake"), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + assert wire["properties"]["datastoreType"] == "AzureBlob" + assert wire["properties"]["accountName"] == "acct" + + def test_file_datastore_body_serializes(self) -> None: + ds = AzureFileDatastore( + name="ds", + account_name="acct", + file_share_name="share", + credentials=AccountKeyConfiguration(account_key="fake"), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + assert wire["properties"]["datastoreType"] == "AzureFile" + + def test_adls_gen2_datastore_body_serializes(self) -> None: + ds = AzureDataLakeGen2Datastore( + name="ds", + account_name="acct", + filesystem="fs", + credentials=ServicePrincipalConfiguration(tenant_id="t", client_id="c", client_secret="s"), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + assert wire["properties"]["datastoreType"] == "AzureDataLakeGen2" + + def test_adls_gen1_datastore_body_serializes(self) -> None: + ds = AzureDataLakeGen1Datastore( + name="ds", + store_name="store", + credentials=ServicePrincipalConfiguration(tenant_id="t", client_id="c", client_secret="s"), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + assert wire["properties"]["datastoreType"] == "AzureDataLakeGen1" + + def test_one_lake_datastore_body_serializes(self) -> None: + from azure.ai.ml.entities._datastore.one_lake import LakeHouseArtifact + + ds = OneLakeDatastore( + name="ds", + one_lake_workspace_name="ws", + endpoint="onelake.dfs.fabric.microsoft.com", + artifact=LakeHouseArtifact(name="artifact"), + credentials=ServicePrincipalConfiguration(tenant_id="t", client_id="c", client_secret="s"), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + assert wire["properties"]["datastoreType"] == "OneLake" From 17a673657b3a1fd89e277f0e62b647c53d85aa03 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 1 Jul 2026 14:45:23 +0530 Subject: [PATCH 002/146] fix(datastore): use arm resource_url field for certificate credentials Addresses PR review: CertificateConfiguration._to_datastore_rest_object passed resource_uri= to the arm_ml_service CertificateDatastoreCredentials model, but that model's field is resource_url. The old msrest model silently ignored the unknown resource_uri kwarg; the arm hybrid model raises TypeError: CertificateDatastoreCredentials.__init__() got an unexpected keyword argument 'resource_uri' so every certificate-authenticated datastore (ADLS Gen1/Gen2) create/update would crash - the same serialization-regression class this PR fixes. Fix both the write (resource_url=self.resource_url) and read (resource_url=obj.resource_url) paths, and extend the serialization regression test to cover certificate credentials on ADLS Gen1 and Gen2 (the original test only exercised account-key and service-principal creds). --- .../azure/ai/ml/entities/_credentials.py | 4 +- ...test_datastore_serialization_regression.py | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) 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 f488f3e0e98c..4f21d291fb6a 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 @@ -404,7 +404,7 @@ def _to_datastore_rest_object(self) -> RestCertificateDatastoreCredentials: secrets = CertificateDatastoreSecrets(certificate=self.certificate) return RestCertificateDatastoreCredentials( authority_url=self.authority_url, - resource_uri=self.resource_url, + resource_url=self.resource_url, tenant_id=self.tenant_id, client_id=self.client_id, thumbprint=self.thumbprint, @@ -415,7 +415,7 @@ def _to_datastore_rest_object(self) -> RestCertificateDatastoreCredentials: def _from_datastore_rest_object(cls, obj: RestCertificateDatastoreCredentials) -> "CertificateConfiguration": return cls( authority_url=obj.authority_url, - resource_url=obj.resource_uri, + resource_url=obj.resource_url, tenant_id=obj.tenant_id, client_id=obj.client_id, thumbprint=obj.thumbprint, diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py index 052d496acce3..a440a0b87d5d 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py @@ -22,6 +22,7 @@ from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder from azure.ai.ml.entities._credentials import ( AccountKeyConfiguration, + CertificateConfiguration, ServicePrincipalConfiguration, ) from azure.ai.ml.entities._datastore.adls_gen1 import AzureDataLakeGen1Datastore @@ -81,6 +82,46 @@ def test_adls_gen1_datastore_body_serializes(self) -> None: wire = _serializes_via_arm_operation(ds._to_rest_object()) assert wire["properties"]["datastoreType"] == "AzureDataLakeGen1" + def test_adls_gen2_certificate_datastore_body_serializes(self) -> None: + # Certificate credentials exercise CertificateConfiguration._to_datastore_rest_object, whose + # ``resource_url`` field is a distinct arm wire name (the old msrest model called it + # ``resource_uri``). Guards the cert-auth create/update path. + ds = AzureDataLakeGen2Datastore( + name="ds", + account_name="acct", + filesystem="fs", + credentials=CertificateConfiguration( + tenant_id="t", + client_id="c", + thumbprint="tp", + certificate="cert", + authority_url="https://login.microsoftonline.com", + resource_url="https://storage.azure.com/", + ), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + creds = wire["properties"]["credentials"] + assert creds["credentialsType"] == "Certificate" + assert creds["resourceUrl"] == "https://storage.azure.com/" + + def test_adls_gen1_certificate_datastore_body_serializes(self) -> None: + ds = AzureDataLakeGen1Datastore( + name="ds", + store_name="store", + credentials=CertificateConfiguration( + tenant_id="t", + client_id="c", + thumbprint="tp", + certificate="cert", + authority_url="https://login.microsoftonline.com", + resource_url="https://datalake.azure.net/", + ), + ) + wire = _serializes_via_arm_operation(ds._to_rest_object()) + creds = wire["properties"]["credentials"] + assert creds["credentialsType"] == "Certificate" + assert creds["resourceUrl"] == "https://datalake.azure.net/" + def test_one_lake_datastore_body_serializes(self) -> None: from azure.ai.ml.entities._datastore.one_lake import LakeHouseArtifact From 34e2b09e02748ba6745d62af56a0bf17221708dc Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 1 Jul 2026 15:07:54 +0530 Subject: [PATCH 003/146] migrate(assets): move asset entities to arm_ml_service (2023-04) Migrate the asset entities off the v2023_04_01_preview msrest models onto the shared arm_ml_service hybrid client: - Data / Model / Environment version models -> arm_ml_service. - AutoDeleteSetting, IntellectualProperty, ModelConfiguration are absent from arm_ml_service (2025-12); serialize them JSON-direct (plain camelCase dict) and read them back via mapping access, per the reuse-existing-client approach. - data.py: preserve the `autoDeleteSetting` wire field via mapping assignment (dropped from the arm model) and gate referenced_uris on the arm field set. - environment.py: read intellectual_property defensively (arm dict or msrest), coerce is_anonymous default to False (arm hybrid defaults to None). - component.py / pipeline_component.py: IntellectualProperty._to_rest_object now returns the wire dict directly, so drop the obsolete .serialize() call. Validated: model, environment, dataset, model_package, component unit suites (254 passed). --- .../_artifacts/_package/model_configuration.py | 17 ++++++++++------- .../ai/ml/entities/_assets/_artifacts/data.py | 13 ++++++++++--- .../ai/ml/entities/_assets/_artifacts/model.py | 2 +- .../ml/entities/_assets/auto_delete_setting.py | 16 ++++++++++------ .../azure/ai/ml/entities/_assets/environment.py | 16 +++++++++++----- .../entities/_assets/intellectual_property.py | 15 +++++++++------ .../ai/ml/entities/_component/component.py | 2 +- .../entities/_component/pipeline_component.py | 2 +- .../test_model_allowed_deployment_templates.py | 2 +- .../test_model_default_deployment_template.py | 2 +- 10 files changed, 55 insertions(+), 32 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py index 73c777cfd743..14f2eea7eb5c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py @@ -3,10 +3,9 @@ # ---------------------------------------------------------- -from typing import Optional +from typing import Any, Dict, Optional from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2023_04_01_preview.models import ModelConfiguration as RestModelConfiguration from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException @@ -35,12 +34,16 @@ def __init__(self, *, mode: Optional[str] = None, mount_path: Optional[str] = No self.mount_path = mount_path @classmethod - def _from_rest_object(cls, rest_obj: RestModelConfiguration) -> "ModelConfiguration": - return ModelConfiguration(mode=rest_obj.mode, mount_path=rest_obj.mount_path) - - def _to_rest_object(self) -> RestModelConfiguration: + def _from_rest_object(cls, rest_obj: Any) -> "ModelConfiguration": + mode = rest_obj.get("mode") if hasattr(rest_obj, "get") else rest_obj.mode + mount_path = rest_obj.get("mountPath") if hasattr(rest_obj, "get") else rest_obj.mount_path + return ModelConfiguration(mode=mode, mount_path=mount_path) + + def _to_rest_object(self) -> Dict[str, Any]: + # ``ModelConfiguration`` was dropped from the arm_ml_service (2025-12) model; build the + # 2023-04 wire body directly as a dict (JSON-direct). self._validate() - return RestModelConfiguration(mode=self.mode, mount_path=self.mount_path) + return {"mode": self.mode, "mountPath": self.mount_path} def _validate(self) -> None: if self.mode is not None and self.mode.lower() not in ["copy", "download"]: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py index 4575b67e6aef..498aaf365960 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py @@ -11,7 +11,7 @@ from typing import Any, Dict, List, Optional, Tuple, Type, Union from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( DataContainer, DataContainerProperties, DataType, @@ -174,9 +174,16 @@ def _to_rest_object(self) -> Optional[DataVersionBase]: is_archived=False, properties=self.properties, data_uri=self.path, - auto_delete_setting=self.auto_delete_setting, ) - if VersionDetailsClass._attribute_map.get("referenced_uris") is not None: + # ``autoDeleteSetting`` exists on the 2023-04 wire contract but was dropped from the + # arm_ml_service (2025-12) model; preserve it via wire-key assignment (JSON-direct). + if self.auto_delete_setting is not None: + auto_delete = self.auto_delete_setting + data_version_details["autoDeleteSetting"] = ( + auto_delete._to_rest_object() if hasattr(auto_delete, "_to_rest_object") else auto_delete + ) + # ``referenced_uris`` only exists on MLTable data versions. + if "referenced_uris" in getattr(data_version_details, "_attr_to_rest_field", {}): data_version_details.referenced_uris = self._referenced_uris return DataVersionBase(properties=data_version_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index eabc3f60cfbe..ba0b2aa7f9ed 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -10,7 +10,7 @@ ModelVersionDefaultDeploymentTemplate, ModelVersionDetails, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( FlavorData, ModelContainer, ModelVersion, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/auto_delete_setting.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/auto_delete_setting.py index ea6bf9e83263..490ad6a33ec7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/auto_delete_setting.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/auto_delete_setting.py @@ -2,9 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import Any, Union +from typing import Any, Dict, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoDeleteSetting as RestAutoDeleteSetting from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import AutoDeleteCondition from azure.ai.ml.entities._mixins import DictMixin @@ -29,12 +28,17 @@ def __init__( self.condition = condition self.value = value - def _to_rest_object(self) -> RestAutoDeleteSetting: - return RestAutoDeleteSetting(condition=self.condition, value=self.value) + def _to_rest_object(self) -> Dict[str, Any]: + # ``AutoDeleteSetting`` was dropped from the arm_ml_service (2025-12) model; build the + # 2023-04 wire body directly as a dict (JSON-direct). + return {"condition": self.condition, "value": self.value} @classmethod - def _from_rest_object(cls, obj: RestAutoDeleteSetting) -> "AutoDeleteSetting": - return cls(condition=obj.condition, value=obj.value) + def _from_rest_object(cls, obj: Any) -> "AutoDeleteSetting": + # Accept both an arm hybrid / dict wire body and a legacy msrest object with attributes. + condition = obj.get("condition") if hasattr(obj, "get") else obj.condition + value = obj.get("value") if hasattr(obj, "get") else obj.value + return cls(condition=condition, value=value) def __eq__(self, other: Any) -> bool: if not isinstance(other, AutoDeleteSetting): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index dcce6936184a..4c8b24c6594a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -11,8 +11,8 @@ import yaml # type: ignore[import] from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2023_04_01_preview.models import BuildContext as RestBuildContext -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import BuildContext as RestBuildContext +from azure.ai.ml._restclient.arm_ml_service.models import ( EnvironmentContainer, EnvironmentVersion, EnvironmentVersionProperties, @@ -252,15 +252,21 @@ def _from_rest_object(cls, env_rest_object: EnvironmentVersion) -> "Environment" creation_context=( SystemData._from_rest_object(env_rest_object.system_data) if env_rest_object.system_data else None ), - is_anonymous=rest_env_version.is_anonymous, + is_anonymous=rest_env_version.is_anonymous or False, image=rest_env_version.image, os_type=rest_env_version.os_type, inference_config=rest_env_version.inference_config, build=BuildContext._from_rest_object(rest_env_version.build) if rest_env_version.build else None, properties=rest_env_version.properties, intellectual_property=( - IntellectualProperty._from_rest_object(rest_env_version.intellectual_property) - if rest_env_version.intellectual_property + IntellectualProperty._from_rest_object(_ip) + if ( + _ip := ( + rest_env_version.get("intellectualProperty") + if hasattr(rest_env_version, "get") + else getattr(rest_env_version, "intellectual_property", None) + ) + ) else None ), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/intellectual_property.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/intellectual_property.py index 58b96a1b93a0..151a940e8993 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/intellectual_property.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/intellectual_property.py @@ -2,9 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import Any, Optional +from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import IntellectualProperty as RestIntellectualProperty from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._assets import IPProtectionLevel from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -36,12 +35,16 @@ def __init__( self.publisher = publisher self.protection_level = protection_level - def _to_rest_object(self) -> RestIntellectualProperty: - return RestIntellectualProperty(publisher=self.publisher, protection_level=self.protection_level) + def _to_rest_object(self) -> Dict[str, Any]: + # ``IntellectualProperty`` was dropped from the arm_ml_service (2025-12) model; build the + # 2023-04 wire body directly as a dict (JSON-direct). + return {"publisher": self.publisher, "protectionLevel": self.protection_level} @classmethod - def _from_rest_object(cls, obj: RestIntellectualProperty) -> "IntellectualProperty": - return cls(publisher=obj.publisher, protection_level=obj.protection_level) + def _from_rest_object(cls, obj: Any) -> "IntellectualProperty": + publisher = obj.get("publisher") if hasattr(obj, "get") else obj.publisher + protection_level = obj.get("protectionLevel") if hasattr(obj, "get") else obj.protection_level + return cls(publisher=publisher, protection_level=protection_level) def __eq__(self, other: Any) -> bool: if not isinstance(other, IntellectualProperty): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py index 1cfdb45cf2ac..3e8174811ceb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py @@ -570,7 +570,7 @@ def _to_rest_object(self) -> ComponentVersion: if self._intellectual_property: # hack while full pass through supported is worked on for IPP fields component.pop("intellectual_property") - component["intellectualProperty"] = self._intellectual_property._to_rest_object().serialize() + component["intellectualProperty"] = self._intellectual_property._to_rest_object() properties = ComponentVersionProperties( component_spec=component, description=self.description, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/pipeline_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/pipeline_component.py index 0711341af1c1..d710e7f6575e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/pipeline_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/pipeline_component.py @@ -508,7 +508,7 @@ def _to_rest_object(self) -> ComponentVersion: if self._intellectual_property: # hack while full pass through supported is worked on for IPP fields component.pop("intellectual_property") - component["intellectualProperty"] = self._intellectual_property._to_rest_object().serialize() + component["intellectualProperty"] = self._intellectual_property._to_rest_object() properties = ComponentVersionProperties( component_spec=component, description=self.description, diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py index acd148363432..67def226c682 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py @@ -13,7 +13,7 @@ ModelVersionData, ModelVersionDetails, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ModelVersion, ModelVersionProperties +from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion, ModelVersionProperties from azure.ai.ml.entities import Model from azure.ai.ml.entities._assets.default_deployment_template import DeploymentTemplateReference diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py index 689432eeeeed..a80fea4d79bb 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py @@ -7,7 +7,7 @@ from azure.ai.ml import load_model from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData, ModelVersionDetails -from azure.ai.ml._restclient.v2023_04_01_preview.models import ModelVersion, ModelVersionProperties +from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion, ModelVersionProperties from azure.ai.ml.entities import Model from azure.ai.ml.entities._assets.default_deployment_template import DeploymentTemplateReference From d3da0ed1fc33b63d81a998b8c35c1e9c5ea8af5e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 2 Jul 2026 15:40:28 +0530 Subject: [PATCH 004/146] migrate(automl): move AutoML job surface to arm_ml_service (2023-04/2024-01) Migrate the entire AutoML entity surface (tabular, image, and NLP jobs plus their settings/search-space models) off the per-version msrest restclients onto the shared arm_ml_service hybrid client, using the proven to_hybrid_rest_model boundary pattern for shared children (outputs/identity). - Tabular: regression/classification/forecasting jobs + featurization/limit/ training/forecasting settings, CustomTargetLags values->values_property, n_cross_validations/forecast-horizon discriminated children as wire dicts. - Image: 4 image jobs + model/sweep/limit settings via the boundary pattern. - NLP: text classification / multilabel / NER jobs; arm-absent NlpFixedParameters, NlpParameterSubspace, and NlpSweepSettings emitted JSON-direct; fixedParameters/ searchSpace/sweepSettings/maxNodes carried as wire-keys; local NlpLearningRate scheduler + TrainingMode enums replace the arm-absent generated enums. All 262 AutoML unit tests pass. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../ai/ml/_schema/automl/automl_vertical.py | 2 +- .../_schema/automl/featurization_settings.py | 2 +- .../ml/_schema/automl/forecasting_settings.py | 6 +-- .../image_vertical/image_classification.py | 2 +- .../image_model_distribution_settings.py | 2 +- .../image_vertical/image_model_settings.py | 2 +- .../image_vertical/image_object_detection.py | 2 +- .../nlp_vertical/nlp_fixed_parameters.py | 2 +- .../nlp_vertical/nlp_parameter_subspace.py | 2 +- .../nlp_vertical/text_classification.py | 2 +- .../text_classification_multilabel.py | 2 +- .../_schema/automl/nlp_vertical/text_ner.py | 2 +- .../automl/table_vertical/classification.py | 2 +- .../automl/table_vertical/forecasting.py | 2 +- .../automl/table_vertical/regression.py | 2 +- .../automl/table_vertical/table_vertical.py | 2 +- .../ai/ml/_schema/automl/training_settings.py | 2 +- .../azure/ai/ml/_schema/job/identity.py | 2 +- .../azure/ai/ml/automl/_automl_image.py | 2 +- .../azure/ai/ml/constants/_job/automl.py | 38 ++++++++++++++- .../ai/ml/entities/_builders/spark_func.py | 2 +- .../ml/entities/_deployment/data_collector.py | 2 +- .../_deployment/deployment_collection.py | 2 +- .../entities/_deployment/online_deployment.py | 14 +++--- .../entities/_deployment/request_logging.py | 2 +- .../ml/entities/_deployment/scale_settings.py | 8 ++-- .../feature_set_backfill_request.py | 2 +- .../ai/ml/entities/_job/automl/automl_job.py | 17 ++++--- .../_job/automl/image/automl_image.py | 6 +-- .../image/automl_image_classification_base.py | 2 +- .../automl_image_object_detection_base.py | 5 +- .../automl/image/image_classification_job.py | 22 ++++++--- .../image_classification_multilabel_job.py | 22 ++++++--- .../image_classification_search_space.py | 2 +- .../image/image_instance_segmentation_job.py | 20 +++++--- .../_job/automl/image/image_limit_settings.py | 2 +- .../_job/automl/image/image_model_settings.py | 24 ++++++---- .../image/image_object_detection_job.py | 20 +++++--- .../image_object_detection_search_space.py | 2 +- .../_job/automl/image/image_sweep_settings.py | 4 +- .../_job/automl/nlp/automl_nlp_job.py | 2 +- .../automl/nlp/nlp_featurization_settings.py | 2 +- .../_job/automl/nlp/nlp_fixed_parameters.py | 2 +- .../_job/automl/nlp/nlp_limit_settings.py | 2 +- .../_job/automl/nlp/nlp_search_space.py | 2 +- .../_job/automl/nlp/nlp_sweep_settings.py | 4 +- .../automl/nlp/text_classification_job.py | 6 +-- .../nlp/text_classification_multilabel_job.py | 4 +- .../entities/_job/automl/nlp/text_ner_job.py | 6 +-- .../_job/automl/stack_ensemble_settings.py | 4 +- .../_job/automl/tabular/classification_job.py | 20 +++++--- .../automl/tabular/featurization_settings.py | 6 +-- .../_job/automl/tabular/forecasting_job.py | 20 +++++--- .../automl/tabular/forecasting_settings.py | 20 ++++---- .../_job/automl/tabular/limit_settings.py | 12 +++-- .../_job/automl/tabular/regression_job.py | 22 ++++++--- .../entities/_job/automl/training_settings.py | 48 +++++++++++-------- .../_job/data_transfer/data_transfer_job.py | 2 +- .../azure/ai/ml/entities/_job/job.py | 4 +- .../azure/ai/ml/entities/_job/job_limits.py | 2 +- .../azure/ai/ml/entities/_job/job_service.py | 4 +- .../ml/entities/_job/parameterized_command.py | 2 +- .../ai/ml/entities/_job/pipeline/_io/mixin.py | 4 +- .../entities/_job/resource_configuration.py | 2 +- .../azure/ai/ml/entities/_job/spark_job.py | 4 +- .../ai/ml/entities/_job/spark_job_entry.py | 4 +- .../_job/spark_resource_configuration.py | 2 +- .../_job/sweep/early_termination_policy.py | 10 ++-- .../ai/ml/operations/_data_operations.py | 6 +-- .../ml/operations/_environment_operations.py | 6 +-- .../ai/ml/operations/_index_operations.py | 2 +- .../azure/ai/ml/operations/_job_operations.py | 4 +- .../_online_deployment_operations.py | 2 +- .../test_automl_image_classification.py | 2 +- ..._automl_image_classification_multilabel.py | 4 +- ...test_automl_image_instance_segmentation.py | 9 ++-- .../test_automl_image_object_detection.py | 9 ++-- .../test_automl_nlp_sweep_settings.py | 33 +++++++------ .../unittests/test_classification_job.py | 4 +- .../unittests/test_forecasting_job.py | 4 +- .../unittests/test_forecasting_settings.py | 12 ++--- .../unittests/test_regression_job.py | 4 +- .../unittests/test_tabular_limit_settings.py | 44 +++++++++-------- .../unittests/test_text_classification_job.py | 8 ++-- 85 files changed, 378 insertions(+), 259 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index bbbdda02a5f3..357593d56040 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -25,7 +25,6 @@ from azure.ai.ml._restclient.v2020_09_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, ) -from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview @@ -104,6 +103,7 @@ ServiceClient022022Preview = partial(MachineLearningServicesMgmtClient, api_version="2022-02-01-preview") ServiceClient102022Preview = partial(MachineLearningServicesMgmtClient, api_version="2022-10-01-preview") ServiceClient022023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-02-01-preview") +ServiceClient042023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-04-01-preview") ServiceClient062023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-06-01-preview") ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") ServiceClient102024PreviewTsp = partial(MachineLearningServicesMgmtClient, api_version="2024-10-01-preview") diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/automl_vertical.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/automl_vertical.py index 2cf3bb8369eb..f812e586a3c1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/automl_vertical.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/automl_vertical.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from azure.ai.ml._restclient.v2023_04_01_preview.models import LogVerbosity +from azure.ai.ml._restclient.arm_ml_service.models import LogVerbosity from azure.ai.ml._schema.automl.automl_job import AutoMLJobSchema from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.job.input_output_entry import MLTableInputSchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/featurization_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/featurization_settings.py index 19998e45c094..88f7bef0dd41 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/featurization_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/featurization_settings.py @@ -7,7 +7,7 @@ from marshmallow import fields as flds from marshmallow import post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import BlockedTransformers +from azure.ai.ml._restclient.arm_ml_service.models import BlockedTransformers from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.core.schema import PatchedSchemaMeta from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/forecasting_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/forecasting_settings.py index 56033e147cd6..0310dc85de84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/forecasting_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/forecasting_settings.py @@ -6,8 +6,8 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import FeatureLags as FeatureLagsMode -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import FeatureLags as FeatureLagsMode +from azure.ai.ml._restclient.arm_ml_service.models import ( ForecastHorizonMode, SeasonalityMode, ShortSeriesHandlingConfiguration, @@ -15,7 +15,7 @@ TargetLagsMode, TargetRollingWindowSizeMode, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import UseStl as STLMode +from azure.ai.ml._restclient.arm_ml_service.models import UseStl as STLMode from azure.ai.ml._schema.core.fields import StringTransformedEnum, UnionField from azure.ai.ml._schema.core.schema import PatchedSchemaMeta diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_classification.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_classification.py index c539f037f2af..161409a22674 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_classification.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_classification.py @@ -8,7 +8,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationMultilabelPrimaryMetrics, ClassificationPrimaryMetrics, TaskType, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_distribution_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_distribution_settings.py index 9f784038c530..72f9792d40ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_distribution_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_distribution_settings.py @@ -6,7 +6,7 @@ from marshmallow import fields, post_dump, post_load, pre_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, ModelSize, StochasticOptimizer, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_settings.py index 7c88e6286ad0..52c944d7abf2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_model_settings.py @@ -6,7 +6,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, ModelSize, StochasticOptimizer, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_object_detection.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_object_detection.py index cb753882bccc..5585b75cdef9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_object_detection.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/image_vertical/image_object_detection.py @@ -8,7 +8,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( InstanceSegmentationPrimaryMetrics, ObjectDetectionPrimaryMetrics, TaskType, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_fixed_parameters.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_fixed_parameters.py index 2a5cb336c9c4..e0c532965d42 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_fixed_parameters.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_fixed_parameters.py @@ -6,7 +6,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpLearningRateScheduler +from azure.ai.ml.constants._job.automl import NlpLearningRateScheduler from azure.ai.ml._schema.core.fields import StringTransformedEnum from azure.ai.ml._schema.core.schema import PatchedSchemaMeta from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_parameter_subspace.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_parameter_subspace.py index de963478001a..998ba62bf089 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_parameter_subspace.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/nlp_parameter_subspace.py @@ -6,7 +6,7 @@ from marshmallow import fields, post_dump, post_load, pre_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpLearningRateScheduler +from azure.ai.ml.constants._job.automl import NlpLearningRateScheduler from azure.ai.ml._schema._sweep.search_space import ( ChoiceSchema, NormalSchema, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification.py index 14e0b7d6f555..9476358610a7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification.py @@ -8,7 +8,7 @@ from marshmallow import post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics, TaskType from azure.ai.ml._schema.automl.nlp_vertical.nlp_vertical import NlpVerticalSchema from azure.ai.ml._schema.core.fields import StringTransformedEnum, fields from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification_multilabel.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification_multilabel.py index 56cd5bc1d9ba..66cd0a0b7bd9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification_multilabel.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_classification_multilabel.py @@ -8,7 +8,7 @@ from marshmallow import post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationMultilabelPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationMultilabelPrimaryMetrics, TaskType from azure.ai.ml._schema.automl.nlp_vertical.nlp_vertical import NlpVerticalSchema from azure.ai.ml._schema.core.fields import StringTransformedEnum, fields from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_ner.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_ner.py index 3609b1d05212..e2a601765b5e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_ner.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/nlp_vertical/text_ner.py @@ -8,7 +8,7 @@ from marshmallow import post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics, TaskType from azure.ai.ml._schema.automl.nlp_vertical.nlp_vertical import NlpVerticalSchema from azure.ai.ml._schema.core.fields import StringTransformedEnum, fields from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/classification.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/classification.py index f9ce7b8b897e..90428e214322 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/classification.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/classification.py @@ -8,7 +8,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics, TaskType from azure.ai.ml._schema.automl.table_vertical.table_vertical import AutoMLTableVerticalSchema from azure.ai.ml._schema.automl.training_settings import ClassificationTrainingSettingsSchema from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/forecasting.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/forecasting.py index 7f302c977598..f59f03734d99 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/forecasting.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/forecasting.py @@ -8,7 +8,7 @@ from marshmallow import post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ForecastingPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import ForecastingPrimaryMetrics, TaskType from azure.ai.ml._schema.automl.forecasting_settings import ForecastingSettingsSchema from azure.ai.ml._schema.automl.table_vertical.table_vertical import AutoMLTableVerticalSchema from azure.ai.ml._schema.automl.training_settings import ForecastingTrainingSettingsSchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/regression.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/regression.py index fc1e3900303c..1f655bc5ff28 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/regression.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/regression.py @@ -8,7 +8,7 @@ from marshmallow import post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import RegressionPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import RegressionPrimaryMetrics, TaskType from azure.ai.ml._schema.automl.table_vertical.table_vertical import AutoMLTableVerticalSchema from azure.ai.ml._schema.automl.training_settings import RegressionTrainingSettingsSchema from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/table_vertical.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/table_vertical.py index e98d70667038..38a396ba96d6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/table_vertical.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/table_vertical/table_vertical.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from azure.ai.ml._restclient.v2023_04_01_preview.models import NCrossValidationsMode +from azure.ai.ml._restclient.arm_ml_service.models import NCrossValidationsMode from azure.ai.ml._schema.automl.automl_vertical import AutoMLVerticalSchema from azure.ai.ml._schema.automl.featurization_settings import TableFeaturizationSettingsSchema from azure.ai.ml._schema.automl.table_vertical.table_vertical_limit_settings import AutoMLTableLimitsSchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/training_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/training_settings.py index 57a76892fed0..c201e58705d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/training_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/automl/training_settings.py @@ -6,7 +6,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationModels, ForecastingModels, RegressionModels, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/identity.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/identity.py index 2f2be6761e2c..087ddd4d9d6a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/identity.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/identity.py @@ -8,7 +8,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ConnectionAuthType, IdentityConfigurationType, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py index 521c9aa2064d..e3b3d81e02de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/_automl_image.py @@ -6,7 +6,7 @@ from typing import Optional, TypeVar, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationMultilabelPrimaryMetrics, ClassificationPrimaryMetrics, InstanceSegmentationPrimaryMetrics, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/automl.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/automl.py index 41af0781233a..80516b10b8f7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/automl.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/automl.py @@ -3,11 +3,45 @@ # --------------------------------------------------------- from enum import Enum -# pylint: disable=unused-import -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpLearningRateScheduler, TrainingMode +from azure.core import CaseInsensitiveEnumMeta + from azure.ai.ml._utils._experimental import experimental +class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """NLP learning rate scheduler enum.""" + + NONE = "None" + LINEAR = "Linear" + COSINE = "Cosine" + COSINE_WITH_RESTARTS = "CosineWithRestarts" + POLYNOMIAL = "Polynomial" + CONSTANT = "Constant" + CONSTANT_WITH_WARMUP = "ConstantWithWarmup" + + +class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum to determine the type of training mode for the AutoML job.""" + + AUTO = "Auto" + DISTRIBUTED = "Distributed" + NON_DISTRIBUTED = "NonDistributed" + + +class LogTrainingMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum to determine whether or not to log training metrics.""" + + ENABLE = "Enable" + DISABLE = "Disable" + + +class LogValidationLoss(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum to determine whether or not to log validation loss.""" + + ENABLE = "Enable" + DISABLE = "Disable" + + class AutoMLConstants: # The following are fields found in the yaml for AutoML Job GENERAL_YAML = "general" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark_func.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark_func.py index 342f8c44e9cd..65efb6498ac7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark_func.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark_func.py @@ -6,7 +6,7 @@ import os from typing import Any, Callable, Dict, List, Optional, Tuple, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AmlToken, ManagedIdentity, UserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import AmlToken, ManagedIdentity, UserIdentity from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.constants._component import ComponentSource from azure.ai.ml.entities import Environment diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py index 74277c61879c..78be233462bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py @@ -5,7 +5,7 @@ from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import DataCollector as RestDataCollector +from azure.ai.ml._restclient.arm_ml_service.models import DataCollector as RestDataCollector from azure.ai.ml._schema._deployment.online.data_collector_schema import DataCollectorSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py index c1b1c7507826..e6ec92caa3e4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py @@ -4,7 +4,7 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import Collection as RestCollection +from azure.ai.ml._restclient.arm_ml_service.models import Collection as RestCollection from azure.ai.ml._schema._deployment.online.deployment_collection_schema import DeploymentCollectionSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py index ad9bfd801fbf..0d8f479b38a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py @@ -11,15 +11,15 @@ from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union, cast -from azure.ai.ml._restclient.v2023_04_01_preview.models import CodeConfiguration as RestCodeConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import EndpointComputeType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import CodeConfiguration as RestCodeConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import EndpointComputeType +from azure.ai.ml._restclient.arm_ml_service.models import ( KubernetesOnlineDeployment as RestKubernetesOnlineDeployment, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedOnlineDeployment as RestManagedOnlineDeployment -from azure.ai.ml._restclient.v2023_04_01_preview.models import OnlineDeployment as RestOnlineDeploymentData -from azure.ai.ml._restclient.v2023_04_01_preview.models import OnlineDeploymentProperties as RestOnlineDeploymentDetails -from azure.ai.ml._restclient.v2023_04_01_preview.models import Sku as RestSku +from azure.ai.ml._restclient.arm_ml_service.models import ManagedOnlineDeployment as RestManagedOnlineDeployment +from azure.ai.ml._restclient.arm_ml_service.models import OnlineDeployment as RestOnlineDeploymentData +from azure.ai.ml._restclient.arm_ml_service.models import OnlineDeploymentProperties as RestOnlineDeploymentDetails +from azure.ai.ml._restclient.arm_ml_service.models import Sku as RestSku from azure.ai.ml._schema._deployment.online.online_deployment import ( KubernetesOnlineDeploymentSchema, ManagedOnlineDeploymentSchema, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py index 20cc83fe2a46..cf5cb6525184 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py @@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import RequestLogging as RestRequestLogging +from azure.ai.ml._restclient.arm_ml_service.models import RequestLogging as RestRequestLogging from azure.ai.ml._schema._deployment.online.request_logging_schema import RequestLoggingSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/scale_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/scale_settings.py index 85535ca08d0d..bc4fa8a0a321 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/scale_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/scale_settings.py @@ -8,10 +8,10 @@ from abc import abstractmethod from typing import Any, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import DefaultScaleSettings as RestDefaultScaleSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import OnlineScaleSettings as RestOnlineScaleSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import ScaleType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import DefaultScaleSettings as RestDefaultScaleSettings +from azure.ai.ml._restclient.arm_ml_service.models import OnlineScaleSettings as RestOnlineScaleSettings +from azure.ai.ml._restclient.arm_ml_service.models import ScaleType +from azure.ai.ml._restclient.arm_ml_service.models import ( TargetUtilizationScaleSettings as RestTargetUtilizationScaleSettings, ) from azure.ai.ml._utils.utils import camel_to_snake, from_iso_duration_format, to_iso_duration_format diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/feature_set_backfill_request.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/feature_set_backfill_request.py index 0baebf4c7564..a3b4bd071f77 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/feature_set_backfill_request.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/feature_set_backfill_request.py @@ -24,7 +24,7 @@ class FeatureSetBackfillRequest(RestTranslatableMixin): :param version: The version of the backfill job request. :type version: str :param feature_window: The time window for the feature set backfill request. - :type feature_window: ~azure.ai.ml._restclient.v2023_04_01_preview.models.FeatureWindow + :type feature_window: ~azure.ai.ml._restclient.arm_ml_service.models.FeatureWindow :param description: The description of the backfill job request. Defaults to None. :type description: Optional[str] :param tags: Tag dictionary. Tags can be added, removed, and updated. Defaults to None. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/automl_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/automl_job.py index 9e1b4d055d76..b5761cbb68ef 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/automl_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/automl_job.py @@ -8,7 +8,7 @@ from abc import ABC, abstractmethod from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( JobBase, MLTableJobInput, QueueSettings, @@ -266,12 +266,15 @@ def _resolve_data_inputs(self, rest_job: "AutoMLJob") -> None: :param rest_job: The rest job object. :type rest_job: AutoMLJob """ - if isinstance(rest_job.training_data, Input): - rest_job.training_data = MLTableJobInput(uri=rest_job.training_data.path) - if isinstance(rest_job.validation_data, Input): - rest_job.validation_data = MLTableJobInput(uri=rest_job.validation_data.path) - if hasattr(rest_job, "test_data") and isinstance(rest_job.test_data, Input): - rest_job.test_data = MLTableJobInput(uri=rest_job.test_data.path) + # Read from ``self`` (the entity holds the clean SDK ``Input`` with ``.path``); the arm task + # constructor coerces a non-arm ``Input`` assignment into a raw dict, so ``rest_job``'s field + # can no longer expose ``.path``. Assigning an arm ``MLTableJobInput`` back is not coerced. + if isinstance(self.training_data, Input): + rest_job.training_data = MLTableJobInput(uri=self.training_data.path) + if isinstance(self.validation_data, Input): + rest_job.validation_data = MLTableJobInput(uri=self.validation_data.path) + if hasattr(self, "test_data") and isinstance(self.test_data, Input): + rest_job.test_data = MLTableJobInput(uri=self.test_data.path) def _restore_data_inputs(self) -> None: """Restore MLTableJobInputs to JobInputs within data_settings.""" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image.py index dfc86f0340bb..967bd9aec99c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image.py @@ -5,7 +5,7 @@ from abc import ABC from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import LogVerbosity, SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import LogVerbosity, SamplingAlgorithmType from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.automl.automl_vertical import AutoMLVertical @@ -62,7 +62,7 @@ def log_verbosity(self) -> LogVerbosity: """Returns the verbosity of the logger. :return: The log verbosity. - :rtype: ~azure.ai.ml._restclient.v2023_04_01_preview.models.LogVerbosity + :rtype: ~azure.ai.ml._restclient.arm_ml_service.models.LogVerbosity """ return self._log_verbosity @@ -72,7 +72,7 @@ def log_verbosity(self, value: Union[str, LogVerbosity]) -> None: :param value: The value to set the log verbosity to. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". - :type value: Union[str, ~azure.ai.ml._restclient.v2023_04_01_preview.models.LogVerbosity] + :type value: Union[str, ~azure.ai.ml._restclient.arm_ml_service.models.LogVerbosity] """ self._log_verbosity = None if value is None else LogVerbosity[camel_to_snake(value).upper()] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py index ddc251815390..1824b70cf444 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_classification_base.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import LearningRateScheduler, StochasticOptimizer +from azure.ai.ml._restclient.arm_ml_service.models import LearningRateScheduler, StochasticOptimizer from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities._job.automl.image.automl_image import AutoMLImage from azure.ai.ml.entities._job.automl.image.image_classification_search_space import ImageClassificationSearchSpace diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py index b7c39a2453c7..6c6d64046a21 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/automl_image_object_detection_base.py @@ -6,14 +6,13 @@ from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, - LogTrainingMetrics, - LogValidationLoss, ModelSize, StochasticOptimizer, ValidationMetricType, ) +from azure.ai.ml.constants._job.automl import LogTrainingMetrics, LogValidationLoss from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities._job.automl import SearchSpace from azure.ai.ml.entities._job.automl.image.automl_image import AutoMLImage diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py index a1b9dbc337dd..961f01140c3a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py @@ -6,15 +6,21 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationPrimaryMetrics -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageClassification as RestImageClassification -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import ImageClassification as RestImageClassification +from azure.ai.ml._restclient.arm_ml_service.models import JobBase, TaskType from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.image.automl_image_classification_base import AutoMLImageClassificationBase from azure.ai.ml.entities._job.automl.image.image_limit_settings import ImageLimitSettings from azure.ai.ml.entities._job.automl.image.image_model_settings import ImageModelSettingsClassification @@ -111,10 +117,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=image_classification_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py index 541f41c7757c..dec0b7156996 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py @@ -6,17 +6,23 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationMultilabelPrimaryMetrics -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationMultilabelPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageClassificationMultilabel as RestImageClassificationMultilabel, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import JobBase, TaskType from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.image.automl_image_classification_base import AutoMLImageClassificationBase from azure.ai.ml.entities._job.automl.image.image_limit_settings import ImageLimitSettings from azure.ai.ml.entities._job.automl.image.image_model_settings import ImageModelSettingsClassification @@ -113,10 +119,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=image_classification_multilabel_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py index 0691f243294b..f8004808578b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_search_space.py @@ -6,7 +6,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageModelDistributionSettingsClassification +from azure.ai.ml._restclient.arm_ml_service.models import ImageModelDistributionSettingsClassification from azure.ai.ml.entities._job.automl.search_space import SearchSpace from azure.ai.ml.entities._job.automl.search_space_utils import _convert_from_rest_object, _convert_to_rest_object from azure.ai.ml.entities._job.sweep.search_space import SweepDistribution diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py index 48ec5fc26dc8..44f796e28188 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py @@ -6,16 +6,22 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageInstanceSegmentation as RestImageInstanceSegmentation, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import InstanceSegmentationPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import InstanceSegmentationPrimaryMetrics, JobBase, TaskType from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.image.automl_image_object_detection_base import AutoMLImageObjectDetectionBase from azure.ai.ml.entities._job.automl.image.image_limit_settings import ImageLimitSettings from azure.ai.ml.entities._job.automl.image.image_model_settings import ImageModelSettingsObjectDetection @@ -108,10 +114,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=image_instance_segmentation_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_limit_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_limit_settings.py index 12ec8b572d63..1ecdf33a8c50 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_limit_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_limit_settings.py @@ -4,7 +4,7 @@ from typing import Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageLimitSettings as RestImageLimitSettings +from azure.ai.ml._restclient.arm_ml_service.models import ImageLimitSettings as RestImageLimitSettings from azure.ai.ml._utils.utils import from_iso_duration_format_mins, to_iso_duration_format_mins from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py index 890f987a67e9..8d91bd129e67 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_model_settings.py @@ -5,20 +5,19 @@ from typing import Any, Optional # pylint: disable=R0902,too-many-locals -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageModelSettingsClassification as RestImageModelSettingsClassification, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageModelSettingsObjectDetection as RestImageModelSettingsObjectDetection, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, - LogTrainingMetrics, - LogValidationLoss, ModelSize, StochasticOptimizer, ValidationMetricType, ) +from azure.ai.ml.constants._job.automl import LogTrainingMetrics, LogValidationLoss from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -751,7 +750,7 @@ def __init__( self.log_validation_loss = log_validation_loss def _to_rest_object(self) -> RestImageModelSettingsObjectDetection: - return RestImageModelSettingsObjectDetection( + rest_obj = RestImageModelSettingsObjectDetection( advanced_settings=self.advanced_settings, ams_gradient=self.ams_gradient, beta1=self.beta1, @@ -795,9 +794,14 @@ def _to_rest_object(self) -> RestImageModelSettingsObjectDetection: tile_predictions_nms_threshold=self.tile_predictions_nms_threshold, validation_iou_threshold=self.validation_iou_threshold, validation_metric_type=self.validation_metric_type, - log_training_metrics=self.log_training_metrics, - log_validation_loss=self.log_validation_loss, ) + # ``logTrainingMetrics``/``logValidationLoss`` exist on the 2023-04 wire contract but were + # dropped from the arm_ml_service (2025-12) model; preserve them via wire-key assignment. + if self.log_training_metrics is not None: + rest_obj["logTrainingMetrics"] = self.log_training_metrics + if self.log_validation_loss is not None: + rest_obj["logValidationLoss"] = self.log_validation_loss + return rest_obj @classmethod def _from_rest_object(cls, obj: RestImageModelSettingsObjectDetection) -> "ImageModelSettingsObjectDetection": @@ -845,8 +849,8 @@ def _from_rest_object(cls, obj: RestImageModelSettingsObjectDetection) -> "Image tile_predictions_nms_threshold=obj.tile_predictions_nms_threshold, validation_iou_threshold=obj.validation_iou_threshold, validation_metric_type=obj.validation_metric_type, - log_training_metrics=obj.log_training_metrics, - log_validation_loss=obj.log_validation_loss, + log_training_metrics=obj.get("logTrainingMetrics"), + log_validation_loss=obj.get("logValidationLoss"), ) def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py index f8d070d226d0..8485ec8dde96 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py @@ -6,14 +6,20 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageObjectDetection as RestImageObjectDetection -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, ObjectDetectionPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import ImageObjectDetection as RestImageObjectDetection +from azure.ai.ml._restclient.arm_ml_service.models import JobBase, ObjectDetectionPrimaryMetrics, TaskType from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.image.automl_image_object_detection_base import AutoMLImageObjectDetectionBase from azure.ai.ml.entities._job.automl.image.image_limit_settings import ImageLimitSettings from azure.ai.ml.entities._job.automl.image.image_model_settings import ImageModelSettingsObjectDetection @@ -108,10 +114,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=image_object_detection_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py index a9004d1ed25c..762be023d7fb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_search_space.py @@ -6,7 +6,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageModelDistributionSettingsObjectDetection +from azure.ai.ml._restclient.arm_ml_service.models import ImageModelDistributionSettingsObjectDetection from azure.ai.ml.entities._job.automl.search_space import SearchSpace from azure.ai.ml.entities._job.automl.search_space_utils import _convert_from_rest_object, _convert_to_rest_object from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py index b5e9ffaf3d2a..3fe2f2433105 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py @@ -6,8 +6,8 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageSweepSettings as RestImageSweepSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import ImageSweepSettings as RestImageSweepSettings +from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType from azure.ai.ml.entities._job.sweep.early_termination_policy import ( BanditPolicy, EarlyTerminationPolicy, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py index 8a6f7575b9d3..87a7313927a7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py @@ -4,7 +4,7 @@ from abc import ABC from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.v2024_01_01_preview.models import ( LogVerbosity, NlpLearningRateScheduler, SamplingAlgorithmType, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py index 5649dea293a8..72cc4edff3a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.v2024_01_01_preview.models import ( NlpVerticalFeaturizationSettings as RestNlpVerticalFeaturizationSettings, ) from azure.ai.ml.entities._job.automl.featurization_settings import FeaturizationSettings, FeaturizationSettingsType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py index 13c594b616de..adcd4ea58bfe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py @@ -3,7 +3,7 @@ # --------------------------------------------------------- from typing import Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpFixedParameters as RestNlpFixedParameters +from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpFixedParameters as RestNlpFixedParameters from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py index 1e99f4f0abb9..c9c423e91b50 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py @@ -4,7 +4,7 @@ from typing import Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpVerticalLimitSettings as RestNlpLimitSettings +from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpVerticalLimitSettings as RestNlpLimitSettings from azure.ai.ml._utils.utils import from_iso_duration_format_mins, to_iso_duration_format_mins from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py index e4ad435fe57e..6d96f5555348 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py @@ -4,7 +4,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpLearningRateScheduler, NlpParameterSubspace +from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpLearningRateScheduler, NlpParameterSubspace from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.constants import NlpModels from azure.ai.ml.entities._job.automl.search_space import SearchSpace diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py index e446a30c4aba..7c98aa45ca0c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py @@ -4,8 +4,8 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpSweepSettings as RestNlpSweepSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import SamplingAlgorithmType +from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpSweepSettings as RestNlpSweepSettings +from azure.ai.ml._restclient.v2024_01_01_preview.models import SamplingAlgorithmType from azure.ai.ml.entities._job.sweep.early_termination_policy import EarlyTerminationPolicy from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py index 290f4f70b382..785a43c962e9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py @@ -6,9 +6,9 @@ from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, TaskType -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( +from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase, TaskType +from azure.ai.ml._restclient.v2024_01_01_preview.models._azure_machine_learning_workspaces_enums import ( ClassificationPrimaryMetrics, ) from azure.ai.ml._restclient.v2024_01_01_preview.models import TextClassification as RestTextClassification diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py index ac19b4515caa..cec326d0fa9e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py @@ -6,8 +6,8 @@ from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationMultilabelPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.v2024_01_01_preview.models import ClassificationMultilabelPrimaryMetrics, JobBase, TaskType from azure.ai.ml._restclient.v2024_01_01_preview.models import ( TextClassificationMultilabel as RestTextClassificationMultilabel, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py index a87965f1b7ed..0785c3b0147a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py @@ -6,9 +6,9 @@ from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, TaskType -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( +from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase, TaskType +from azure.ai.ml._restclient.v2024_01_01_preview.models._azure_machine_learning_workspaces_enums import ( ClassificationPrimaryMetrics, ) from azure.ai.ml._restclient.v2024_01_01_preview.models import TextNer as RestTextNER diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/stack_ensemble_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/stack_ensemble_settings.py index c17fa7e39741..31e03345e67f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/stack_ensemble_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/stack_ensemble_settings.py @@ -4,8 +4,8 @@ from typing import Any, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import StackEnsembleSettings as RestStackEnsembleSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import StackMetaLearnerType +from azure.ai.ml._restclient.arm_ml_service.models import StackEnsembleSettings as RestStackEnsembleSettings +from azure.ai.ml._restclient.arm_ml_service.models import StackMetaLearnerType from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py index b713b962532e..e970975e697f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py @@ -5,14 +5,20 @@ # pylint: disable=protected-access from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import Classification as RestClassification -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import Classification as RestClassification +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.tabular.automl_tabular import AutoMLTabular from azure.ai.ml.entities._job.automl.tabular.featurization_settings import TabularFeaturizationSettings from azure.ai.ml.entities._job.automl.tabular.limit_settings import TabularLimitSettings @@ -163,10 +169,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=classification_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/featurization_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/featurization_settings.py index ff861faddee6..7bb6644f8b6d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/featurization_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/featurization_settings.py @@ -7,9 +7,9 @@ import logging from typing import Dict, List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import BlockedTransformers -from azure.ai.ml._restclient.v2023_04_01_preview.models import ColumnTransformer as RestColumnTransformer -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import BlockedTransformers +from azure.ai.ml._restclient.arm_ml_service.models import ColumnTransformer as RestColumnTransformer +from azure.ai.ml._restclient.arm_ml_service.models import ( TableVerticalFeaturizationSettings as RestTabularFeaturizationSettings, ) from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py index 7802ea7d8692..8b54f4d5b1de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py @@ -6,15 +6,21 @@ from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import Forecasting as RestForecasting -from azure.ai.ml._restclient.v2023_04_01_preview.models import ForecastingPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import Forecasting as RestForecasting +from azure.ai.ml._restclient.arm_ml_service.models import ForecastingPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants import TabularTrainingMode from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.stack_ensemble_settings import StackEnsembleSettings from azure.ai.ml.entities._job.automl.tabular.automl_tabular import AutoMLTabular from azure.ai.ml.entities._job.automl.tabular.featurization_settings import TabularFeaturizationSettings @@ -550,10 +556,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=forecasting_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py index 09439483a8a2..5e1533b3cb51 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_settings.py @@ -6,7 +6,7 @@ from typing import List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AutoForecastHorizon, AutoSeasonality, AutoTargetLags, @@ -17,10 +17,10 @@ CustomTargetRollingWindowSize, ForecastHorizonMode, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ForecastingSettings as RestForecastingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( SeasonalityMode, TargetLagsMode, TargetRollingWindowSizeMode, @@ -276,7 +276,7 @@ def _to_rest_object(self) -> RestForecastingSettings: target_lags = AutoTargetLags() elif self.target_lags: lags = [self.target_lags] if not isinstance(self.target_lags, list) else self.target_lags - target_lags = CustomTargetLags(values=lags) + target_lags = CustomTargetLags(values_property=lags) target_rolling_window_size = None if isinstance(self.target_rolling_window_size, str): @@ -298,7 +298,7 @@ def _to_rest_object(self) -> RestForecastingSettings: if isinstance(self.features_unknown_at_forecast_time, str) and self.features_unknown_at_forecast_time: features_unknown_at_forecast_time = [self.features_unknown_at_forecast_time] - return RestForecastingSettings( + rest_obj = RestForecastingSettings( country_or_region_for_holidays=self.country_or_region_for_holidays, cv_step_size=self.cv_step_size, forecast_horizon=forecast_horizon, @@ -312,8 +312,12 @@ def _to_rest_object(self) -> RestForecastingSettings: short_series_handling_config=self.short_series_handling_config, target_aggregate_function=self.target_aggregate_function, time_series_id_column_names=time_series_id_column_names, - features_unknown_at_forecast_time=features_unknown_at_forecast_time, ) + # ``featuresUnknownAtForecastTime`` exists on the 2023-04 wire contract but was dropped from + # the arm_ml_service (2025-12) model; preserve it via wire-key assignment. + if features_unknown_at_forecast_time is not None: + rest_obj["featuresUnknownAtForecastTime"] = features_unknown_at_forecast_time + return rest_obj @classmethod def _from_rest_object(cls, obj: RestForecastingSettings) -> "ForecastingSettings": @@ -328,7 +332,7 @@ def _from_rest_object(cls, obj: RestForecastingSettings) -> "ForecastingSettings if rest_target_lags and rest_target_lags.mode == TargetLagsMode.AUTO: target_lags = rest_target_lags.mode.lower() elif rest_target_lags: - target_lags = rest_target_lags.values + target_lags = rest_target_lags.values_property target_rolling_window_size = None if obj.target_rolling_window_size and obj.target_rolling_window_size.mode == TargetRollingWindowSizeMode.AUTO: @@ -356,7 +360,7 @@ def _from_rest_object(cls, obj: RestForecastingSettings) -> "ForecastingSettings target_aggregate_function=obj.target_aggregate_function, time_column_name=obj.time_column_name, time_series_id_column_names=obj.time_series_id_column_names, - features_unknown_at_forecast_time=obj.features_unknown_at_forecast_time, + features_unknown_at_forecast_time=obj.get("featuresUnknownAtForecastTime"), ) def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py index 1024f50422be..88f70c59e0e9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py @@ -4,7 +4,7 @@ from typing import Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import TableVerticalLimitSettings as RestTabularLimitSettings +from azure.ai.ml._restclient.arm_ml_service.models import TableVerticalLimitSettings as RestTabularLimitSettings from azure.ai.ml._utils.utils import from_iso_duration_format_mins, to_iso_duration_format_mins from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -59,16 +59,20 @@ def __init__( self.trial_timeout_minutes = trial_timeout_minutes def _to_rest_object(self) -> RestTabularLimitSettings: - return RestTabularLimitSettings( + rest_obj = RestTabularLimitSettings( enable_early_termination=self.enable_early_termination, exit_score=self.exit_score, max_concurrent_trials=self.max_concurrent_trials, max_cores_per_trial=self.max_cores_per_trial, - max_nodes=self.max_nodes, max_trials=self.max_trials, timeout=to_iso_duration_format_mins(self.timeout_minutes), trial_timeout=to_iso_duration_format_mins(self.trial_timeout_minutes), ) + # ``maxNodes`` exists on the 2023-04 wire contract but was dropped from the arm_ml_service + # (2025-12) model; preserve it via wire-key assignment. + if self.max_nodes is not None: + rest_obj["maxNodes"] = self.max_nodes + return rest_obj @classmethod def _from_rest_object(cls, obj: RestTabularLimitSettings) -> "TabularLimitSettings": @@ -77,7 +81,7 @@ def _from_rest_object(cls, obj: RestTabularLimitSettings) -> "TabularLimitSettin exit_score=obj.exit_score, max_concurrent_trials=obj.max_concurrent_trials, max_cores_per_trial=obj.max_cores_per_trial, - max_nodes=obj.max_nodes, + max_nodes=obj.get("maxNodes"), max_trials=obj.max_trials, timeout_minutes=from_iso_duration_format_mins(obj.timeout), trial_timeout_minutes=from_iso_duration_format_mins(obj.trial_timeout), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py index 0e21cdb4ce2d..e7960d4c6ef1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py @@ -6,15 +6,21 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase -from azure.ai.ml._restclient.v2023_04_01_preview.models import Regression as RestRegression -from azure.ai.ml._restclient.v2023_04_01_preview.models import RegressionPrimaryMetrics, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import Regression as RestRegression +from azure.ai.ml._restclient.arm_ml_service.models import RegressionPrimaryMetrics, TaskType from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.tabular import AutoMLTabular, TabularFeaturizationSettings, TabularLimitSettings from azure.ai.ml.entities._job.automl.training_settings import RegressionTrainingSettings from azure.ai.ml.entities._util import load_from_dict @@ -107,10 +113,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=regression_task, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/training_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/training_settings.py index ef0eee38db28..8eb295265b7a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/training_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/training_settings.py @@ -6,19 +6,19 @@ from typing import Any, List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ClassificationModels -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationModels +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationTrainingSettings as RestClassificationTrainingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ForecastingModels -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ForecastingModels +from azure.ai.ml._restclient.arm_ml_service.models import ( ForecastingTrainingSettings as RestForecastingTrainingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import RegressionModels -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import RegressionModels +from azure.ai.ml._restclient.arm_ml_service.models import ( RegressionTrainingSettings as RestRegressionTrainingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import TrainingSettings as RestTrainingSettings +from azure.ai.ml._restclient.arm_ml_service.models import TrainingSettings as RestTrainingSettings from azure.ai.ml._utils.utils import camel_to_snake, from_iso_duration_format_mins, to_iso_duration_format_mins from azure.ai.ml.constants import TabularTrainingMode from azure.ai.ml.entities._job.automl.stack_ensemble_settings import StackEnsembleSettings @@ -126,7 +126,7 @@ def blocked_training_algorithms(self, value: Optional[List[str]]) -> None: self._blocked_training_algorithms = value def _to_rest_object(self) -> RestTrainingSettings: - return RestTrainingSettings( + rest_obj = RestTrainingSettings( enable_dnn_training=self.enable_dnn_training, enable_onnx_compatible_models=self.enable_onnx_compatible_models, enable_model_explainability=self.enable_model_explainability, @@ -136,8 +136,12 @@ def _to_rest_object(self) -> RestTrainingSettings: self.stack_ensemble_settings._to_rest_object() if self.stack_ensemble_settings else None ), ensemble_model_download_timeout=to_iso_duration_format_mins(self.ensemble_model_download_timeout), - training_mode=self.training_mode, ) + # ``trainingMode`` exists on the 2023-04 wire contract but was dropped from the + # arm_ml_service (2025-12) model; preserve it via wire-key assignment. + if self.training_mode is not None: + rest_obj["trainingMode"] = self.training_mode + return rest_obj @classmethod def _from_rest_object(cls, obj: RestTrainingSettings) -> "TrainingSettings": @@ -153,7 +157,7 @@ def _from_rest_object(cls, obj: RestTrainingSettings) -> "TrainingSettings": if obj.stack_ensemble_settings else None ), - training_mode=obj.training_mode, + training_mode=obj.get("trainingMode"), ) def __eq__(self, other: object) -> bool: @@ -214,7 +218,7 @@ def blocked_training_algorithms( ) def _to_rest_object(self) -> RestClassificationTrainingSettings: - return RestClassificationTrainingSettings( + rest_obj = RestClassificationTrainingSettings( enable_dnn_training=self.enable_dnn_training, enable_onnx_compatible_models=self.enable_onnx_compatible_models, enable_model_explainability=self.enable_model_explainability, @@ -224,8 +228,10 @@ def _to_rest_object(self) -> RestClassificationTrainingSettings: ensemble_model_download_timeout=to_iso_duration_format_mins(self.ensemble_model_download_timeout), allowed_training_algorithms=self.allowed_training_algorithms, blocked_training_algorithms=self.blocked_training_algorithms, - training_mode=self.training_mode, ) + if self.training_mode is not None: + rest_obj["trainingMode"] = self.training_mode + return rest_obj @classmethod def _from_rest_object(cls, obj: RestClassificationTrainingSettings) -> "ClassificationTrainingSettings": @@ -239,7 +245,7 @@ def _from_rest_object(cls, obj: RestClassificationTrainingSettings) -> "Classifi stack_ensemble_settings=obj.stack_ensemble_settings, allowed_training_algorithms=obj.allowed_training_algorithms, blocked_training_algorithms=obj.blocked_training_algorithms, - training_mode=obj.training_mode, + training_mode=obj.get("trainingMode"), ) @@ -277,7 +283,7 @@ def blocked_training_algorithms( ) def _to_rest_object(self) -> RestForecastingTrainingSettings: - return RestForecastingTrainingSettings( + rest_obj = RestForecastingTrainingSettings( enable_dnn_training=self.enable_dnn_training, enable_onnx_compatible_models=self.enable_onnx_compatible_models, enable_model_explainability=self.enable_model_explainability, @@ -287,8 +293,10 @@ def _to_rest_object(self) -> RestForecastingTrainingSettings: ensemble_model_download_timeout=to_iso_duration_format_mins(self.ensemble_model_download_timeout), allowed_training_algorithms=self.allowed_training_algorithms, blocked_training_algorithms=self.blocked_training_algorithms, - training_mode=self.training_mode, ) + if self.training_mode is not None: + rest_obj["trainingMode"] = self.training_mode + return rest_obj @classmethod def _from_rest_object(cls, obj: RestForecastingTrainingSettings) -> "ForecastingTrainingSettings": @@ -302,7 +310,7 @@ def _from_rest_object(cls, obj: RestForecastingTrainingSettings) -> "Forecasting stack_ensemble_settings=obj.stack_ensemble_settings, allowed_training_algorithms=obj.allowed_training_algorithms, blocked_training_algorithms=obj.blocked_training_algorithms, - training_mode=obj.training_mode, + training_mode=obj.get("trainingMode"), ) @@ -340,7 +348,7 @@ def blocked_training_algorithms( ) def _to_rest_object(self) -> RestRegressionTrainingSettings: - return RestRegressionTrainingSettings( + rest_obj = RestRegressionTrainingSettings( enable_dnn_training=self.enable_dnn_training, enable_onnx_compatible_models=self.enable_onnx_compatible_models, enable_model_explainability=self.enable_model_explainability, @@ -350,8 +358,10 @@ def _to_rest_object(self) -> RestRegressionTrainingSettings: ensemble_model_download_timeout=to_iso_duration_format_mins(self.ensemble_model_download_timeout), allowed_training_algorithms=self.allowed_training_algorithms, blocked_training_algorithms=self.blocked_training_algorithms, - training_mode=self.training_mode, ) + if self.training_mode is not None: + rest_obj["trainingMode"] = self.training_mode + return rest_obj @classmethod def _from_rest_object(cls, obj: RestRegressionTrainingSettings) -> "RegressionTrainingSettings": @@ -365,5 +375,5 @@ def _from_rest_object(cls, obj: RestRegressionTrainingSettings) -> "RegressionTr stack_ensemble_settings=obj.stack_ensemble_settings, allowed_training_algorithms=obj.allowed_training_algorithms, blocked_training_algorithms=obj.blocked_training_algorithms, - training_mode=obj.training_mode, + training_mode=obj.get("trainingMode"), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py index 0ccfc8d35614..52f38a339904 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py @@ -6,7 +6,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml._schema.job.data_transfer_job import ( DataTransferCopyJobSchema, DataTransferExportJobSchema, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py index 5924d8d6b608..74b714250108 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py @@ -14,8 +14,8 @@ from typing import IO, Any, AnyStr, Dict, List, Optional, Tuple, Type, Union from azure.ai.ml._restclient.runhistory.models import Run -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, JobService -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobType as RestJobType +from azure.ai.ml._restclient.arm_ml_service.models import JobBase, JobService +from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 from azure.ai.ml._restclient.v2024_01_01_preview.models import JobType as RestJobType_20240101Preview from azure.ai.ml._utils._html_utils import make_link, to_html diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py index 0797eed0b826..2d1c22e12e39 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py @@ -6,7 +6,7 @@ from abc import ABC from typing import Any, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import CommandJobLimits as RestCommandJobLimits +from azure.ai.ml._restclient.arm_ml_service.models import CommandJobLimits as RestCommandJobLimits from azure.ai.ml._restclient.v2023_08_01_preview.models import SweepJobLimits as RestSweepJobLimits from azure.ai.ml._utils.utils import from_iso_duration_format, is_data_binding_expression, to_iso_duration_format from azure.ai.ml.constants import JobType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py index 09d7ed06c275..52b5f20d937c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py @@ -9,8 +9,8 @@ from typing_extensions import Literal -from azure.ai.ml._restclient.v2023_04_01_preview.models import AllNodes -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobService as RestJobService +from azure.ai.ml._restclient.arm_ml_service.models import AllNodes +from azure.ai.ml._restclient.arm_ml_service.models import JobService as RestJobService from azure.ai.ml.constants._job.job import JobServiceTypeNames from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py index 15484fdf5d6f..4f3ecdeb72ac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py @@ -10,7 +10,7 @@ from marshmallow import INCLUDE -from azure.ai.ml._restclient.v2023_04_01_preview.models import SweepJob +from azure.ai.ml._restclient.arm_ml_service.models import SweepJob from azure.ai.ml._schema.core.fields import ExperimentalField from azure.ai.ml.entities._assets import Environment diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 6c3d9357dd9b..5109249c9194 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -5,8 +5,8 @@ import copy from typing import Any, Dict, List, Optional, Tuple, Type, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput from azure.ai.ml.constants._component import ComponentJobConstants from azure.ai.ml.entities._inputs_outputs import GroupInput, Input, Output from azure.ai.ml.entities._util import copy_output_setting diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py index a10d4a66035c..18f645b4b11a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import ResourceConfiguration as RestResourceConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import ResourceConfiguration as RestResourceConfiguration from azure.ai.ml.constants._job.job import JobComputePropertyFields from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py index 10930fb4cbd3..a84f60497361 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py @@ -10,8 +10,8 @@ from marshmallow import INCLUDE -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJob as RestSparkJob +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import SparkJob as RestSparkJob from azure.ai.ml._schema.job.identity import AMLTokenIdentitySchema, ManagedIdentitySchema, UserIdentitySchema from azure.ai.ml._schema.job.parameterized_spark import CONF_KEY_MAP from azure.ai.ml._schema.job.spark_job import SparkJobSchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py index ed8d3ca797a7..52b45a2652c5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py @@ -5,8 +5,8 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobEntry as RestSparkJobEntry -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobPythonEntry, SparkJobScalaEntry +from azure.ai.ml._restclient.arm_ml_service.models import SparkJobEntry as RestSparkJobEntry +from azure.ai.ml._restclient.arm_ml_service.models import SparkJobPythonEntry, SparkJobScalaEntry from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py index 138fc7ed7f16..9ef9cb5bd07d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py @@ -4,7 +4,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( SparkResourceConfiguration as RestSparkResourceConfiguration, ) from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py index b1b928fcc4a4..bb3ad72f2b62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py @@ -4,11 +4,11 @@ from abc import ABC from typing import Any, Optional, cast -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicyType -from azure.ai.ml._restclient.v2023_04_01_preview.models import MedianStoppingPolicy as RestMedianStoppingPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import BanditPolicy as RestBanditPolicy +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicyType +from azure.ai.ml._restclient.arm_ml_service.models import MedianStoppingPolicy as RestMedianStoppingPolicy +from azure.ai.ml._restclient.arm_ml_service.models import ( TruncationSelectionPolicy as RestTruncationSelectionPolicy, ) from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index b4820a3e1790..06450398ef95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -23,8 +23,8 @@ from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) -from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023_preview -from azure.ai.ml._restclient.v2023_04_01_preview.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023_preview +from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024_preview from azure.ai.ml._restclient.v2024_01_01_preview.models import ComputeInstanceDataMount from azure.ai.ml._scope_dependent_operations import ( @@ -101,7 +101,7 @@ class DataOperations(_ScopeDependentOperations): :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient042023Preview or ServiceClient102021Dataplane). :type service_client: typing.Union[ - ~azure.ai.ml._restclient.v2023_04_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient, ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces] :param datastore_operations: Represents a client for performing operations on Datastores. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index eddebef77e78..f6a757527c24 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -14,8 +14,8 @@ from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) -from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview -from azure.ai.ml._restclient.v2023_04_01_preview.models import EnvironmentVersion, ListViewType +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023Preview +from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -59,7 +59,7 @@ class EnvironmentOperations(_ScopeDependentOperations): :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient042023Preview or ServiceClient102021Dataplane). :type service_client: typing.Union[ - ~azure.ai.ml._restclient.v2023_04_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient, ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces] :param all_operations: All operations classes of an MLClient object. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_index_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_index_operations.py index 11c32b28ec70..66f92b4946ca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_index_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_index_operations.py @@ -15,7 +15,7 @@ # cspell:disable-next-line from azure.ai.ml._restclient.azure_ai_assets_v2024_04_01.azureaiassetsv20240401.models import Index as RestIndex -from azure.ai.ml._restclient.v2023_04_01_preview.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index 386dafa2ca94..5b2799f3e867 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -27,8 +27,8 @@ from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataplane from azure.ai.ml._restclient.runhistory import RunHistoryClient as ServiceClientRunHistory from azure.ai.ml._restclient.runhistory.models import Run -from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient022023Preview -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, ListViewType, UserIdentity +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022023Preview +from azure.ai.ml._restclient.arm_ml_service.models import JobBase, ListViewType, UserIdentity from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as UserIdentityArm from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py index 034b9eea199c..03973a4fd372 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py @@ -14,7 +14,7 @@ from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._local_endpoints import LocalEndpointMode from azure.ai.ml._restclient.arm_ml_service.models import DeploymentLogsRequest -from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py index bae4aa823a96..16d7381e5400 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py @@ -5,7 +5,7 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity from azure.ai.ml._restclient.v2024_01_01_preview.models import ( ClassificationPrimaryMetrics, LearningRateScheduler, diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification_multilabel.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification_multilabel.py index a04515626e26..add7409ac2e0 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification_multilabel.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification_multilabel.py @@ -5,8 +5,8 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationMultilabelPrimaryMetrics, LearningRateScheduler, MLTableJobInput, diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_instance_segmentation.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_instance_segmentation.py index fa4d121358df..aee8232aa6a1 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_instance_segmentation.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_instance_segmentation.py @@ -5,18 +5,17 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2023_04_01_preview.models import ValidationMetricType -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ValidationMetricType +from azure.ai.ml._restclient.arm_ml_service.models import ( InstanceSegmentationPrimaryMetrics, LearningRateScheduler, - LogTrainingMetrics, - LogValidationLoss, MLTableJobInput, ModelSize, SamplingAlgorithmType, StochasticOptimizer, ) +from azure.ai.ml.constants._job.automl import LogTrainingMetrics, LogValidationLoss from azure.ai.ml.automl import image_instance_segmentation from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_object_detection.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_object_detection.py index 75c6cab1be94..8cc7c42619b2 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_object_detection.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_object_detection.py @@ -5,18 +5,17 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2023_04_01_preview.models import ValidationMetricType -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ValidationMetricType +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, - LogTrainingMetrics, - LogValidationLoss, MLTableJobInput, ModelSize, ObjectDetectionPrimaryMetrics, SamplingAlgorithmType, StochasticOptimizer, ) +from azure.ai.ml.constants._job.automl import LogTrainingMetrics, LogValidationLoss from azure.ai.ml.automl import image_object_detection from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py index 85ee315b74d4..58f07e5ad69c 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py @@ -3,12 +3,11 @@ import pytest -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicyType -from azure.ai.ml._restclient.v2023_04_01_preview.models import MedianStoppingPolicy as RestMedianStoppingPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import NlpSweepSettings as RestNlpSweepSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import SamplingAlgorithmType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import BanditPolicy as RestBanditPolicy +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicyType +from azure.ai.ml._restclient.arm_ml_service.models import MedianStoppingPolicy as RestMedianStoppingPolicy +from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import ( TruncationSelectionPolicy as RestTruncationSelectionPolicy, ) from azure.ai.ml.automl import NlpSweepSettings @@ -90,16 +89,22 @@ def _get_rest_obj( self, early_termination_name: Optional[EarlyTerminationPolicyType] = None, sampling_algorithm_name: SamplingAlgorithmType = SamplingAlgorithmType.GRID, - ) -> RestNlpSweepSettings: + ) -> dict: + # ``NlpSweepSettings`` is absent from arm_ml_service -> JSON-direct dict wire body. The + # early-termination child is built via the entity policy's ``_to_rest_object`` so the + # expected wire matches production exactly (including default fields like delayEvaluation). early_termination_policy = None if early_termination_name == EarlyTerminationPolicyType.BANDIT: - early_termination_policy = RestBanditPolicy(evaluation_interval=10, slack_factor=0.2) + early_termination_policy = BanditPolicy(evaluation_interval=10, slack_factor=0.2)._to_rest_object() elif early_termination_name == EarlyTerminationPolicyType.MEDIAN_STOPPING: - early_termination_policy = RestMedianStoppingPolicy(delay_evaluation=5, evaluation_interval=1) + early_termination_policy = MedianStoppingPolicy( + delay_evaluation=5, evaluation_interval=1 + )._to_rest_object() elif early_termination_name == EarlyTerminationPolicyType.TRUNCATION_SELECTION: - early_termination_policy = RestTruncationSelectionPolicy( + early_termination_policy = TruncationSelectionPolicy( evaluation_interval=1, truncation_percentage=20, delay_evaluation=5 - ) - return RestNlpSweepSettings( - sampling_algorithm=sampling_algorithm_name, early_termination=early_termination_policy - ) + )._to_rest_object() + rest_obj: dict = {"samplingAlgorithm": sampling_algorithm_name} + if early_termination_policy is not None: + rest_obj["earlyTermination"] = early_termination_policy + return rest_obj diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py index 9e4db7f8fe98..fe0a05780dcc 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py @@ -6,8 +6,8 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2024_01_01_preview.models import CustomNCrossValidations, MLTableJobInput +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import CustomNCrossValidations, MLTableJobInput from azure.ai.ml.automl import ClassificationModels, ClassificationPrimaryMetrics, classification from azure.ai.ml.constants import TabularTrainingMode from azure.ai.ml.constants._common import AssetTypes diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_job.py index 442dda027af1..eeab7ffc6cf2 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_job.py @@ -5,8 +5,8 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLTableJobInput +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import MLTableJobInput from azure.ai.ml.automl import ( ForecastingModels, ForecastingPrimaryMetrics, diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_settings.py index 537f996a03cf..d6c4dc4b1f3d 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_forecasting_settings.py @@ -2,7 +2,7 @@ import pytest -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AutoForecastHorizon, AutoSeasonality, AutoTargetLags, @@ -12,8 +12,8 @@ CustomTargetLags, CustomTargetRollingWindowSize, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ForecastingSettings as RestForecastingSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import ShortSeriesHandlingConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import ForecastingSettings as RestForecastingSettings +from azure.ai.ml._restclient.arm_ml_service.models import ShortSeriesHandlingConfiguration from azure.ai.ml.entities._job.automl.tabular.forecasting_settings import ForecastingSettings @@ -77,7 +77,7 @@ def test_forecast_horizon_to_rest(self, settings: Tuple[ForecastingSettings, Lis @pytest.mark.parametrize( "settings", [ - (RestForecastingSettings(target_lags=CustomTargetLags(values=[10, 20])), [10, 20]), + (RestForecastingSettings(target_lags=CustomTargetLags(values_property=[10, 20])), [10, 20]), (RestForecastingSettings(target_lags=AutoTargetLags()), "auto"), (RestForecastingSettings(target_lags=None), None), ], @@ -91,8 +91,8 @@ def test_target_lags_from_rest(self, settings: Tuple[RestForecastingSettings, An @pytest.mark.parametrize( "settings", [ - (ForecastingSettings(target_lags=10), CustomTargetLags(values=[10])), - (ForecastingSettings(target_lags=[10, 20, 30]), CustomTargetLags(values=[10, 20, 30])), + (ForecastingSettings(target_lags=10), CustomTargetLags(values_property=[10])), + (ForecastingSettings(target_lags=[10, 20, 30]), CustomTargetLags(values_property=[10, 20, 30])), (ForecastingSettings(target_lags="auto"), AutoTargetLags()), ], ) diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_regression_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_regression_job.py index 58c387b1b8e4..13885b1e97d1 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_regression_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_regression_job.py @@ -5,8 +5,8 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLTableJobInput +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import MLTableJobInput from azure.ai.ml.automl import RegressionModels, RegressionPrimaryMetrics, regression from azure.ai.ml.constants import TabularTrainingMode from azure.ai.ml.constants._common import AssetTypes diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py index 196423089a09..f8a5c8a9b248 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py @@ -1,6 +1,6 @@ import pytest -from azure.ai.ml._restclient.v2023_04_01_preview.models import TableVerticalLimitSettings as RestTabularLimitSettings +from azure.ai.ml._restclient.arm_ml_service.models import TableVerticalLimitSettings as RestTabularLimitSettings from azure.ai.ml.entities._job.automl.tabular import TabularLimitSettings @@ -52,27 +52,29 @@ def test_equality(self, scenario): ) def _get_rest_obj(self, scenario): + default_rest = RestTabularLimitSettings( + enable_early_termination=True, + exit_score=0.5, + max_concurrent_trials=10, + max_cores_per_trial=2, + max_trials=100, + timeout="PT10H", + trial_timeout="PT20M", + ) + max_nodes_rest = RestTabularLimitSettings( + enable_early_termination=True, + exit_score=0.5, + max_concurrent_trials=10, + max_cores_per_trial=2, + max_trials=100, + timeout="PT10H", + trial_timeout="PT20M", + ) + # ``maxNodes`` is preserved via wire-key (dropped from the arm_ml_service model). + max_nodes_rest["maxNodes"] = 4 rest_objs = { - "default": RestTabularLimitSettings( - enable_early_termination=True, - exit_score=0.5, - max_concurrent_trials=10, - max_cores_per_trial=2, - max_trials=100, - timeout="PT10H", - trial_timeout="PT20M", - max_nodes=None, - ), - "max_nodes": RestTabularLimitSettings( - enable_early_termination=True, - exit_score=0.5, - max_concurrent_trials=10, - max_cores_per_trial=2, - max_trials=100, - timeout="PT10H", - trial_timeout="PT20M", - max_nodes=4, - ), + "default": default_rest, + "max_nodes": max_nodes_rest, } return rest_objs[scenario] diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py index 395331cdb3e0..9553572c39e2 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py @@ -1,9 +1,9 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.v2024_01_01_preview.models import BanditPolicy as RestBanditPolicy +from azure.ai.ml._restclient.v2024_01_01_preview.models import ( JobBase, LogVerbosity, NlpFixedParameters, @@ -13,7 +13,7 @@ NlpVerticalLimitSettings, SamplingAlgorithmType, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( +from azure.ai.ml._restclient.v2024_01_01_preview.models._azure_machine_learning_workspaces_enums import ( ClassificationPrimaryMetrics, ) from azure.ai.ml._restclient.v2024_01_01_preview.models import MLTableJobInput, TextClassification From bdbea0853f823ca0a8afe2db40a0e237c9a12f40 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 2 Jul 2026 15:43:30 +0530 Subject: [PATCH 005/146] migrate(automl): move public AutoML enum re-exports to arm_ml_service --- sdk/ml/azure-ai-ml/azure/ai/ml/automl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/__init__.py index d34e30a8b32d..b8f7045e86d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/automl/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/automl/__init__.py @@ -45,7 +45,7 @@ TabularLimitSettings, ) -from .._restclient.v2023_04_01_preview.models import ( +from .._restclient.arm_ml_service.models import ( BlockedTransformers, ClassificationModels, ClassificationMultilabelPrimaryMetrics, From 3fd9646967893c0e8812e3a45992f56bb7530643 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 10:33:14 +0530 Subject: [PATCH 006/146] fix(automl): complete NLP arm migration + preserve isArchived/sweep/maxNodes wire fields --- .../automl/image/image_classification_job.py | 1 + .../image_classification_multilabel_job.py | 1 + .../image/image_instance_segmentation_job.py | 1 + .../image/image_object_detection_job.py | 1 + .../_job/automl/image/image_sweep_settings.py | 9 +- .../_job/automl/nlp/automl_nlp_job.py | 4 +- .../automl/nlp/nlp_featurization_settings.py | 2 +- .../_job/automl/nlp/nlp_fixed_parameters.py | 49 ++--- .../_job/automl/nlp/nlp_limit_settings.py | 18 +- .../_job/automl/nlp/nlp_search_space.py | 64 ++++--- .../_job/automl/nlp/nlp_sweep_settings.py | 30 +-- .../automl/nlp/text_classification_job.py | 55 +++--- .../nlp/text_classification_multilabel_job.py | 50 +++-- .../entities/_job/automl/nlp/text_ner_job.py | 53 ++--- .../_job/automl/tabular/automl_tabular.py | 2 +- .../_job/automl/tabular/classification_job.py | 1 + .../_job/automl/tabular/forecasting_job.py | 1 + .../_job/automl/tabular/limit_settings.py | 4 + .../_job/automl/tabular/regression_job.py | 1 + .../_job/sweep/early_termination_policy.py | 10 +- .../test_automl_image_classification.py | 2 +- .../unittests/test_automl_image_schema.py | 34 ++-- .../test_automl_image_sweep_setting.py | 16 +- .../unittests/test_automl_nlp_schema.py | 181 ++++++++++-------- .../test_automl_nlp_sweep_settings.py | 26 ++- .../unittests/test_automl_tabular_schema.py | 54 ++++-- .../unittests/test_classification_job.py | 2 +- .../test_tabular_featurization_settings.py | 4 +- .../unittests/test_tabular_limit_settings.py | 6 + ...est_tabular_n_cross_validation_settings.py | 25 ++- .../unittests/test_text_classification_job.py | 85 ++++---- ...test_text_classification_multilabel_job.py | 87 +++++---- .../automl_job/unittests/test_text_ner_job.py | 90 +++++---- 33 files changed, 559 insertions(+), 410 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py index 961f01140c3a..36bb241511b7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py @@ -109,6 +109,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py index dec0b7156996..11e8aba80770 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py @@ -111,6 +111,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py index 44f796e28188..7757389961fe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py @@ -106,6 +106,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py index 8485ec8dde96..e5a9688894c4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py @@ -106,6 +106,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py index 3fe2f2433105..b89bec0ba5a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_sweep_settings.py @@ -6,8 +6,10 @@ from typing import Optional, Union +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy from azure.ai.ml._restclient.arm_ml_service.models import ImageSweepSettings as RestImageSweepSettings from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType +from azure.ai.ml.entities._job._input_output_helpers import to_hybrid_rest_model from azure.ai.ml.entities._job.sweep.early_termination_policy import ( BanditPolicy, EarlyTerminationPolicy, @@ -64,7 +66,12 @@ def __init__( def _to_rest_object(self) -> RestImageSweepSettings: return RestImageSweepSettings( sampling_algorithm=self.sampling_algorithm, - early_termination=self.early_termination._to_rest_object() if self.early_termination else None, + # ``early_termination_policy`` is a shared msrest boundary helper; convert its msrest + # rest object to the arm_ml_service hybrid equivalent so it fits this arm envelope. + early_termination=to_hybrid_rest_model( + self.early_termination._to_rest_object() if self.early_termination else None, + RestEarlyTerminationPolicy, + ), ) @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py index 87a7313927a7..e41d5dee6ffc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py @@ -4,12 +4,12 @@ from abc import ABC from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( LogVerbosity, - NlpLearningRateScheduler, SamplingAlgorithmType, ) from azure.ai.ml._utils.utils import camel_to_snake +from azure.ai.ml.constants._job.automl import NlpLearningRateScheduler from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.automl.automl_vertical import AutoMLVertical from azure.ai.ml.entities._job.automl.nlp.nlp_featurization_settings import NlpFeaturizationSettings diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py index 72cc4edff3a9..7d98b509848f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_featurization_settings.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( NlpVerticalFeaturizationSettings as RestNlpVerticalFeaturizationSettings, ) from azure.ai.ml.entities._job.automl.featurization_settings import FeaturizationSettings, FeaturizationSettingsType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py index adcd4ea58bfe..79b1dd5998d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_fixed_parameters.py @@ -1,9 +1,8 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import Optional +from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpFixedParameters as RestNlpFixedParameters from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -70,31 +69,33 @@ def __init__( self.warmup_ratio = warmup_ratio self.weight_decay = weight_decay - def _to_rest_object(self) -> RestNlpFixedParameters: - return RestNlpFixedParameters( - gradient_accumulation_steps=self.gradient_accumulation_steps, - learning_rate=self.learning_rate, - learning_rate_scheduler=self.learning_rate_scheduler, - model_name=self.model_name, - number_of_epochs=self.number_of_epochs, - training_batch_size=self.training_batch_size, - validation_batch_size=self.validation_batch_size, - warmup_ratio=self.warmup_ratio, - weight_decay=self.weight_decay, - ) + def _to_rest_object(self) -> Dict[str, Any]: + # ``NlpFixedParameters`` was dropped from the arm_ml_service (2025-12) model set; emit the + # camelCase wire dict directly so it round-trips through ``SdkJSONEncoder``. + return { + "gradientAccumulationSteps": self.gradient_accumulation_steps, + "learningRate": self.learning_rate, + "learningRateScheduler": self.learning_rate_scheduler, + "modelName": self.model_name, + "numberOfEpochs": self.number_of_epochs, + "trainingBatchSize": self.training_batch_size, + "validationBatchSize": self.validation_batch_size, + "warmupRatio": self.warmup_ratio, + "weightDecay": self.weight_decay, + } @classmethod - def _from_rest_object(cls, obj: RestNlpFixedParameters) -> "NlpFixedParameters": + def _from_rest_object(cls, obj: Dict[str, Any]) -> "NlpFixedParameters": return cls( - gradient_accumulation_steps=obj.gradient_accumulation_steps, - learning_rate=obj.learning_rate, - learning_rate_scheduler=obj.learning_rate_scheduler, - model_name=obj.model_name, - number_of_epochs=obj.number_of_epochs, - training_batch_size=obj.training_batch_size, - validation_batch_size=obj.validation_batch_size, - warmup_ratio=obj.warmup_ratio, - weight_decay=obj.weight_decay, + gradient_accumulation_steps=obj.get("gradientAccumulationSteps"), + learning_rate=obj.get("learningRate"), + learning_rate_scheduler=obj.get("learningRateScheduler"), + model_name=obj.get("modelName"), + number_of_epochs=obj.get("numberOfEpochs"), + training_batch_size=obj.get("trainingBatchSize"), + validation_batch_size=obj.get("validationBatchSize"), + warmup_ratio=obj.get("warmupRatio"), + weight_decay=obj.get("weightDecay"), ) def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py index c9c423e91b50..1c1ea8c97eeb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_limit_settings.py @@ -4,7 +4,7 @@ from typing import Optional -from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpVerticalLimitSettings as RestNlpLimitSettings +from azure.ai.ml._restclient.arm_ml_service.models import NlpVerticalLimitSettings as RestNlpLimitSettings from azure.ai.ml._utils.utils import from_iso_duration_format_mins, to_iso_duration_format_mins from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -45,22 +45,28 @@ def __init__( self.trial_timeout_minutes = trial_timeout_minutes def _to_rest_object(self) -> RestNlpLimitSettings: - return RestNlpLimitSettings( + rest_obj = RestNlpLimitSettings( max_concurrent_trials=self.max_concurrent_trials, max_trials=self.max_trials, - max_nodes=self.max_nodes, timeout=to_iso_duration_format_mins(self.timeout_minutes), - trial_timeout=to_iso_duration_format_mins(self.trial_timeout_minutes), ) + # ``maxNodes``/``trialTimeout`` exist on the 2023-04 wire contract but were dropped from the + # arm_ml_service (2025-12) model; preserve them via wire-key assignment. + if self.max_nodes is not None: + rest_obj["maxNodes"] = self.max_nodes + trial_timeout = to_iso_duration_format_mins(self.trial_timeout_minutes) + if trial_timeout is not None: + rest_obj["trialTimeout"] = trial_timeout + return rest_obj @classmethod def _from_rest_object(cls, obj: RestNlpLimitSettings) -> "NlpLimitSettings": return cls( max_concurrent_trials=obj.max_concurrent_trials, max_trials=obj.max_trials, - max_nodes=obj.max_nodes, + max_nodes=obj.get("maxNodes"), timeout_minutes=from_iso_duration_format_mins(obj.timeout), - trial_timeout_minutes=from_iso_duration_format_mins(obj.trial_timeout), + trial_timeout_minutes=from_iso_duration_format_mins(obj.get("trialTimeout")), ) def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py index 6d96f5555348..c4f88552c9fb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_search_space.py @@ -2,11 +2,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import Optional, Union +from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpLearningRateScheduler, NlpParameterSubspace from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.constants import NlpModels +from azure.ai.ml.constants._job.automl import NlpLearningRateScheduler from azure.ai.ml.entities._job.automl.search_space import SearchSpace from azure.ai.ml.entities._job.automl.search_space_utils import _convert_from_rest_object, _convert_to_rest_object from azure.ai.ml.entities._job.sweep.search_space import Choice, SweepDistribution @@ -94,59 +94,71 @@ def __init__( self.warmup_ratio = warmup_ratio self.weight_decay = weight_decay - def _to_rest_object(self) -> NlpParameterSubspace: - return NlpParameterSubspace( - gradient_accumulation_steps=( + def _to_rest_object(self) -> Dict[str, Any]: + # ``NlpParameterSubspace`` was dropped from the arm_ml_service (2025-12) model set; emit the + # camelCase wire dict directly so it round-trips through ``SdkJSONEncoder``. + return { + "gradientAccumulationSteps": ( _convert_to_rest_object(self.gradient_accumulation_steps) if self.gradient_accumulation_steps is not None else None ), - learning_rate=_convert_to_rest_object(self.learning_rate) if self.learning_rate is not None else None, - learning_rate_scheduler=( + "learningRate": _convert_to_rest_object(self.learning_rate) if self.learning_rate is not None else None, + "learningRateScheduler": ( _convert_to_rest_object(self.learning_rate_scheduler) if self.learning_rate_scheduler is not None else None ), - model_name=_convert_to_rest_object(self.model_name) if self.model_name is not None else None, - number_of_epochs=( + "modelName": _convert_to_rest_object(self.model_name) if self.model_name is not None else None, + "numberOfEpochs": ( _convert_to_rest_object(self.number_of_epochs) if self.number_of_epochs is not None else None ), - training_batch_size=( + "trainingBatchSize": ( _convert_to_rest_object(self.training_batch_size) if self.training_batch_size is not None else None ), - validation_batch_size=( + "validationBatchSize": ( _convert_to_rest_object(self.validation_batch_size) if self.validation_batch_size is not None else None ), - warmup_ratio=_convert_to_rest_object(self.warmup_ratio) if self.warmup_ratio is not None else None, - weight_decay=_convert_to_rest_object(self.weight_decay) if self.weight_decay is not None else None, - ) + "warmupRatio": _convert_to_rest_object(self.warmup_ratio) if self.warmup_ratio is not None else None, + "weightDecay": _convert_to_rest_object(self.weight_decay) if self.weight_decay is not None else None, + } @classmethod - def _from_rest_object(cls, obj: NlpParameterSubspace) -> "NlpSearchSpace": + def _from_rest_object(cls, obj: Dict[str, Any]) -> "NlpSearchSpace": return cls( gradient_accumulation_steps=( - _convert_from_rest_object(obj.gradient_accumulation_steps) - if obj.gradient_accumulation_steps is not None + _convert_from_rest_object(obj.get("gradientAccumulationSteps")) + if obj.get("gradientAccumulationSteps") is not None else None ), - learning_rate=_convert_from_rest_object(obj.learning_rate) if obj.learning_rate is not None else None, + learning_rate=( + _convert_from_rest_object(obj.get("learningRate")) if obj.get("learningRate") is not None else None + ), learning_rate_scheduler=( - _convert_from_rest_object(obj.learning_rate_scheduler) - if obj.learning_rate_scheduler is not None + _convert_from_rest_object(obj.get("learningRateScheduler")) + if obj.get("learningRateScheduler") is not None else None ), - model_name=_convert_from_rest_object(obj.model_name) if obj.model_name is not None else None, + model_name=_convert_from_rest_object(obj.get("modelName")) if obj.get("modelName") is not None else None, number_of_epochs=( - _convert_from_rest_object(obj.number_of_epochs) if obj.number_of_epochs is not None else None + _convert_from_rest_object(obj.get("numberOfEpochs")) if obj.get("numberOfEpochs") is not None else None ), training_batch_size=( - _convert_from_rest_object(obj.training_batch_size) if obj.training_batch_size is not None else None + _convert_from_rest_object(obj.get("trainingBatchSize")) + if obj.get("trainingBatchSize") is not None + else None ), validation_batch_size=( - _convert_from_rest_object(obj.validation_batch_size) if obj.validation_batch_size is not None else None + _convert_from_rest_object(obj.get("validationBatchSize")) + if obj.get("validationBatchSize") is not None + else None + ), + warmup_ratio=( + _convert_from_rest_object(obj.get("warmupRatio")) if obj.get("warmupRatio") is not None else None + ), + weight_decay=( + _convert_from_rest_object(obj.get("weightDecay")) if obj.get("weightDecay") is not None else None ), - warmup_ratio=_convert_from_rest_object(obj.warmup_ratio) if obj.warmup_ratio is not None else None, - weight_decay=_convert_from_rest_object(obj.weight_decay) if obj.weight_decay is not None else None, ) @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py index 7c98aa45ca0c..debbdc9d420b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/nlp_sweep_settings.py @@ -2,10 +2,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import Optional, Union +from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import NlpSweepSettings as RestNlpSweepSettings -from azure.ai.ml._restclient.v2024_01_01_preview.models import SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy +from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType +from azure.ai.ml.entities._job._input_output_helpers import to_hybrid_rest_model from azure.ai.ml.entities._job.sweep.early_termination_policy import EarlyTerminationPolicy from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -40,18 +41,25 @@ def __init__( self.sampling_algorithm = sampling_algorithm self.early_termination = early_termination - def _to_rest_object(self) -> RestNlpSweepSettings: - return RestNlpSweepSettings( - sampling_algorithm=self.sampling_algorithm, - early_termination=self.early_termination._to_rest_object() if self.early_termination else None, - ) + def _to_rest_object(self) -> Dict[str, Any]: + # ``NlpSweepSettings`` was dropped from the arm_ml_service (2025-12) model set; emit the + # camelCase wire dict directly so it round-trips through ``SdkJSONEncoder``. + rest_obj: Dict[str, Any] = {"samplingAlgorithm": self.sampling_algorithm} + if self.early_termination is not None: + # ``early_termination_policy`` is a shared msrest boundary helper; convert its msrest + # rest object to the arm_ml_service hybrid equivalent so ``SdkJSONEncoder`` can serialize it. + rest_obj["earlyTermination"] = to_hybrid_rest_model( + self.early_termination._to_rest_object(), RestEarlyTerminationPolicy + ) + return rest_obj @classmethod - def _from_rest_object(cls, obj: RestNlpSweepSettings) -> "NlpSweepSettings": + def _from_rest_object(cls, obj: Dict[str, Any]) -> "NlpSweepSettings": + early_termination = obj.get("earlyTermination") return cls( - sampling_algorithm=obj.sampling_algorithm, + sampling_algorithm=obj.get("samplingAlgorithm"), early_termination=( - EarlyTerminationPolicy._from_rest_object(obj.early_termination) if obj.early_termination else None + EarlyTerminationPolicy._from_rest_object(early_termination) if early_termination else None ), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py index 785a43c962e9..59a0ecdadf43 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py @@ -6,18 +6,23 @@ from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase, TaskType -from azure.ai.ml._restclient.v2024_01_01_preview.models._azure_machine_learning_workspaces_enums import ( - ClassificationPrimaryMetrics, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import TextClassification as RestTextClassification +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import TaskType +from azure.ai.ml._restclient.arm_ml_service.models import TextClassification as RestTextClassification from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration from azure.ai.ml.entities._inputs_outputs import Input -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.nlp.automl_nlp_job import AutoMLNLPJob from azure.ai.ml.entities._job.automl.nlp.nlp_featurization_settings import NlpFeaturizationSettings from azure.ai.ml.entities._job.automl.nlp.nlp_fixed_parameters import NlpFixedParameters @@ -104,22 +109,26 @@ def _to_rest_object(self) -> JobBase: training_data=self.training_data, validation_data=self.validation_data, limit_settings=self._limits._to_rest_object() if self._limits else None, - sweep_settings=self._sweep._to_rest_object() if self._sweep else None, - fixed_parameters=self._training_parameters._to_rest_object() if self._training_parameters else None, - search_space=( - [entry._to_rest_object() for entry in self._search_space if entry is not None] - if self._search_space is not None - else None - ), featurization_settings=self._featurization._to_rest_object() if self._featurization else None, primary_metric=self.primary_metric, log_verbosity=self.log_verbosity, ) + # ``fixedParameters``/``searchSpace``/``sweepSettings`` were dropped from the arm_ml_service + # (2025-12) TextClassification model; assign them via wire-key so they still serialize. + if self._sweep: + text_classification["sweepSettings"] = self._sweep._to_rest_object() + if self._training_parameters: + text_classification["fixedParameters"] = self._training_parameters._to_rest_object() + if self._search_space is not None: + text_classification["searchSpace"] = [ + entry._to_rest_object() for entry in self._search_space if entry is not None + ] # resolve data inputs in rest object self._resolve_data_inputs(text_classification) properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, @@ -128,10 +137,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=text_classification, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) @@ -152,12 +163,10 @@ def _from_rest_object(cls, obj: JobBase) -> "TextClassificationJob": if task_details.featurization_settings else None ) - sweep = NlpSweepSettings._from_rest_object(task_details.sweep_settings) if task_details.sweep_settings else None - training_parameters = ( - NlpFixedParameters._from_rest_object(task_details.fixed_parameters) - if task_details.fixed_parameters - else None - ) + sweep_settings = task_details.get("sweepSettings") + sweep = NlpSweepSettings._from_rest_object(sweep_settings) if sweep_settings else None + fixed_parameters = task_details.get("fixedParameters") + training_parameters = NlpFixedParameters._from_rest_object(fixed_parameters) if fixed_parameters else None text_classification_job = cls( # ----- job specific params @@ -183,7 +192,7 @@ def _from_rest_object(cls, obj: JobBase) -> "TextClassificationJob": limits=limits, sweep=sweep, training_parameters=training_parameters, - search_space=cls._get_search_space_from_str(task_details.search_space), + search_space=cls._get_search_space_from_str(task_details.get("searchSpace")), featurization=featurization, identity=( _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py index cec326d0fa9e..13ad5f199749 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py @@ -6,9 +6,11 @@ from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2024_01_01_preview.models import ClassificationMultilabelPrimaryMetrics, JobBase, TaskType -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationMultilabelPrimaryMetrics, JobBase, TaskType +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import ( TextClassificationMultilabel as RestTextClassificationMultilabel, ) from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression @@ -16,7 +18,11 @@ from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration from azure.ai.ml.entities._inputs_outputs import Input -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.nlp.automl_nlp_job import AutoMLNLPJob from azure.ai.ml.entities._job.automl.nlp.nlp_featurization_settings import NlpFeaturizationSettings from azure.ai.ml.entities._job.automl.nlp.nlp_fixed_parameters import NlpFixedParameters @@ -98,22 +104,26 @@ def _to_rest_object(self) -> JobBase: training_data=self.training_data, validation_data=self.validation_data, limit_settings=self._limits._to_rest_object() if self._limits else None, - sweep_settings=self._sweep._to_rest_object() if self._sweep else None, - fixed_parameters=self._training_parameters._to_rest_object() if self._training_parameters else None, - search_space=( - [entry._to_rest_object() for entry in self._search_space if entry is not None] - if self._search_space is not None - else None - ), featurization_settings=self._featurization._to_rest_object() if self._featurization else None, primary_metric=self.primary_metric, log_verbosity=self.log_verbosity, ) + # ``fixedParameters``/``searchSpace``/``sweepSettings`` were dropped from the arm_ml_service + # (2025-12) TextClassificationMultilabel model; assign them via wire-key so they still serialize. + if self._sweep: + text_classification_multilabel["sweepSettings"] = self._sweep._to_rest_object() + if self._training_parameters: + text_classification_multilabel["fixedParameters"] = self._training_parameters._to_rest_object() + if self._search_space is not None: + text_classification_multilabel["searchSpace"] = [ + entry._to_rest_object() for entry in self._search_space if entry is not None + ] # resolve data inputs in rest object self._resolve_data_inputs(text_classification_multilabel) properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, @@ -122,10 +132,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=text_classification_multilabel, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) @@ -146,12 +158,10 @@ def _from_rest_object(cls, obj: JobBase) -> "TextClassificationMultilabelJob": if task_details.featurization_settings else None ) - sweep = NlpSweepSettings._from_rest_object(task_details.sweep_settings) if task_details.sweep_settings else None - training_parameters = ( - NlpFixedParameters._from_rest_object(task_details.fixed_parameters) - if task_details.fixed_parameters - else None - ) + sweep_settings = task_details.get("sweepSettings") + sweep = NlpSweepSettings._from_rest_object(sweep_settings) if sweep_settings else None + fixed_parameters = task_details.get("fixedParameters") + training_parameters = NlpFixedParameters._from_rest_object(fixed_parameters) if fixed_parameters else None text_classification_multilabel_job = cls( # ----- job specific params @@ -177,7 +187,7 @@ def _from_rest_object(cls, obj: JobBase) -> "TextClassificationMultilabelJob": limits=limits, sweep=sweep, training_parameters=training_parameters, - search_space=cls._get_search_space_from_str(task_details.search_space), + search_space=cls._get_search_space_from_str(task_details.get("searchSpace")), featurization=featurization, identity=( _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py index 0785c3b0147a..301988256193 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py @@ -6,18 +6,23 @@ from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase, TaskType -from azure.ai.ml._restclient.v2024_01_01_preview.models._azure_machine_learning_workspaces_enums import ( - ClassificationPrimaryMetrics, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import TextNer as RestTextNER +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import TaskType +from azure.ai.ml._restclient.arm_ml_service.models import TextNer as RestTextNER from azure.ai.ml._utils.utils import camel_to_snake, is_data_binding_expression from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._job.automl import AutoMLConstants from azure.ai.ml.entities._credentials import _BaseJobIdentityConfiguration from azure.ai.ml.entities._inputs_outputs import Input -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.automl.nlp.automl_nlp_job import AutoMLNLPJob from azure.ai.ml.entities._job.automl.nlp.nlp_featurization_settings import NlpFeaturizationSettings from azure.ai.ml.entities._job.automl.nlp.nlp_fixed_parameters import NlpFixedParameters @@ -95,22 +100,24 @@ def _to_rest_object(self) -> JobBase: training_data=self.training_data, validation_data=self.validation_data, limit_settings=self._limits._to_rest_object() if self._limits else None, - sweep_settings=self._sweep._to_rest_object() if self._sweep else None, - fixed_parameters=self._training_parameters._to_rest_object() if self._training_parameters else None, - search_space=( - [entry._to_rest_object() for entry in self._search_space if entry is not None] - if self._search_space is not None - else None - ), featurization_settings=self._featurization._to_rest_object() if self._featurization else None, primary_metric=self.primary_metric, log_verbosity=self.log_verbosity, ) + # ``fixedParameters``/``searchSpace``/``sweepSettings`` were dropped from the arm_ml_service + # (2025-12) TextNer model; assign them via wire-key so they still serialize on the wire. + if self._sweep: + text_ner["sweepSettings"] = self._sweep._to_rest_object() + if self._training_parameters: + text_ner["fixedParameters"] = self._training_parameters._to_rest_object() + if self._search_space is not None: + text_ner["searchSpace"] = [entry._to_rest_object() for entry in self._search_space if entry is not None] # resolve data inputs in rest object self._resolve_data_inputs(text_ner) properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, @@ -119,10 +126,12 @@ def _to_rest_object(self) -> JobBase: environment_id=self.environment_id, environment_variables=self.environment_variables, services=self.services, - outputs=to_rest_data_outputs(self.outputs), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), resources=self.resources, task_details=text_ner, - identity=self.identity._to_job_rest_object() if self.identity else None, + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration + ), queue_settings=self.queue_settings, ) @@ -143,12 +152,10 @@ def _from_rest_object(cls, obj: JobBase) -> "TextNerJob": if task_details.featurization_settings else None ) - sweep = NlpSweepSettings._from_rest_object(task_details.sweep_settings) if task_details.sweep_settings else None - training_parameters = ( - NlpFixedParameters._from_rest_object(task_details.fixed_parameters) - if task_details.fixed_parameters - else None - ) + sweep_settings = task_details.get("sweepSettings") + sweep = NlpSweepSettings._from_rest_object(sweep_settings) if sweep_settings else None + fixed_parameters = task_details.get("fixedParameters") + training_parameters = NlpFixedParameters._from_rest_object(fixed_parameters) if fixed_parameters else None text_ner_job = cls( # ----- job specific params @@ -174,7 +181,7 @@ def _from_rest_object(cls, obj: JobBase) -> "TextNerJob": limits=limits, sweep=sweep, training_parameters=training_parameters, - search_space=cls._get_search_space_from_str(task_details.search_space), + search_space=cls._get_search_space_from_str(task_details.get("searchSpace")), featurization=featurization, identity=( _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py index 5f4ed22b3249..0cd5013fa7e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/automl_tabular.py @@ -7,7 +7,7 @@ from abc import ABC from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AutoNCrossValidations, BlockedTransformers, CustomNCrossValidations, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py index e970975e697f..36a858c1f67d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py @@ -161,6 +161,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py index 8b54f4d5b1de..e33f54c6d3f9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py @@ -548,6 +548,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py index 88f70c59e0e9..b9829cb40479 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/limit_settings.py @@ -72,6 +72,10 @@ def _to_rest_object(self) -> RestTabularLimitSettings: # (2025-12) model; preserve it via wire-key assignment. if self.max_nodes is not None: rest_obj["maxNodes"] = self.max_nodes + # ``sweepConcurrentTrials``/``sweepTrials`` were serialized (default 0) by the legacy msrest + # model but dropped from the arm_ml_service model; preserve them to keep the wire identical. + rest_obj["sweepConcurrentTrials"] = 0 + rest_obj["sweepTrials"] = 0 return rest_obj @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py index e7960d4c6ef1..5f8b2b19fe40 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py @@ -105,6 +105,7 @@ def _to_rest_object(self) -> JobBase: properties = RestAutoMLJob( display_name=self.display_name, + is_archived=False, description=self.description, experiment_name=self.experiment_name, tags=self.tags, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py index bb3ad72f2b62..b1b928fcc4a4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py @@ -4,11 +4,11 @@ from abc import ABC from typing import Any, Optional, cast -from azure.ai.ml._restclient.arm_ml_service.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy -from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicyType -from azure.ai.ml._restclient.arm_ml_service.models import MedianStoppingPolicy as RestMedianStoppingPolicy -from azure.ai.ml._restclient.arm_ml_service.models import ( +from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy +from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy +from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicyType +from azure.ai.ml._restclient.v2023_04_01_preview.models import MedianStoppingPolicy as RestMedianStoppingPolicy +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( TruncationSelectionPolicy as RestTruncationSelectionPolicy, ) from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py index 16d7381e5400..d4ff1c396dfd 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_classification.py @@ -6,7 +6,7 @@ from azure.ai.ml import UserIdentityConfiguration from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationPrimaryMetrics, LearningRateScheduler, MLTableJobInput, diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_schema.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_schema.py index 28bf73c60e0c..a500496b7c22 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_schema.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_schema.py @@ -10,45 +10,45 @@ from marshmallow.exceptions import ValidationError from azure.ai.ml import load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, ModelSize, StochasticOptimizer, ValidationMetricType, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import BanditPolicy as RestBanditPolicy +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationMultilabelPrimaryMetrics, ClassificationPrimaryMetrics, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageClassification as RestImageClassification, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageClassificationMultilabel as RestImageClassificationMultilabel, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageInstanceSegmentation as RestImageInstanceSegmentation, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ImageLimitSettings as RestImageLimitSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ImageLimitSettings as RestImageLimitSettings +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageModelDistributionSettingsClassification as RestImageClassificationSearchSpace, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageModelDistributionSettingsObjectDetection as RestImageObjectDetectionSearchSpace, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageModelSettingsClassification as RestImageModelSettingsClassification, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageModelSettingsObjectDetection as RestImageModelSettingsObjectDetection, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ImageObjectDetection as RestImageObjectDetection, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ImageSweepSettings as RestImageSweepSettings -from azure.ai.ml._restclient.v2024_01_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ImageSweepSettings as RestImageSweepSettings +from azure.ai.ml._restclient.arm_ml_service.models import ( InstanceSegmentationPrimaryMetrics, JobBase, LogVerbosity, @@ -130,6 +130,9 @@ def expected_image_sweep_settings() -> RestImageSweepSettings: early_termination=RestBanditPolicy( slack_factor=0.2, evaluation_interval=10, + # arm_ml_service serializes all set fields; the entity BanditPolicy emits these defaults. + slack_amount=0, + delay_evaluation=0, ), ) @@ -336,6 +339,7 @@ def _get_rest_automl_job(automl_task, name, compute_id): properties={}, outputs={}, tags={}, + is_archived=False, ) result = JobBase(properties=properties) result.name = name diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_sweep_setting.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_sweep_setting.py index 63dc080dba93..019171d68df9 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_sweep_setting.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_image_sweep_setting.py @@ -7,12 +7,12 @@ import pytest -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicyType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImageSweepSettings as RestImageSweepSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models import MedianStoppingPolicy as RestMedianStoppingPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import SamplingAlgorithmType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import BanditPolicy as RestBanditPolicy +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicyType +from azure.ai.ml._restclient.arm_ml_service.models import ImageSweepSettings as RestImageSweepSettings +from azure.ai.ml._restclient.arm_ml_service.models import MedianStoppingPolicy as RestMedianStoppingPolicy +from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import ( TruncationSelectionPolicy as RestTruncationSelectionPolicy, ) from azure.ai.ml.entities._job.automl.image import ImageSweepSettings @@ -88,7 +88,9 @@ def _get_rest_obj( sampling_algorithm_name: SamplingAlgorithmType = SamplingAlgorithmType.GRID, ) -> RestImageSweepSettings: if early_termination_name == EarlyTerminationPolicyType.BANDIT: - rest_early_termination_name = RestBanditPolicy(evaluation_interval=10, slack_factor=0.2) + rest_early_termination_name = RestBanditPolicy( + evaluation_interval=10, slack_factor=0.2, slack_amount=0, delay_evaluation=0 + ) elif early_termination_name == EarlyTerminationPolicyType.MEDIAN_STOPPING: rest_early_termination_name = RestMedianStoppingPolicy(delay_evaluation=5, evaluation_interval=1) elif early_termination_name == EarlyTerminationPolicyType.TRUNCATION_SELECTION: diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_schema.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_schema.py index 88b867317276..9fe42e22eaec 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_schema.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_schema.py @@ -6,30 +6,24 @@ import pytest from azure.ai.ml import load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import NlpFixedParameters as RestNlpFixedParameters -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( - NlpParameterSubspace as RestNlpParameterSubspace, -) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import NlpSweepSettings as RestNlpSweepSettings -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ( NlpVerticalFeaturizationSettings as RestNlpFeaturizationSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( NlpVerticalLimitSettings as RestNlpVerticalLimitSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( TextClassificationMultilabel as RestTextClassificationMultilabel, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import TextNer as RestTextNer -from azure.ai.ml._restclient.v2024_01_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import TextNer as RestTextNer +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationPrimaryMetrics, JobBase, LogVerbosity, MLTableJobInput, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models._models_py3 import TextClassification as RestTextClassification +from azure.ai.ml._restclient.arm_ml_service.models import TextClassification as RestTextClassification from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml._utils.utils import dump_yaml_to_file, load_yaml, to_iso_duration_format_mins from azure.ai.ml.automl import ( @@ -43,6 +37,7 @@ from azure.ai.ml.entities import Job from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.automl.automl_job import AutoMLJob +from azure.ai.ml.sweep import BanditPolicy @pytest.fixture(autouse=True) @@ -65,47 +60,61 @@ def nlp_limits_expected(run_type: str) -> RestNlpVerticalLimitSettings: max_trials = 4 max_concurrent_trials = 4 max_nodes = 16 - return RestNlpVerticalLimitSettings( + limit_settings = RestNlpVerticalLimitSettings( timeout=to_iso_duration_format_mins(30), - trial_timeout=to_iso_duration_format_mins(10), - max_nodes=max_nodes, max_concurrent_trials=max_concurrent_trials, max_trials=max_trials, ) + # ``maxNodes``/``trialTimeout`` were dropped from the arm_ml_service model; carried as wire-keys. + limit_settings["maxNodes"] = max_nodes + limit_settings["trialTimeout"] = to_iso_duration_format_mins(10) + return limit_settings @pytest.fixture -def nlp_sweep_settings_expected() -> RestNlpSweepSettings: - return RestNlpSweepSettings( +def nlp_sweep_settings_expected() -> dict: + # ``NlpSweepSettings`` is JSON-direct under arm_ml_service; build the wire dict via the entity. + return NlpSweepSettings( sampling_algorithm="grid", - early_termination=RestBanditPolicy( - slack_amount=0.02, - evaluation_interval=10, - ), - ) + early_termination=BanditPolicy(slack_amount=0.02, evaluation_interval=10), + )._to_rest_object() @pytest.fixture -def nlp_fixed_parameters_expected() -> RestNlpFixedParameters: - return RestNlpFixedParameters( +def nlp_fixed_parameters_expected() -> dict: + # ``NlpFixedParameters`` is JSON-direct under arm_ml_service; build the wire dict via the entity. + return NlpFixedParameters( training_batch_size=32, warmup_ratio=0.1, - ) + )._to_rest_object() @pytest.fixture -def nlp_search_space_expected() -> List[RestNlpParameterSubspace]: +def nlp_search_space_expected() -> List[dict]: + # ``NlpParameterSubspace`` is JSON-direct under arm_ml_service; these are the camelCase wire dicts. return [ - RestNlpParameterSubspace( - model_name="choice('bert-base-cased','bert-base-uncased')", - learning_rate="uniform(0.000005,0.00005)", - learning_rate_scheduler="choice('linear','cosine_with_restarts')", - ), - RestNlpParameterSubspace( - model_name="choice('roberta-base','roberta-large')", - learning_rate="uniform(0.000002,0.000008)", - gradient_accumulation_steps="choice(1,2,3)", - ), + { + "gradientAccumulationSteps": None, + "learningRate": "uniform(0.000005,0.00005)", + "learningRateScheduler": "choice('linear','cosine_with_restarts')", + "modelName": "choice('bert-base-cased','bert-base-uncased')", + "numberOfEpochs": None, + "trainingBatchSize": None, + "validationBatchSize": None, + "warmupRatio": None, + "weightDecay": None, + }, + { + "gradientAccumulationSteps": "choice(1,2,3)", + "learningRate": "uniform(0.000002,0.000008)", + "learningRateScheduler": None, + "modelName": "choice('roberta-base','roberta-large')", + "numberOfEpochs": None, + "trainingBatchSize": None, + "validationBatchSize": None, + "warmupRatio": None, + "weightDecay": None, + }, ] @@ -140,28 +149,31 @@ def expected_text_classification_job( mock_workspace_scope: OperationScope, run_type: str, nlp_limits_expected: RestNlpVerticalLimitSettings, - nlp_sweep_settings_expected: RestNlpSweepSettings, - nlp_fixed_parameters_expected: RestNlpFixedParameters, - nlp_search_space_expected: List[RestNlpParameterSubspace], + nlp_sweep_settings_expected: dict, + nlp_fixed_parameters_expected: dict, + nlp_search_space_expected: List[dict], nlp_featurization_settings_expected: RestNlpFeaturizationSettings, expected_nlp_target_column_name: str, expected_nlp_training_data: MLTableJobInput, expected_nlp_validation_data: MLTableJobInput, compute_binding_expected: str, ) -> JobBase: + text_classification = RestTextClassification( + target_column_name=expected_nlp_target_column_name, + training_data=expected_nlp_training_data, + validation_data=expected_nlp_validation_data, + featurization_settings=nlp_featurization_settings_expected, + limit_settings=nlp_limits_expected, + primary_metric=ClassificationPrimaryMetrics.ACCURACY, + log_verbosity=LogVerbosity.DEBUG, + ) + # ``fixedParameters``/``sweepSettings``/``searchSpace`` are JSON-direct wire-keys under arm. + text_classification["fixedParameters"] = nlp_fixed_parameters_expected + if run_type == "sweep": + text_classification["sweepSettings"] = nlp_sweep_settings_expected + text_classification["searchSpace"] = nlp_search_space_expected return _get_rest_automl_job( - RestTextClassification( - target_column_name=expected_nlp_target_column_name, - training_data=expected_nlp_training_data, - validation_data=expected_nlp_validation_data, - featurization_settings=nlp_featurization_settings_expected, - limit_settings=nlp_limits_expected, - sweep_settings=nlp_sweep_settings_expected if run_type == "sweep" else None, - fixed_parameters=nlp_fixed_parameters_expected, - search_space=nlp_search_space_expected if run_type == "sweep" else None, - primary_metric=ClassificationPrimaryMetrics.ACCURACY, - log_verbosity=LogVerbosity.DEBUG, - ), + text_classification, compute_id=compute_binding_expected, name="simpleautomlnlpjob", ) @@ -172,28 +184,31 @@ def expected_text_classification_multilabel_job( mock_workspace_scope: OperationScope, run_type: str, nlp_limits_expected: RestNlpVerticalLimitSettings, - nlp_sweep_settings_expected: RestNlpSweepSettings, - nlp_fixed_parameters_expected: RestNlpFixedParameters, - nlp_search_space_expected: List[RestNlpParameterSubspace], + nlp_sweep_settings_expected: dict, + nlp_fixed_parameters_expected: dict, + nlp_search_space_expected: List[dict], nlp_featurization_settings_expected: RestNlpFeaturizationSettings, expected_nlp_target_column_name: str, expected_nlp_training_data: MLTableJobInput, expected_nlp_validation_data: MLTableJobInput, compute_binding_expected: str, ) -> JobBase: + text_classification_multilabel = RestTextClassificationMultilabel( + target_column_name=expected_nlp_target_column_name, + training_data=expected_nlp_training_data, + validation_data=expected_nlp_validation_data, + featurization_settings=nlp_featurization_settings_expected, + limit_settings=nlp_limits_expected, + primary_metric=ClassificationPrimaryMetrics.ACCURACY, + log_verbosity=LogVerbosity.DEBUG, + ) + # ``fixedParameters``/``sweepSettings``/``searchSpace`` are JSON-direct wire-keys under arm. + text_classification_multilabel["fixedParameters"] = nlp_fixed_parameters_expected + if run_type == "sweep": + text_classification_multilabel["sweepSettings"] = nlp_sweep_settings_expected + text_classification_multilabel["searchSpace"] = nlp_search_space_expected return _get_rest_automl_job( - RestTextClassificationMultilabel( - target_column_name=expected_nlp_target_column_name, - training_data=expected_nlp_training_data, - validation_data=expected_nlp_validation_data, - featurization_settings=nlp_featurization_settings_expected, - limit_settings=nlp_limits_expected, - sweep_settings=nlp_sweep_settings_expected if run_type == "sweep" else None, - fixed_parameters=nlp_fixed_parameters_expected, - search_space=nlp_search_space_expected if run_type == "sweep" else None, - primary_metric=ClassificationPrimaryMetrics.ACCURACY, - log_verbosity=LogVerbosity.DEBUG, - ), + text_classification_multilabel, compute_id=compute_binding_expected, name="simpleautomlnlpjob", ) @@ -204,26 +219,29 @@ def expected_text_ner_job( mock_workspace_scope: OperationScope, run_type: str, nlp_limits_expected: RestNlpVerticalLimitSettings, - nlp_sweep_settings_expected: RestNlpSweepSettings, - nlp_fixed_parameters_expected: RestNlpFixedParameters, - nlp_search_space_expected: List[RestNlpParameterSubspace], + nlp_sweep_settings_expected: dict, + nlp_fixed_parameters_expected: dict, + nlp_search_space_expected: List[dict], nlp_featurization_settings_expected: RestNlpFeaturizationSettings, expected_nlp_training_data: MLTableJobInput, expected_nlp_validation_data: MLTableJobInput, compute_binding_expected: str, ) -> JobBase: + text_ner = RestTextNer( + training_data=expected_nlp_training_data, + validation_data=expected_nlp_validation_data, + featurization_settings=nlp_featurization_settings_expected, + limit_settings=nlp_limits_expected, + primary_metric=ClassificationPrimaryMetrics.ACCURACY, + log_verbosity=LogVerbosity.DEBUG, + ) + # ``fixedParameters``/``sweepSettings``/``searchSpace`` are JSON-direct wire-keys under arm. + text_ner["fixedParameters"] = nlp_fixed_parameters_expected + if run_type == "sweep": + text_ner["sweepSettings"] = nlp_sweep_settings_expected + text_ner["searchSpace"] = nlp_search_space_expected return _get_rest_automl_job( - RestTextNer( - training_data=expected_nlp_training_data, - validation_data=expected_nlp_validation_data, - featurization_settings=nlp_featurization_settings_expected, - limit_settings=nlp_limits_expected, - sweep_settings=nlp_sweep_settings_expected if run_type == "sweep" else None, - fixed_parameters=nlp_fixed_parameters_expected, - search_space=nlp_search_space_expected if run_type == "sweep" else None, - primary_metric=ClassificationPrimaryMetrics.ACCURACY, - log_verbosity=LogVerbosity.DEBUG, - ), + text_ner, compute_id=compute_binding_expected, name="simpleautomlnlpjob", ) @@ -237,6 +255,7 @@ def _get_rest_automl_job(automl_task, name, compute_id): properties={}, outputs={}, tags={}, + is_archived=False, ) result = JobBase(properties=properties) result.name = name diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py index 58f07e5ad69c..ea54f109fc8b 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_nlp_sweep_settings.py @@ -10,7 +10,9 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( TruncationSelectionPolicy as RestTruncationSelectionPolicy, ) +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy from azure.ai.ml.automl import NlpSweepSettings +from azure.ai.ml.entities._job._input_output_helpers import to_hybrid_rest_model from azure.ai.ml.sweep import BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy @@ -91,19 +93,25 @@ def _get_rest_obj( sampling_algorithm_name: SamplingAlgorithmType = SamplingAlgorithmType.GRID, ) -> dict: # ``NlpSweepSettings`` is absent from arm_ml_service -> JSON-direct dict wire body. The - # early-termination child is built via the entity policy's ``_to_rest_object`` so the - # expected wire matches production exactly (including default fields like delayEvaluation). + # early-termination child is built via the entity policy's ``_to_rest_object`` then converted + # to the arm hybrid model (as production does) so the expected wire matches exactly. early_termination_policy = None if early_termination_name == EarlyTerminationPolicyType.BANDIT: - early_termination_policy = BanditPolicy(evaluation_interval=10, slack_factor=0.2)._to_rest_object() + early_termination_policy = to_hybrid_rest_model( + BanditPolicy(evaluation_interval=10, slack_factor=0.2)._to_rest_object(), RestEarlyTerminationPolicy + ) elif early_termination_name == EarlyTerminationPolicyType.MEDIAN_STOPPING: - early_termination_policy = MedianStoppingPolicy( - delay_evaluation=5, evaluation_interval=1 - )._to_rest_object() + early_termination_policy = to_hybrid_rest_model( + MedianStoppingPolicy(delay_evaluation=5, evaluation_interval=1)._to_rest_object(), + RestEarlyTerminationPolicy, + ) elif early_termination_name == EarlyTerminationPolicyType.TRUNCATION_SELECTION: - early_termination_policy = TruncationSelectionPolicy( - evaluation_interval=1, truncation_percentage=20, delay_evaluation=5 - )._to_rest_object() + early_termination_policy = to_hybrid_rest_model( + TruncationSelectionPolicy( + evaluation_interval=1, truncation_percentage=20, delay_evaluation=5 + )._to_rest_object(), + RestEarlyTerminationPolicy, + ) rest_obj: dict = {"samplingAlgorithm": sampling_algorithm_name} if early_termination_policy is not None: rest_obj["earlyTermination"] = early_termination_policy diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_tabular_schema.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_tabular_schema.py index db7062fcec1a..482a5c48741c 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_tabular_schema.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_automl_tabular_schema.py @@ -9,33 +9,33 @@ from marshmallow.exceptions import ValidationError from azure.ai.ml import load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import Classification as RestClassification -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ClassificationPrimaryMetrics -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import Classification as RestClassification +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import ( ClassificationTrainingSettings as RestClassificationTrainingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ColumnTransformer as RestColumnTransformer -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import Forecasting as RestForecasting -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ForecastingPrimaryMetrics -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ColumnTransformer as RestColumnTransformer +from azure.ai.ml._restclient.arm_ml_service.models import Forecasting as RestForecasting +from azure.ai.ml._restclient.arm_ml_service.models import ForecastingPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import ( ForecastingSettings as RestForecastingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ForecastingTrainingSettings as RestForecastingTrainingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import Regression as RestRegression -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import RegressionPrimaryMetrics -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import Regression as RestRegression +from azure.ai.ml._restclient.arm_ml_service.models import RegressionPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import ( RegressionTrainingSettings as RestRegressionTrainingSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( TableVerticalFeaturizationSettings as RestTableFeaturizationSettings, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( TableVerticalLimitSettings as RestTableVerticalLimitSettings, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models._models_py3 import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AutoNCrossValidations, CustomNCrossValidations, JobBase, @@ -66,14 +66,20 @@ def set_env_var() -> None: @pytest.fixture def limits_expected() -> RestTableVerticalLimitSettings: - return RestTableVerticalLimitSettings( + limits = RestTableVerticalLimitSettings( max_trials=40, timeout=to_iso_duration_format_mins(180), max_concurrent_trials=5, enable_early_termination=True, exit_score=0.85, - max_nodes=None, + max_cores_per_trial=-1, + trial_timeout=to_iso_duration_format_mins(30), ) + # ``sweepConcurrentTrials``/``sweepTrials`` are preserved via wire-key (default 0) to match the + # legacy msrest wire. + limits["sweepConcurrentTrials"] = 0 + limits["sweepTrials"] = 0 + return limits @pytest.fixture @@ -82,6 +88,9 @@ def classification_training_settings_expected() -> RestClassificationTrainingSet enable_dnn_training=True, enable_model_explainability=True, ensemble_model_download_timeout="PT2M", + enable_onnx_compatible_models=False, + enable_stack_ensemble=True, + enable_vote_ensemble=True, ) @@ -91,6 +100,9 @@ def forecasting_training_settings_expected() -> RestForecastingTrainingSettings: enable_dnn_training=True, enable_model_explainability=True, ensemble_model_download_timeout="PT2M", + enable_onnx_compatible_models=False, + enable_stack_ensemble=True, + enable_vote_ensemble=True, ) @@ -100,6 +112,9 @@ def regression_training_settings_expected() -> RestRegressionTrainingSettings: enable_dnn_training=True, enable_model_explainability=True, ensemble_model_download_timeout="PT2M", + enable_onnx_compatible_models=False, + enable_stack_ensemble=True, + enable_vote_ensemble=True, ) @@ -170,7 +185,7 @@ def expected_validation_data_size() -> int: @pytest.fixture def expected_forecasting_settings(mock_workspace_scope: OperationScope) -> RestForecastingSettings: - from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + from azure.ai.ml._restclient.arm_ml_service.models import ( CustomForecastHorizon, CustomTargetLags, CustomTargetRollingWindowSize, @@ -179,7 +194,7 @@ def expected_forecasting_settings(mock_workspace_scope: OperationScope) -> RestF return RestForecastingSettings( country_or_region_for_holidays="US", forecast_horizon=CustomForecastHorizon(value=10), - target_lags=CustomTargetLags(values=[20]), + target_lags=CustomTargetLags(values_property=[20]), target_rolling_window_size=CustomTargetRollingWindowSize(value=3), time_column_name="abc", time_series_id_column_names=["xyz"], @@ -302,6 +317,7 @@ def _get_rest_automl_job(automl_task, name, compute_id): properties={}, outputs={}, tags={}, + is_archived=False, ) result = JobBase(properties=properties) result.name = name diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py index fe0a05780dcc..b9b600074e50 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_classification_job.py @@ -58,7 +58,7 @@ def test_classification_task(self): assert original_obj.name == "classifier_job", "Name not set correctly" assert original_obj.experiment_name == "foo_exp", "Experiment name not set correctly" assert original_obj.tags == {"foo_tag": "bar"}, "Tags not set correctly" - assert original_obj.properties == {"_automl_internal_some_flag": True}, "Properties not set correctly" + assert original_obj.properties == {"_automl_internal_some_flag": "True"}, "Properties not set correctly" assert original_obj.identity == identity # check if the original job inputs were restored assert original_obj.primary_metric == ClassificationPrimaryMetrics.ACCURACY, "Primary metric is not ACCURACY" diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_featurization_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_featurization_settings.py index 74cc47011335..476551a685fd 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_featurization_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_featurization_settings.py @@ -1,7 +1,7 @@ import pytest -from azure.ai.ml._restclient.v2023_04_01_preview.models import ColumnTransformer as RestColumnTransformer -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ColumnTransformer as RestColumnTransformer +from azure.ai.ml._restclient.arm_ml_service.models import ( TableVerticalFeaturizationSettings as RestTabularFeaturizationSettings, ) from azure.ai.ml.entities._job.automl.tabular import ColumnTransformer, TabularFeaturizationSettings diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py index f8a5c8a9b248..048d63566ec4 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_limit_settings.py @@ -72,6 +72,12 @@ def _get_rest_obj(self, scenario): ) # ``maxNodes`` is preserved via wire-key (dropped from the arm_ml_service model). max_nodes_rest["maxNodes"] = 4 + # ``sweepConcurrentTrials``/``sweepTrials`` are preserved via wire-key (default 0) to match + # the legacy msrest wire. + default_rest["sweepConcurrentTrials"] = 0 + default_rest["sweepTrials"] = 0 + max_nodes_rest["sweepConcurrentTrials"] = 0 + max_nodes_rest["sweepTrials"] = 0 rest_objs = { "default": default_rest, "max_nodes": max_nodes_rest, diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_n_cross_validation_settings.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_n_cross_validation_settings.py index 599eea081e65..c460e09414a1 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_n_cross_validation_settings.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_tabular_n_cross_validation_settings.py @@ -2,7 +2,7 @@ import pytest -from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoNCrossValidations, CustomNCrossValidations, JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml.automl import classification, forecasting, regression from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input @@ -57,11 +57,10 @@ def test_auto_n_cv_to_rest(self): ] for obj in rest_objs: - assert isinstance( - obj.properties.task_details.n_cross_validations, AutoNCrossValidations - ), "N cross validations not an object of AutoNCrossValidations in {} job".format( - obj.properties.task_details.task_type - ) + # arm_ml_service serializes the discriminated ``AutoNCrossValidations`` child to a dict. + assert ( + obj.properties.task_details.n_cross_validations["mode"] == "Auto" + ), "N cross validations not an Auto mode in {} job".format(obj.properties.task_details.task_type) def test_auto_n_cv_from_rest(self): # Test with auto n cross validations (from_rest_object) @@ -85,11 +84,10 @@ def test_value_n_cv_to_rest(self): ] for obj in rest_objs: - assert isinstance( - obj.properties.task_details.n_cross_validations, CustomNCrossValidations - ), "N cross validations not an object of CustomNCrossValidations in {} job".format( - obj.properties.task_details.task_type - ) + # arm_ml_service serializes the discriminated ``CustomNCrossValidations`` child to a dict. + assert ( + obj.properties.task_details.n_cross_validations["mode"] == "Custom" + ), "N cross validations not a Custom mode in {} job".format(obj.properties.task_details.task_type) def test_value_n_cv_from_rest(self): # Test with auto n cross validations (from_rest_object) @@ -135,8 +133,9 @@ def test_monte_carlo_cv(self): ] for obj in rest_objs: - assert isinstance( - obj.properties.task_details.n_cross_validations, CustomNCrossValidations + # arm_ml_service serializes the discriminated ``CustomNCrossValidations`` child to a dict. + assert ( + obj.properties.task_details.n_cross_validations["mode"] == "Custom" ), "N cross validations not an object of CustomNCrossValidations in {} job".format( obj.properties.task_details.task_type ) diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py index 9553572c39e2..fd591cec96e9 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_job.py @@ -1,27 +1,24 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2024_01_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2024_01_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ( JobBase, LogVerbosity, - NlpFixedParameters, - NlpParameterSubspace, - NlpSweepSettings, NlpVerticalFeaturizationSettings, NlpVerticalLimitSettings, SamplingAlgorithmType, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models._azure_machine_learning_workspaces_enums import ( - ClassificationPrimaryMetrics, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLTableJobInput, TextClassification +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import MLTableJobInput, TextClassification from azure.ai.ml._utils.utils import to_iso_duration_format_mins from azure.ai.ml.automl import text_classification from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.automl import SearchSpace +from azure.ai.ml.entities._job.automl.nlp.nlp_fixed_parameters import NlpFixedParameters as EntityNlpFixedParameters +from azure.ai.ml.entities._job.automl.nlp.nlp_search_space import NlpSearchSpace as EntityNlpSearchSpace +from azure.ai.ml.entities._job.automl.nlp.nlp_sweep_settings import NlpSweepSettings as EntityNlpSweepSettings from azure.ai.ml.entities._job.automl.nlp.text_classification_job import TextClassificationJob from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform @@ -197,29 +194,34 @@ def test_automl_nlp_text_classification_to_rest_object(self, run_type): early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), ) job.extend_search_space([SearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))]) - rest_sweep = NlpSweepSettings( + rest_sweep = EntityNlpSweepSettings( sampling_algorithm=SamplingAlgorithmType.GRID, - early_termination=RestBanditPolicy(slack_factor=0.2, evaluation_interval=2), - ) - rest_search_space = [NlpParameterSubspace(model_name="choice('bert-base-cased','distilbert-base-cased')")] + early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), + )._to_rest_object() + rest_search_space = [ + EntityNlpSearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))._to_rest_object() + ] + expected_limits = NlpVerticalLimitSettings( + max_concurrent_trials=max_concurrent_trials, + max_trials=max_trials, + timeout=to_iso_duration_format_mins(timeout), + ) + expected_limits["maxNodes"] = max_nodes expected = TextClassification( primary_metric=primary_metric, log_verbosity=log_verbosity, target_column_name=label_column, training_data=MLTableJobInput(uri=training_data_uri), validation_data=MLTableJobInput(uri=validation_data_uri), - limit_settings=NlpVerticalLimitSettings( - max_concurrent_trials=max_concurrent_trials, - max_trials=max_trials, - max_nodes=max_nodes, - timeout=to_iso_duration_format_mins(timeout), - ), - fixed_parameters=NlpFixedParameters(weight_decay=0.01), - sweep_settings=rest_sweep, - search_space=rest_search_space, + limit_settings=expected_limits, featurization_settings=NlpVerticalFeaturizationSettings(dataset_language=dataset_language), ) + expected["fixedParameters"] = EntityNlpFixedParameters(weight_decay=0.01)._to_rest_object() + if rest_sweep is not None: + expected["sweepSettings"] = rest_sweep + if rest_search_space is not None: + expected["searchSpace"] = rest_search_space # Test converting Job to REST object converted_to_rest_obj = job._to_rest_object() @@ -232,9 +234,9 @@ def test_automl_nlp_text_classification_to_rest_object(self, run_type): assert expected.training_data == result.training_data assert expected.validation_data == result.validation_data assert expected.limit_settings == result.limit_settings - assert expected.sweep_settings == result.sweep_settings - assert expected.fixed_parameters == result.fixed_parameters - assert expected.search_space == result.search_space + assert expected.get("sweepSettings") == result.get("sweepSettings") + assert expected.get("fixedParameters") == result.get("fixedParameters") + assert expected.get("searchSpace") == result.get("searchSpace") assert expected.featurization_settings == result.featurization_settings assert expected.log_verbosity == result.log_verbosity @@ -290,29 +292,34 @@ def test_automl_nlp_text_classification_from_rest_object(self, run_type): expected_job.extend_search_space( [SearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))] ) - rest_sweep = NlpSweepSettings( + rest_sweep = EntityNlpSweepSettings( sampling_algorithm=SamplingAlgorithmType.GRID, - early_termination=RestBanditPolicy(slack_factor=0.2, evaluation_interval=2), - ) - rest_search_space = [NlpParameterSubspace(model_name="choice(bert-base-cased, distilbert-base-cased)")] + early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), + )._to_rest_object() + rest_search_space = [ + EntityNlpSearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))._to_rest_object() + ] + task_limits = NlpVerticalLimitSettings( + max_concurrent_trials=max_concurrent_trials, + max_trials=max_trials, + timeout=to_iso_duration_format_mins(timeout), + ) + task_limits["maxNodes"] = max_nodes task_details = TextClassification( primary_metric=primary_metric, log_verbosity=log_verbosity, target_column_name=label_column, training_data=MLTableJobInput(uri=training_data_uri), validation_data=MLTableJobInput(uri=validation_data_uri), - limit_settings=NlpVerticalLimitSettings( - max_concurrent_trials=max_concurrent_trials, - max_trials=max_trials, - max_nodes=max_nodes, - timeout=to_iso_duration_format_mins(timeout), - ), + limit_settings=task_limits, featurization_settings=NlpVerticalFeaturizationSettings(dataset_language=dataset_language), - fixed_parameters=NlpFixedParameters(weight_decay=0.01), - sweep_settings=rest_sweep, - search_space=rest_search_space, ) + task_details["fixedParameters"] = EntityNlpFixedParameters(weight_decay=0.01)._to_rest_object() + if rest_sweep is not None: + task_details["sweepSettings"] = rest_sweep + if rest_search_space is not None: + task_details["searchSpace"] = rest_search_space job_data = JobBase(properties=RestAutoMLJob(task_details=task_details, identity=identity._to_job_rest_object())) # Test converting REST object to Job converted_to_job = TextClassificationJob._from_rest_object(job_data) diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_multilabel_job.py index 683f4d278754..c8045eb6aa69 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_classification_multilabel_job.py @@ -1,28 +1,25 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ( JobBase, LogVerbosity, - NlpFixedParameters, - NlpParameterSubspace, - NlpSweepSettings, NlpVerticalFeaturizationSettings, NlpVerticalLimitSettings, SamplingAlgorithmType, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( - ClassificationPrimaryMetrics, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLTableJobInput, TextClassificationMultilabel +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import MLTableJobInput, TextClassificationMultilabel from azure.ai.ml._utils.utils import to_iso_duration_format_mins from azure.ai.ml.automl import text_classification_multilabel from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.automl import SearchSpace +from azure.ai.ml.entities._job.automl.nlp.nlp_fixed_parameters import NlpFixedParameters as EntityNlpFixedParameters +from azure.ai.ml.entities._job.automl.nlp.nlp_search_space import NlpSearchSpace as EntityNlpSearchSpace +from azure.ai.ml.entities._job.automl.nlp.nlp_sweep_settings import NlpSweepSettings as EntityNlpSweepSettings from azure.ai.ml.entities._job.automl.nlp.text_classification_multilabel_job import TextClassificationMultilabelJob from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform @@ -196,29 +193,34 @@ def test_automl_nlp_text_classification_multilabel_to_rest_object(self, run_type early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), ) job.extend_search_space([SearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))]) - rest_sweep = NlpSweepSettings( + rest_sweep = EntityNlpSweepSettings( sampling_algorithm=SamplingAlgorithmType.GRID, - early_termination=RestBanditPolicy(slack_factor=0.2, evaluation_interval=2), - ) - rest_search_space = [NlpParameterSubspace(model_name="choice('bert-base-cased','distilbert-base-cased')")] + early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), + )._to_rest_object() + rest_search_space = [ + EntityNlpSearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))._to_rest_object() + ] + expected_limits = NlpVerticalLimitSettings( + max_concurrent_trials=max_concurrent_trials, + max_trials=max_trials, + timeout=to_iso_duration_format_mins(timeout), + ) + expected_limits["maxNodes"] = max_nodes expected = TextClassificationMultilabel( primary_metric=primary_metric, log_verbosity=log_verbosity, target_column_name=label_column, training_data=MLTableJobInput(uri=training_data_uri), validation_data=MLTableJobInput(uri=validation_data_uri), - limit_settings=NlpVerticalLimitSettings( - max_concurrent_trials=max_concurrent_trials, - max_trials=max_trials, - max_nodes=max_nodes, - timeout=to_iso_duration_format_mins(timeout), - ), - fixed_parameters=NlpFixedParameters(weight_decay=0.01), - sweep_settings=rest_sweep, - search_space=rest_search_space, + limit_settings=expected_limits, featurization_settings=NlpVerticalFeaturizationSettings(dataset_language=dataset_language), ) + expected["fixedParameters"] = EntityNlpFixedParameters(weight_decay=0.01)._to_rest_object() + if rest_sweep is not None: + expected["sweepSettings"] = rest_sweep + if rest_search_space is not None: + expected["searchSpace"] = rest_search_space # Test converting Job to REST object converted_to_rest_obj = job._to_rest_object() @@ -232,9 +234,9 @@ def test_automl_nlp_text_classification_multilabel_to_rest_object(self, run_type assert expected.training_data == result.training_data assert expected.validation_data == result.validation_data assert expected.limit_settings == result.limit_settings - assert expected.sweep_settings == result.sweep_settings - assert expected.fixed_parameters == result.fixed_parameters - assert expected.search_space == result.search_space + assert expected.get("sweepSettings") == result.get("sweepSettings") + assert expected.get("fixedParameters") == result.get("fixedParameters") + assert expected.get("searchSpace") == result.get("searchSpace") assert expected.featurization_settings == result.featurization_settings assert expected.log_verbosity == result.log_verbosity @@ -288,28 +290,33 @@ def test_automl_nlp_text_classification_multilabel_from_rest_object(self, run_ty expected_job.extend_search_space( [SearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))] ) - rest_sweep = NlpSweepSettings( + rest_sweep = EntityNlpSweepSettings( sampling_algorithm=SamplingAlgorithmType.GRID, - early_termination=RestBanditPolicy(slack_factor=0.2, evaluation_interval=2), - ) - rest_search_space = [NlpParameterSubspace(model_name="choice(bert-base-cased, distilbert-base-cased)")] + early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), + )._to_rest_object() + rest_search_space = [ + EntityNlpSearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))._to_rest_object() + ] + task_limits = NlpVerticalLimitSettings( + max_concurrent_trials=max_concurrent_trials, + max_trials=max_trials, + timeout=to_iso_duration_format_mins(timeout), + ) + task_limits["maxNodes"] = max_nodes task_details = TextClassificationMultilabel( log_verbosity=log_verbosity, target_column_name=label_column, training_data=MLTableJobInput(uri=training_data_uri), validation_data=MLTableJobInput(uri=validation_data_uri), - limit_settings=NlpVerticalLimitSettings( - max_concurrent_trials=max_concurrent_trials, - max_trials=max_trials, - max_nodes=max_nodes, - timeout=to_iso_duration_format_mins(timeout), - ), + limit_settings=task_limits, featurization_settings=NlpVerticalFeaturizationSettings(dataset_language=dataset_language), - fixed_parameters=NlpFixedParameters(weight_decay=0.01), - sweep_settings=rest_sweep, - search_space=rest_search_space, ) + task_details["fixedParameters"] = EntityNlpFixedParameters(weight_decay=0.01)._to_rest_object() + if rest_sweep is not None: + task_details["sweepSettings"] = rest_sweep + if rest_search_space is not None: + task_details["searchSpace"] = rest_search_space job_data = JobBase(properties=RestAutoMLJob(task_details=task_details, identity=identity._to_job_rest_object())) # Test converting REST object to Job converted_to_job = TextClassificationMultilabelJob._from_rest_object(job_data) diff --git a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_ner_job.py b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_ner_job.py index ae626a93fdd6..f51290fcac6a 100644 --- a/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_ner_job.py +++ b/sdk/ml/azure-ai-ml/tests/automl_job/unittests/test_text_ner_job.py @@ -1,29 +1,26 @@ import pytest from azure.ai.ml import UserIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import AutoMLJob as RestAutoMLJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AutoMLJob as RestAutoMLJob +from azure.ai.ml._restclient.arm_ml_service.models import ( JobBase, LogVerbosity, - NlpFixedParameters, - NlpParameterSubspace, - NlpSweepSettings, NlpVerticalFeaturizationSettings, NlpVerticalLimitSettings, SamplingAlgorithmType, TaskType, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( - ClassificationPrimaryMetrics, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLTableJobInput, TextNer +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ClassificationPrimaryMetrics +from azure.ai.ml._restclient.arm_ml_service.models import MLTableJobInput, TextNer from azure.ai.ml._utils.utils import to_iso_duration_format_mins from azure.ai.ml.automl import text_ner from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.automl import SearchSpace +from azure.ai.ml.entities._job.automl.nlp.nlp_fixed_parameters import NlpFixedParameters as EntityNlpFixedParameters +from azure.ai.ml.entities._job.automl.nlp.nlp_search_space import NlpSearchSpace as EntityNlpSearchSpace +from azure.ai.ml.entities._job.automl.nlp.nlp_sweep_settings import NlpSweepSettings as EntityNlpSweepSettings from azure.ai.ml.entities._job.automl.nlp.text_ner_job import TextNerJob from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform @@ -186,28 +183,36 @@ def test_automl_nlp_text_ner_to_rest_object(self, run_type): early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), ) job.extend_search_space([SearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))]) - rest_sweep = NlpSweepSettings( + rest_sweep = EntityNlpSweepSettings( sampling_algorithm=SamplingAlgorithmType.GRID, - early_termination=RestBanditPolicy(slack_factor=0.2, evaluation_interval=2), - ) - rest_search_space = [NlpParameterSubspace(model_name="choice('bert-base-cased','distilbert-base-cased')")] + early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), + )._to_rest_object() + rest_search_space = [ + EntityNlpSearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))._to_rest_object() + ] + expected_limits = NlpVerticalLimitSettings( + max_concurrent_trials=max_concurrent_trials, + max_trials=max_trials, + timeout=to_iso_duration_format_mins(timeout), + ) + # ``maxNodes`` was dropped from the arm_ml_service model; it is carried as a wire-key. + expected_limits["maxNodes"] = max_nodes expected = TextNer( primary_metric=primary_metric, log_verbosity=log_verbosity, training_data=MLTableJobInput(uri=training_data_uri), validation_data=MLTableJobInput(uri=validation_data_uri), - limit_settings=NlpVerticalLimitSettings( - max_concurrent_trials=max_concurrent_trials, - max_trials=max_trials, - max_nodes=max_nodes, - timeout=to_iso_duration_format_mins(timeout), - ), - fixed_parameters=NlpFixedParameters(weight_decay=0.01), - sweep_settings=rest_sweep, - search_space=rest_search_space, + limit_settings=expected_limits, featurization_settings=NlpVerticalFeaturizationSettings(dataset_language=dataset_language), ) + # ``fixedParameters``/``sweepSettings``/``searchSpace`` were dropped from the arm model and + # are carried as wire-keys built from the entity-level JSON-direct models. + expected["fixedParameters"] = EntityNlpFixedParameters(weight_decay=0.01)._to_rest_object() + if rest_sweep is not None: + expected["sweepSettings"] = rest_sweep + if rest_search_space is not None: + expected["searchSpace"] = rest_search_space # Test converting Job to REST object converted_to_rest_obj = job._to_rest_object() @@ -221,9 +226,9 @@ def test_automl_nlp_text_ner_to_rest_object(self, run_type): assert expected.training_data == result.training_data assert expected.validation_data == result.validation_data assert expected.limit_settings == result.limit_settings - assert expected.sweep_settings == result.sweep_settings - assert expected.fixed_parameters == result.fixed_parameters - assert expected.search_space == result.search_space + assert expected.get("sweepSettings") == result.get("sweepSettings") + assert expected.get("fixedParameters") == result.get("fixedParameters") + assert expected.get("searchSpace") == result.get("searchSpace") assert expected.featurization_settings == result.featurization_settings assert expected.log_verbosity == result.log_verbosity @@ -275,27 +280,32 @@ def test_automl_nlp_text_ner_from_rest_object(self, run_type): expected_job.extend_search_space( [SearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))] ) - rest_sweep = NlpSweepSettings( + rest_sweep = EntityNlpSweepSettings( sampling_algorithm=SamplingAlgorithmType.GRID, - early_termination=RestBanditPolicy(slack_factor=0.2, evaluation_interval=2), - ) - rest_search_space = [NlpParameterSubspace(model_name="choice(bert-base-cased, distilbert-base-cased)")] + early_termination=BanditPolicy(slack_factor=0.2, evaluation_interval=2), + )._to_rest_object() + rest_search_space = [ + EntityNlpSearchSpace(model_name=Choice(["bert-base-cased", "distilbert-base-cased"]))._to_rest_object() + ] + task_limits = NlpVerticalLimitSettings( + max_concurrent_trials=max_concurrent_trials, + max_trials=max_trials, + timeout=to_iso_duration_format_mins(timeout), + ) + task_limits["maxNodes"] = max_nodes task_details = TextNer( log_verbosity=log_verbosity, training_data=MLTableJobInput(uri=training_data_uri), validation_data=MLTableJobInput(uri=validation_data_uri), - limit_settings=NlpVerticalLimitSettings( - max_concurrent_trials=max_concurrent_trials, - max_trials=max_trials, - max_nodes=max_nodes, - timeout=to_iso_duration_format_mins(timeout), - ), + limit_settings=task_limits, featurization_settings=NlpVerticalFeaturizationSettings(dataset_language=dataset_language), - fixed_parameters=NlpFixedParameters(weight_decay=0.01), - sweep_settings=rest_sweep, - search_space=rest_search_space, ) + task_details["fixedParameters"] = EntityNlpFixedParameters(weight_decay=0.01)._to_rest_object() + if rest_sweep is not None: + task_details["sweepSettings"] = rest_sweep + if rest_search_space is not None: + task_details["searchSpace"] = rest_search_space job_data = JobBase(properties=RestAutoMLJob(task_details=task_details, identity=identity._to_job_rest_object())) # Test converting REST object to Job converted_to_job = TextNerJob._from_rest_object(job_data) From c9bbf4468cdfd27d67f8cf9eb283946dbe198a7f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 11:18:17 +0530 Subject: [PATCH 007/146] fix(spark,assets): boundary-wrap spark children + preserve isArchived/isAnonymous/conf-str wire --- .../ml/entities/_assets/_artifacts/model.py | 6 ++- .../ai/ml/entities/_assets/environment.py | 6 ++- .../azure/ai/ml/entities/_job/spark_job.py | 27 ++++++++++-- .../unittests/test_spark_job_entity.py | 42 +++++++++---------- .../spark_job/spark_job_rest.json | 12 +++--- 5 files changed, 58 insertions(+), 35 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index ba0b2aa7f9ed..660b62281683 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -250,7 +250,8 @@ def _to_rest_object(self) -> Union[ModelVersionData, ModelVersion]: model_type=self.type, model_uri=self.path, stage=self.stage, - is_anonymous=self._is_anonymous, + is_anonymous=self._is_anonymous or False, + is_archived=False, ) model_version.system_metadata = self._system_metadata if hasattr(self, "_system_metadata") else None @@ -277,7 +278,8 @@ def _to_rest_object(self) -> Union[ModelVersionData, ModelVersion]: model_type=self.type, model_uri=self.path, stage=self.stage, - is_anonymous=self._is_anonymous, + is_anonymous=self._is_anonymous or False, + is_archived=False, ) model_version.system_metadata = self._system_metadata if hasattr(self, "_system_metadata") else None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index 4c8b24c6594a..a333a868ff3e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -225,8 +225,10 @@ def _to_rest_object(self) -> EnvironmentVersion: environment_version.os_type = self.os_type if self.tags: environment_version.tags = self.tags - if self._is_anonymous: - environment_version.is_anonymous = self._is_anonymous + # The legacy msrest model serialized ``isAnonymous``/``isArchived`` (default False) on the + # wire; the arm_ml_service model omits None, so set them explicitly to preserve the wire. + environment_version.is_anonymous = self._is_anonymous or False + environment_version.is_archived = False if self.inference_config: environment_version.inference_config = self.inference_config if self.description: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py index a84f60497361..d8a30db2c271 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py @@ -10,7 +10,10 @@ from marshmallow import INCLUDE +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfiguration as RestIdentityConfiguration from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput from azure.ai.ml._restclient.arm_ml_service.models import SparkJob as RestSparkJob from azure.ai.ml._schema.job.identity import AMLTokenIdentitySchema, ManagedIdentitySchema, UserIdentitySchema from azure.ai.ml._schema.job.parameterized_spark import CONF_KEY_MAP @@ -28,6 +31,7 @@ from azure.ai.ml.entities._job._input_output_helpers import ( from_rest_data_outputs, from_rest_inputs_to_dataset_literal, + to_hybrid_rest_model, to_rest_data_outputs, to_rest_dataset_literal_inputs, validate_inputs_for_args, @@ -227,25 +231,40 @@ def _to_rest_object(self) -> JobBase: if self.executor_instances is not None: conf["spark.executor.instances"] = self.executor_instances + # The legacy msrest SparkJob model typed ``conf`` as ``Dict[str, str]`` and coerced every + # value to a string on the wire; the arm_ml_service model does not coerce, so stringify here + # to keep the wire body identical. + conf = {key: str(value) for key, value in conf.items() if value is not None} + properties = RestSparkJob( experiment_name=self.experiment_name, display_name=self.display_name, description=self.description, tags=self.tags, code_id=self.code, + # The shared arm_ml_service SparkJob model defaults ``is_archived`` to None (omitted on + # the wire); the legacy msrest model serialized ``isArchived=false`` on create. + is_archived=False, entry=self.entry._to_rest_object() if self.entry is not None and not isinstance(self.entry, dict) else None, py_files=self.py_files, jars=self.jars, files=self.files, archives=self.archives, - identity=( - self.identity._to_job_rest_object() if self.identity and not isinstance(self.identity, dict) else None + identity=to_hybrid_rest_model( + ( + self.identity._to_job_rest_object() + if self.identity and not isinstance(self.identity, dict) + else None + ), + RestIdentityConfiguration, ), conf=conf, properties=self.properties_sparkJob, environment_id=self.environment, - inputs=to_rest_dataset_literal_inputs(self.inputs, job_type=self.type), - outputs=to_rest_data_outputs(self.outputs), + # The shared rest helpers emit msrest models; convert each nested child to its + # arm_ml_service hybrid equivalent so the hybrid SdkJSONEncoder can serialize the body. + inputs=to_hybrid_rest_model(to_rest_dataset_literal_inputs(self.inputs, job_type=self.type), RestJobInput), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), args=self.args, compute_id=self.compute, resources=( diff --git a/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py b/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py index dd2c79706f66..781897ba691d 100644 --- a/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py @@ -43,14 +43,14 @@ def test_promoted_conf_serialization(self) -> None: ) expected_conf = { - "spark.driver.cores": 1, + "spark.driver.cores": "1", "spark.driver.memory": "2g", - "spark.executor.cores": 2, + "spark.executor.cores": "2", "spark.executor.memory": "2g", - "spark.executor.instances": 2, - "spark.dynamicAllocation.enabled": True, - "spark.dynamicAllocation.minExecutors": 1, - "spark.dynamicAllocation.maxExecutors": 3, + "spark.executor.instances": "2", + "spark.dynamicAllocation.enabled": "True", + "spark.dynamicAllocation.minExecutors": "1", + "spark.dynamicAllocation.maxExecutors": "3", } assert node._to_job()._to_rest_object().properties.conf == expected_conf @@ -138,14 +138,14 @@ def test_promoted_conf_with_additional_conf_serialization(self) -> None: ) expected_conf = { - "spark.driver.cores": 1, + "spark.driver.cores": "1", "spark.driver.memory": "2g", - "spark.executor.cores": 2, + "spark.executor.cores": "2", "spark.executor.memory": "2g", - "spark.executor.instances": 2, - "spark.dynamicAllocation.enabled": True, - "spark.dynamicAllocation.minExecutors": 1, - "spark.dynamicAllocation.maxExecutors": 3, + "spark.executor.instances": "2", + "spark.dynamicAllocation.enabled": "True", + "spark.dynamicAllocation.minExecutors": "1", + "spark.dynamicAllocation.maxExecutors": "3", "spark.jars.excludes": "slf4j:slf4j", "spark.jars.packages": "com.microsoft.ml.spark:mmlspark_2.11:0.15", "spark.jars.repositories": "https://mmlspark.azureedge.net/maven", @@ -301,14 +301,14 @@ def test_spark_job_with_dynamic_allocation_enabled(self): ) expected_conf = { - "spark.driver.cores": 1, + "spark.driver.cores": "1", "spark.driver.memory": "2g", - "spark.executor.cores": 2, + "spark.executor.cores": "2", "spark.executor.memory": "2g", - "spark.executor.instances": 2, - "spark.dynamicAllocation.enabled": True, - "spark.dynamicAllocation.minExecutors": 1, - "spark.dynamicAllocation.maxExecutors": 3, + "spark.executor.instances": "2", + "spark.dynamicAllocation.enabled": "True", + "spark.dynamicAllocation.minExecutors": "1", + "spark.dynamicAllocation.maxExecutors": "3", } assert node._to_job()._to_rest_object().properties.conf == expected_conf @@ -384,11 +384,11 @@ def test_spark_job_with_additional_conf(self): }, ) expected_conf = { - "spark.driver.cores": 1, + "spark.driver.cores": "1", "spark.driver.memory": "2g", - "spark.executor.cores": 2, + "spark.executor.cores": "2", "spark.executor.memory": "2g", - "spark.executor.instances": 2, + "spark.executor.instances": "2", "spark.jars.packages": "com.microsoft.ml.spark:mmlspark_2.11:0.15", "spark.jars.repositories": "https://mmlspark.azureedge.net/maven", "spark.jars.excludes": "slf4j", diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/spark_job/spark_job_rest.json b/sdk/ml/azure-ai-ml/tests/test_configs/spark_job/spark_job_rest.json index 793e0d79f69c..eeb6725ffd6d 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/spark_job/spark_job_rest.json +++ b/sdk/ml/azure-ai-ml/tests/test_configs/spark_job/spark_job_rest.json @@ -2,14 +2,14 @@ "code": "./basic_spark_job/src", "compute": "azureml:douglassynapse", "conf": { - "spark.driver.cores": 1, + "spark.driver.cores": "1", "spark.driver.memory": "2g", - "spark.executor.cores": 2, + "spark.executor.cores": "2", "spark.executor.memory": "2g", - "spark.executor.instances": 1, - "spark.dynamicAllocation.enabled": true, - "spark.dynamicAllocation.minExecutors": 1, - "spark.dynamicAllocation.maxExecutors": 5 + "spark.executor.instances": "1", + "spark.dynamicAllocation.enabled": "True", + "spark.dynamicAllocation.minExecutors": "1", + "spark.dynamicAllocation.maxExecutors": "5" }, "description": "simply the best", "display_name": "witty_feather_2tys9tvrmc", From 9a10989c91c52a15536c062c521957f5479ebf5f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 11:55:07 +0530 Subject: [PATCH 008/146] fix(jobs,deployments): keep shared job leaves msrest at boundary + arm-wrap in spark envelope --- .../azure/ai/ml/entities/_job/job_limits.py | 2 +- .../azure/ai/ml/entities/_job/job_service.py | 4 ++-- .../ai/ml/entities/_job/pipeline/_io/mixin.py | 4 ++-- .../entities/_job/resource_configuration.py | 2 +- .../azure/ai/ml/entities/_job/spark_job.py | 14 ++++++++--- .../ai/ml/entities/_job/spark_job_entry.py | 4 ++-- .../_job/spark_resource_configuration.py | 2 +- .../unittests/test_deployment_entity.py | 23 +++++++++++-------- 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py index 2d1c22e12e39..0797eed0b826 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py @@ -6,7 +6,7 @@ from abc import ABC from typing import Any, Optional, Union -from azure.ai.ml._restclient.arm_ml_service.models import CommandJobLimits as RestCommandJobLimits +from azure.ai.ml._restclient.v2023_04_01_preview.models import CommandJobLimits as RestCommandJobLimits from azure.ai.ml._restclient.v2023_08_01_preview.models import SweepJobLimits as RestSweepJobLimits from azure.ai.ml._utils.utils import from_iso_duration_format, is_data_binding_expression, to_iso_duration_format from azure.ai.ml.constants import JobType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py index 52b5f20d937c..09d7ed06c275 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py @@ -9,8 +9,8 @@ from typing_extensions import Literal -from azure.ai.ml._restclient.arm_ml_service.models import AllNodes -from azure.ai.ml._restclient.arm_ml_service.models import JobService as RestJobService +from azure.ai.ml._restclient.v2023_04_01_preview.models import AllNodes +from azure.ai.ml._restclient.v2023_04_01_preview.models import JobService as RestJobService from azure.ai.ml.constants._job.job import JobServiceTypeNames from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 5109249c9194..6c3d9357dd9b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -5,8 +5,8 @@ import copy from typing import Any, Dict, List, Optional, Tuple, Type, Union -from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput -from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput +from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput from azure.ai.ml.constants._component import ComponentJobConstants from azure.ai.ml.entities._inputs_outputs import GroupInput, Input, Output from azure.ai.ml.entities._util import copy_output_setting diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py index 18f645b4b11a..a10d4a66035c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, Optional -from azure.ai.ml._restclient.arm_ml_service.models import ResourceConfiguration as RestResourceConfiguration +from azure.ai.ml._restclient.v2023_04_01_preview.models import ResourceConfiguration as RestResourceConfiguration from azure.ai.ml.constants._job.job import JobComputePropertyFields from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py index d8a30db2c271..cfff14e535bf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py @@ -15,6 +15,10 @@ from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput from azure.ai.ml._restclient.arm_ml_service.models import SparkJob as RestSparkJob +from azure.ai.ml._restclient.arm_ml_service.models import SparkJobEntry as RestSparkJobEntry +from azure.ai.ml._restclient.arm_ml_service.models import ( + SparkResourceConfiguration as RestSparkResourceConfiguration, +) from azure.ai.ml._schema.job.identity import AMLTokenIdentitySchema, ManagedIdentitySchema, UserIdentitySchema from azure.ai.ml._schema.job.parameterized_spark import CONF_KEY_MAP from azure.ai.ml._schema.job.spark_job import SparkJobSchema @@ -245,7 +249,10 @@ def _to_rest_object(self) -> JobBase: # The shared arm_ml_service SparkJob model defaults ``is_archived`` to None (omitted on # the wire); the legacy msrest model serialized ``isArchived=false`` on create. is_archived=False, - entry=self.entry._to_rest_object() if self.entry is not None and not isinstance(self.entry, dict) else None, + entry=to_hybrid_rest_model( + (self.entry._to_rest_object() if self.entry is not None and not isinstance(self.entry, dict) else None), + RestSparkJobEntry, + ), py_files=self.py_files, jars=self.jars, files=self.files, @@ -267,8 +274,9 @@ def _to_rest_object(self) -> JobBase: outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), args=self.args, compute_id=self.compute, - resources=( - self.resources._to_rest_object() if self.resources and not isinstance(self.resources, Dict) else None + resources=to_hybrid_rest_model( + self.resources._to_rest_object() if self.resources and not isinstance(self.resources, Dict) else None, + RestSparkResourceConfiguration, ), ) result = JobBase(properties=properties) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py index 52b45a2652c5..ed8d3ca797a7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py @@ -5,8 +5,8 @@ from typing import Optional, Union -from azure.ai.ml._restclient.arm_ml_service.models import SparkJobEntry as RestSparkJobEntry -from azure.ai.ml._restclient.arm_ml_service.models import SparkJobPythonEntry, SparkJobScalaEntry +from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobEntry as RestSparkJobEntry +from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobPythonEntry, SparkJobScalaEntry from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py index 9ef9cb5bd07d..138fc7ed7f16 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py @@ -4,7 +4,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.arm_ml_service.models import ( +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( SparkResourceConfiguration as RestSparkResourceConfiguration, ) from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py index 4e21b600ab3f..9d1fa83fcec6 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py @@ -11,11 +11,11 @@ from azure.ai.ml._restclient.arm_ml_service.models import BatchOutputAction, EndpointComputeType from azure.ai.ml._restclient.arm_ml_service._utils.model_base import _deserialize from azure.ai.ml._restclient.v2023_04_01_preview.models import BatchPipelineComponentDeploymentConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( KubernetesOnlineDeployment as RestKubernetesOnlineDeployment, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedOnlineDeployment as RestManagedOnlineDeployment -from azure.ai.ml._restclient.v2023_04_01_preview.models import OnlineDeployment as RestOnlineDeploymentData +from azure.ai.ml._restclient.arm_ml_service.models import ManagedOnlineDeployment as RestManagedOnlineDeployment +from azure.ai.ml._restclient.arm_ml_service.models import OnlineDeployment as RestOnlineDeploymentData from azure.ai.ml.constants._common import ArmConstants from azure.ai.ml.constants._deployment import BatchDeploymentOutputAction from azure.ai.ml.entities import ( @@ -770,7 +770,7 @@ def test_code_path_setter(self) -> None: def test_managed_online_deployment_from_rest_object(self) -> None: with open("./tests/test_configs/deployments/online/online_deployment_managed_rest.json", "r") as f: - rest_object = RestOnlineDeploymentData.deserialize(json.load(f)) + rest_object = RestOnlineDeploymentData._deserialize(json.load(f), []) blue_deployment = OnlineDeployment._from_rest_object(rest_object) assert isinstance(blue_deployment, ManagedOnlineDeployment) assert blue_deployment.name == "blue" @@ -806,7 +806,7 @@ def test_managed_online_deployment_from_rest_object(self) -> None: def test_kubenets_online_deployment_from_rest_object_(self) -> None: with open("./tests/test_configs/deployments/online/online_deployment_kubernetes_rest.json", "r") as f: - rest_object = RestOnlineDeploymentData.deserialize(json.load(f)) + rest_object = RestOnlineDeploymentData._deserialize(json.load(f), []) blue_deployment = OnlineDeployment._from_rest_object(rest_object) assert isinstance(blue_deployment, KubernetesOnlineDeployment) assert blue_deployment.name == "blue" @@ -873,7 +873,7 @@ def test_deployment_from_rest_object_for_online_deployment(self) -> None: def test_online_deployment_from_rest_object_unsupported_type(self) -> None: with open("./tests/test_configs/deployments/online/online_deployment_kubernetes_rest.json", "r") as f: - rest_object = RestOnlineDeploymentData.deserialize(json.load(f)) + rest_object = RestOnlineDeploymentData._deserialize(json.load(f), []) rest_object.properties.endpoint_compute_type = "Other" with pytest.raises(DeploymentException) as exc: OnlineDeployment._from_rest_object(rest_object) @@ -881,14 +881,17 @@ def test_online_deployment_from_rest_object_unsupported_type(self) -> None: def test__deployment_from_rest_object_unsupported_type(self) -> None: with open("./tests/test_configs/deployments/online/online_deployment_kubernetes_rest.json", "r") as f: - rest_object = RestOnlineDeploymentData.deserialize(json.load(f)) + rest_object = RestOnlineDeploymentData._deserialize(json.load(f), []) + # The base ``Deployment`` dispatcher only accepts the Online/Batch tracked-resource + # envelopes; a raw properties object (KubernetesOnlineDeployment) is unsupported. + properties_object = rest_object.properties with pytest.raises(DeploymentException) as exc: - Deployment._from_rest_object(rest_object) - assert str(exc.value) == f"Unsupported deployment type {type(rest_object)}" + Deployment._from_rest_object(properties_object) + assert str(exc.value) == f"Unsupported deployment type {type(properties_object)}" def test_online_deployment_from_rest_object_unsupported_scale_settings_type(self) -> None: with open("./tests/test_configs/deployments/online/online_deployment_kubernetes_rest.json", "r") as f: - rest_object = RestOnlineDeploymentData.deserialize(json.load(f)) + rest_object = RestOnlineDeploymentData._deserialize(json.load(f), []) rest_object.properties.scale_settings.scale_type = "Other" with pytest.raises(DeploymentException) as exc: OnlineDeployment._from_rest_object(rest_object) From 13d0b9b26a8aa3a7ee710267b0d3a37c2b67886e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 12:14:50 +0530 Subject: [PATCH 009/146] fix(schedule): arm spark job embedded in schedule + inline env assertion --- .../tests/schedule/unittests/test_schedule_entity.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py b/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py index 56d201f8b352..36140123a700 100644 --- a/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py +++ b/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py @@ -156,9 +156,9 @@ def test_schedule_entity_with_spark_job(self): inner_job = load_job(inner_job_path)._to_job() schedule = load_schedule(test_path) rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["jobDefinition"] - # SparkJob builds a v2023_04 msrest envelope; the schedule embeds it as its camelCase wire dict - # (``.serialize()``), so compare against the standalone job serialized the same way. - loaded_job_dict = inner_job._to_rest_object().properties.serialize() + # SparkJob now builds the shared arm_ml_service hybrid envelope; the schedule embeds it directly, + # so compare against the standalone job's arm ``as_dict()`` (camelCase) wire form. + loaded_job_dict = inner_job._to_rest_object().properties.as_dict() assert rest_schedule_job_dict == loaded_job_dict # Test with local file + overwrites test_path = "./tests/test_configs/schedule/local_cron_spark_job2.yml" @@ -172,7 +172,11 @@ def test_schedule_entity_with_spark_job(self): "spark.executor.memory": "2g", "spark.executor.instances": "2", } - assert "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu22.04" in rest_schedule_job_dict["environmentId"] + # The inline anonymous environment is resolved to an arm-id by the operations layer at submit + # time; offline the arm envelope keeps it as an ``Environment`` object, so assert on its image. + environment_id = rest_schedule_job_dict["environmentId"] + environment_image = getattr(environment_id, "image", environment_id) + assert "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu22.04" in str(environment_image) def test_invalid_date_string(self): pipeline_job = load_job( From e702aeed2d7166245f59f1573a83c3533bc88bcc Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 12:24:35 +0530 Subject: [PATCH 010/146] fix(datastore): JSON-direct HDFS/Kerberos on-prem (absent from arm) to fix mixed-tree serialize --- .../ai/ml/entities/_datastore/_on_prem.py | 51 ++++++++------ .../_datastore/_on_prem_credentials.py | 68 +++++++++++-------- .../azure/ai/ml/entities/_datastore/utils.py | 11 ++- 3 files changed, 75 insertions(+), 55 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py index e6c0dc3f43e7..dfd07e468d09 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py @@ -8,9 +8,6 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import Datastore as DatastoreData -from azure.ai.ml._restclient.v2023_04_01_preview.models import DatastoreType -from azure.ai.ml._restclient.v2023_04_01_preview.models import HdfsDatastore as RestHdfsDatastore from azure.ai.ml._schema._datastore._on_prem import HdfsSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, TYPE @@ -21,6 +18,10 @@ from ._constants import HTTP from ._on_prem_credentials import KerberosKeytabCredentials, KerberosPasswordCredentials +# ``HdfsDatastore`` is absent from the arm_ml_service (2025-12) model set, so this entity serializes +# JSON-direct to the 2023-04 camelCase wire contract. ``datastoreType`` discriminator value is preserved. +_HDFS_DATASTORE_TYPE = "Hdfs" + @experimental class HdfsDatastore(Datastore): @@ -60,7 +61,7 @@ def __init__( credentials: Optional[Union[KerberosKeytabCredentials, KerberosPasswordCredentials]], **kwargs: Any ): - kwargs[TYPE] = DatastoreType.HDFS + kwargs[TYPE] = _HDFS_DATASTORE_TYPE super().__init__( name=name, description=description, tags=tags, properties=properties, credentials=credentials, **kwargs ) @@ -69,20 +70,24 @@ def __init__( self.name_node_address = name_node_address self.protocol = protocol - def _to_rest_object(self) -> DatastoreData: + def _to_rest_object(self) -> Dict[str, Any]: use_this_cert = None if self.hdfs_server_certificate: with open(self.hdfs_server_certificate, "rb") as f: use_this_cert = b64encode(f.read()).decode("utf-8") - hdfs_ds = RestHdfsDatastore( - credentials=self.credentials._to_rest_object(), - hdfs_server_certificate=use_this_cert, - name_node_address=self.name_node_address, - protocol=self.protocol, - description=self.description, - tags=self.tags, - ) - return DatastoreData(properties=hdfs_ds) + properties: Dict[str, Any] = { + "credentials": self.credentials._to_rest_object(), + "datastoreType": _HDFS_DATASTORE_TYPE, + "nameNodeAddress": self.name_node_address, + "protocol": self.protocol, + } + if use_this_cert is not None: + properties["hdfsServerCertificate"] = use_this_cert + if self.description is not None: + properties["description"] = self.description + if self.tags is not None: + properties["tags"] = self.tags + return {"properties": properties} @classmethod def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "HdfsDatastore": @@ -90,17 +95,19 @@ def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **k return res @classmethod - def _from_rest_object(cls, datastore_resource: DatastoreData) -> "HdfsDatastore": - properties: RestHdfsDatastore = datastore_resource.properties + def _from_rest_object(cls, datastore_resource: Any) -> "HdfsDatastore": + # ``HdfsDatastore`` is absent from arm_ml_service; the operation client returns the base + # datastore envelope, so read the Hdfs-specific fields via mapping access. + properties = datastore_resource.properties return HdfsDatastore( name=datastore_resource.name, id=datastore_resource.id, - credentials=_from_rest_datastore_credentials_preview(properties.credentials), - hdfs_server_certificate=properties.hdfs_server_certificate, - name_node_address=properties.name_node_address, - protocol=properties.protocol, - description=properties.description, - tags=properties.tags, + credentials=_from_rest_datastore_credentials_preview(properties.get("credentials")), + hdfs_server_certificate=properties.get("hdfsServerCertificate"), + name_node_address=properties.get("nameNodeAddress"), + protocol=properties.get("protocol"), + description=properties.get("description"), + tags=properties.get("tags"), ) def __eq__(self, other: Any) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem_credentials.py index b658851a3720..1edeab6baf7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem_credentials.py @@ -3,13 +3,19 @@ # --------------------------------------------------------- from base64 import b64encode -from typing import Any, Optional +from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2023_04_01_preview import models as model_preview from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.entities._credentials import NoneCredentialConfiguration +# ``KerberosKeytabCredentials``/``KerberosPasswordCredentials`` (and their secrets) are absent from the +# arm_ml_service (2025-12) model set, so these entities serialize JSON-direct to the 2023-04 camelCase +# wire contract. The wire ``credentialsType``/``secretsType`` discriminator values are preserved. +_KERBEROS_KEYTAB = "KerberosKeytab" +_KERBEROS_PASSWORD = "KerberosPassword" + + # TODO: Move classes in this file to azure.ai.ml.entities._credentials @experimental class BaseKerberosCredentials(NoneCredentialConfiguration): @@ -37,29 +43,30 @@ def __init__( kerberos_principal=kerberos_principal, **kwargs, ) - self.type = model_preview.CredentialsType.KERBEROS_KEYTAB + self.type = _KERBEROS_KEYTAB self.kerberos_keytab = kerberos_keytab - def _to_rest_object(self) -> model_preview.KerberosKeytabCredentials: + def _to_rest_object(self) -> Dict[str, Any]: use_this_keytab = None if self.kerberos_keytab: with open(self.kerberos_keytab, "rb") as f: use_this_keytab = b64encode(f.read()).decode("utf-8") - secrets = model_preview.KerberosKeytabSecrets(kerberos_keytab=use_this_keytab) - return model_preview.KerberosKeytabCredentials( - kerberos_kdc_address=self.kerberos_kdc_address, - kerberos_principal=self.kerberos_principal, - kerberos_realm=self.kerberos_realm, - secrets=secrets, - ) + return { + "credentialsType": _KERBEROS_KEYTAB, + "kerberosKdcAddress": self.kerberos_kdc_address, + "kerberosPrincipal": self.kerberos_principal, + "kerberosRealm": self.kerberos_realm, + "secrets": {"secretsType": _KERBEROS_KEYTAB, "kerberosKeytab": use_this_keytab}, + } @classmethod - def _from_rest_object(cls, obj: model_preview.KerberosKeytabCredentials) -> "KerberosKeytabCredentials": + def _from_rest_object(cls, obj: Any) -> "KerberosKeytabCredentials": + secrets = obj.get("secrets") if obj is not None else None return cls( - kerberos_kdc_address=obj.kerberos_kdc_address, - kerberos_principal=obj.kerberos_principal, - kerberos_realm=obj.kerberos_realm, - kerberos_keytab=obj.secrets.kerberos_keytab if obj.secrets else None, + kerberos_kdc_address=obj.get("kerberosKdcAddress"), + kerberos_principal=obj.get("kerberosPrincipal"), + kerberos_realm=obj.get("kerberosRealm"), + kerberos_keytab=secrets.get("kerberosKeytab") if secrets else None, ) def __eq__(self, other: object) -> bool: @@ -93,25 +100,26 @@ def __init__( kerberos_principal=kerberos_principal, **kwargs, ) - self.type = model_preview.CredentialsType.KERBEROS_PASSWORD + self.type = _KERBEROS_PASSWORD self.kerberos_password = kerberos_password - def _to_rest_object(self) -> model_preview.KerberosPasswordCredentials: - secrets = model_preview.KerberosPasswordSecrets(kerberos_password=self.kerberos_password) - return model_preview.KerberosPasswordCredentials( - kerberos_kdc_address=self.kerberos_kdc_address, - kerberos_principal=self.kerberos_principal, - kerberos_realm=self.kerberos_realm, - secrets=secrets, - ) + def _to_rest_object(self) -> Dict[str, Any]: + return { + "credentialsType": _KERBEROS_PASSWORD, + "kerberosKdcAddress": self.kerberos_kdc_address, + "kerberosPrincipal": self.kerberos_principal, + "kerberosRealm": self.kerberos_realm, + "secrets": {"secretsType": _KERBEROS_PASSWORD, "kerberosPassword": self.kerberos_password}, + } @classmethod - def _from_rest_object(cls, obj: model_preview.KerberosPasswordCredentials) -> "KerberosPasswordCredentials": + def _from_rest_object(cls, obj: Any) -> "KerberosPasswordCredentials": + secrets = obj.get("secrets") if obj is not None else None return cls( - kerberos_kdc_address=obj.kerberos_kdc_address, - kerberos_principal=obj.kerberos_principal, - kerberos_realm=obj.kerberos_realm, - kerberos_password=obj.secrets.kerberos_password if obj.secrets else None, + kerberos_kdc_address=obj.get("kerberosKdcAddress"), + kerberos_principal=obj.get("kerberosPrincipal"), + kerberos_realm=obj.get("kerberosRealm"), + kerberos_password=secrets.get("kerberosPassword") if secrets else None, ) def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py index c6eacec370bb..1bf02a443a63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py @@ -60,11 +60,16 @@ def from_rest_datastore_credentials( def _from_rest_datastore_credentials_preview( - rest_credentials: models.DatastoreCredentials, + rest_credentials: Any, ) -> Optional[Union[KerberosKeytabCredentials, KerberosPasswordCredentials]]: - if isinstance(rest_credentials, models.KerberosKeytabCredentials): + # ``Kerberos*`` credential models are absent from arm_ml_service; the operation client returns them + # as a raw mapping, so dispatch on the ``credentialsType`` wire discriminator. + if not rest_credentials: + return None + credentials_type = rest_credentials.get("credentialsType") + if credentials_type == "KerberosKeytab": return KerberosKeytabCredentials._from_rest_object(rest_credentials) - if isinstance(rest_credentials, models.KerberosPasswordCredentials): + if credentials_type == "KerberosPassword": return KerberosPasswordCredentials._from_rest_object(rest_credentials) return None From 930a1ad27e787a6b3b0269850a5e093a70dbde9b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 13:20:45 +0530 Subject: [PATCH 011/146] feat(dsl): handle arm hybrid children in get_rest_dict_for_node_attrs via as_attribute_dict --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py index 91442dacee38..eddac231a205 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py @@ -390,6 +390,14 @@ def get_rest_dict_for_node_attrs( # can't use result.as_dict() as data binding expression may not fit rest object structure return get_rest_dict_for_node_attrs(target_obj.__dict__, clear_empty_value=clear_empty_value) + # arm_ml_service hybrid models (``_is_model`` marker) are dict subclasses but are NOT + # msrest.serialization.Model; convert to a snake_case attribute dict (matching the msrest + # ``__dict__`` shape) so data-binding expressions survive the same way for both generators. + if getattr(target_obj, "_is_model", False) is True: + from azure.core.serialization import as_attribute_dict + + return get_rest_dict_for_node_attrs(as_attribute_dict(target_obj), clear_empty_value=clear_empty_value) + if isinstance(target_obj, PipelineInput): return get_rest_dict_for_node_attrs(str(target_obj), clear_empty_value=clear_empty_value) From 67f671fa098c21fda335be4c9a02d12a3082efa8 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 13:28:49 +0530 Subject: [PATCH 012/146] migrate(jobs): CommandJobLimits to arm_ml_service (arm envelope, wrap no-op) --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py index 0797eed0b826..3aede86855b8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py @@ -6,7 +6,7 @@ from abc import ABC from typing import Any, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import CommandJobLimits as RestCommandJobLimits +from azure.ai.ml._restclient.arm_ml_service.models import CommandJobLimits as RestCommandJobLimits from azure.ai.ml._restclient.v2023_08_01_preview.models import SweepJobLimits as RestSweepJobLimits from azure.ai.ml._utils.utils import from_iso_duration_format, is_data_binding_expression, to_iso_duration_format from azure.ai.ml.constants import JobType @@ -69,7 +69,7 @@ def _from_rest_object(cls, obj: Union[RestCommandJobLimits, dict]) -> Optional[" if is_data_binding_expression(timeout_value): return cls(timeout=timeout_value) # if response timeout is a normal iso date string - obj = RestCommandJobLimits.from_dict(obj) + obj = RestCommandJobLimits._deserialize(obj, []) return cls(timeout=from_iso_duration_format(obj.timeout)) From 4bd978ac4af287d88ec138278b623cffd9533bb0 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 15:33:27 +0530 Subject: [PATCH 013/146] migrate(jobs): SweepJob envelope + sampling_algorithm to arm_ml_service Flip the SweepJob envelope and its children to the shared arm_ml_service hybrid model, wrapping each nested child (trial distribution/resources, sampling_algorithm, limits, early_termination, objective, inputs, outputs, identity, queue_settings, resources) through to_hybrid_rest_model so the body serializes via the hybrid SdkJSONEncoder. Set is_archived=False and attach the arm-dropped `resources` field via wire-key after construction. - sampling_algorithm read path: arm hybrids are MutableMapping (not dict subclass), so read the arm-dropped `logbase` unknown wire key via _is_model/Mapping check instead of isinstance(obj, dict). - Read path _load_from_rest updated for arm mapping access (resources, searchSpace). - Tests: flip identity expected-models (AmlToken/ManagedIdentity/ UserIdentity) to arm_ml_service; introspect arm-dropped logbase/resources via mapping access; DSL test_set_limits expects camelCase jobLimitsType from arm CommandJobLimits as_dict. Sweep UTs (82) + sweep wire smoke (6) + full pipeline_job (200) + dsl + command + job_common all green. Retires v2023_08 consumers: sweep_job, objective, sampling_algorithm, SweepJobLimits. --- .../entities/_job/sweep/sampling_algorithm.py | 50 ++- .../ai/ml/entities/_job/sweep/sweep_job.py | 214 ++++++++--- .../dsl/unittests/test_command_builder.py | 349 ++++++++++++++---- .../sweep_job/unittests/test_sweep_job.py | 126 +++++-- .../unittests/test_sweep_job_schema.py | 222 ++++++++--- 5 files changed, 761 insertions(+), 200 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py index d0bf795d127f..38fa02f6ffae 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py @@ -2,14 +2,21 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from abc import ABC +from collections.abc import Mapping from typing import Any, Optional, Union, cast from azure.ai.ml._restclient.v2023_08_01_preview.models import ( BayesianSamplingAlgorithm as RestBayesianSamplingAlgorithm, ) -from azure.ai.ml._restclient.v2023_08_01_preview.models import GridSamplingAlgorithm as RestGridSamplingAlgorithm -from azure.ai.ml._restclient.v2023_08_01_preview.models import RandomSamplingAlgorithm as RestRandomSamplingAlgorithm -from azure.ai.ml._restclient.v2023_08_01_preview.models import SamplingAlgorithm as RestSamplingAlgorithm +from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + GridSamplingAlgorithm as RestGridSamplingAlgorithm, +) +from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + RandomSamplingAlgorithm as RestRandomSamplingAlgorithm, +) +from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + SamplingAlgorithm as RestSamplingAlgorithm, +) from azure.ai.ml._restclient.v2023_08_01_preview.models import SamplingAlgorithmType from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -24,19 +31,27 @@ def __init__(self) -> None: self.type = None @classmethod - def _from_rest_object(cls, obj: RestSamplingAlgorithm) -> Optional["SamplingAlgorithm"]: + def _from_rest_object( + cls, obj: RestSamplingAlgorithm + ) -> Optional["SamplingAlgorithm"]: if not obj: return None sampling_algorithm: Any = None if obj.sampling_algorithm_type == SamplingAlgorithmType.RANDOM: - sampling_algorithm = RandomSamplingAlgorithm._from_rest_object(obj) # pylint: disable=protected-access + sampling_algorithm = RandomSamplingAlgorithm._from_rest_object( + obj + ) # pylint: disable=protected-access if obj.sampling_algorithm_type == SamplingAlgorithmType.GRID: - sampling_algorithm = GridSamplingAlgorithm._from_rest_object(obj) # pylint: disable=protected-access + sampling_algorithm = GridSamplingAlgorithm._from_rest_object( + obj + ) # pylint: disable=protected-access if obj.sampling_algorithm_type == SamplingAlgorithmType.BAYESIAN: - sampling_algorithm = BayesianSamplingAlgorithm._from_rest_object(obj) # pylint: disable=protected-access + sampling_algorithm = BayesianSamplingAlgorithm._from_rest_object( + obj + ) # pylint: disable=protected-access return cast(Optional["SamplingAlgorithm"], sampling_algorithm) @@ -83,11 +98,20 @@ def _to_rest_object(self) -> RestRandomSamplingAlgorithm: ) @classmethod - def _from_rest_object(cls, obj: RestRandomSamplingAlgorithm) -> "RandomSamplingAlgorithm": + def _from_rest_object( + cls, obj: RestRandomSamplingAlgorithm + ) -> "RandomSamplingAlgorithm": + # ``logbase`` is not modeled on the shared arm_ml_service RandomSamplingAlgorithm; it is + # preserved as an unknown wire key on the hybrid model (a MutableMapping, not a dict subclass), + # so read it from the mapping when present, otherwise fall back to attribute access for msrest. + if getattr(obj, "_is_model", False) or isinstance(obj, Mapping): + logbase = obj.get("logbase") + else: + logbase = getattr(obj, "logbase", None) return cls( rule=obj.rule, seed=obj.seed, - logbase=obj.logbase, + logbase=logbase, ) @@ -112,7 +136,9 @@ def _to_rest_object(self) -> RestGridSamplingAlgorithm: return RestGridSamplingAlgorithm() @classmethod - def _from_rest_object(cls, obj: RestGridSamplingAlgorithm) -> "GridSamplingAlgorithm": + def _from_rest_object( + cls, obj: RestGridSamplingAlgorithm + ) -> "GridSamplingAlgorithm": return cls() @@ -137,5 +163,7 @@ def _to_rest_object(self) -> RestBayesianSamplingAlgorithm: return RestBayesianSamplingAlgorithm() @classmethod - def _from_rest_object(cls, obj: RestBayesianSamplingAlgorithm) -> "BayesianSamplingAlgorithm": + def _from_rest_object( + cls, obj: RestBayesianSamplingAlgorithm + ) -> "BayesianSamplingAlgorithm": return cls() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py index d7f109cecbb4..ec6082f0bede 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py @@ -7,9 +7,33 @@ import logging from typing import Any, Dict, NoReturn, Optional, Union -from azure.ai.ml._restclient.v2023_08_01_preview.models import JobBase -from azure.ai.ml._restclient.v2023_08_01_preview.models import SweepJob as RestSweepJob -from azure.ai.ml._restclient.v2023_08_01_preview.models import TrialComponent +from azure.ai.ml._restclient.arm_ml_service.models import ( + DistributionConfiguration as RestDistributionConfiguration, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + EarlyTerminationPolicy as RestEarlyTerminationPolicy, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + IdentityConfiguration as RestIdentityConfiguration, +) +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import ( + JobResourceConfiguration as RestJobResourceConfiguration, +) +from azure.ai.ml._restclient.arm_ml_service.models import Objective as RestObjective +from azure.ai.ml._restclient.arm_ml_service.models import ( + QueueSettings as RestQueueSettings, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + SamplingAlgorithm as RestSamplingAlgorithm, +) +from azure.ai.ml._restclient.arm_ml_service.models import SweepJob as RestSweepJob +from azure.ai.ml._restclient.arm_ml_service.models import ( + SweepJobLimits as RestSweepJobLimits, +) +from azure.ai.ml._restclient.arm_ml_service.models import TrialComponent from azure.ai.ml._schema._sweep.sweep_job import SweepJobSchema from azure.ai.ml._utils.utils import map_single_brackets_and_warn from azure.ai.ml.constants import JobType @@ -25,6 +49,7 @@ from azure.ai.ml.entities._job._input_output_helpers import ( from_rest_data_outputs, from_rest_inputs_to_dataset_literal, + to_hybrid_rest_model, to_rest_data_outputs, to_rest_dataset_literal_inputs, validate_inputs_for_command, @@ -33,7 +58,9 @@ from azure.ai.ml.entities._job.command_job import CommandJob from azure.ai.ml.entities._job.job import Job from azure.ai.ml.entities._job.job_io_mixin import JobIOMixin -from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration +from azure.ai.ml.entities._job.job_resource_configuration import ( + JobResourceConfiguration, +) from azure.ai.ml.entities._job.sweep.sampling_algorithm import SamplingAlgorithm from azure.ai.ml.entities._system_data import SystemData from azure.ai.ml.entities._util import load_from_dict @@ -159,7 +186,11 @@ def __init__( display_name: Optional[str] = None, experiment_name: Optional[str] = None, identity: Optional[ - Union[ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] + Union[ + ManagedIdentityConfiguration, + AmlTokenConfiguration, + UserIdentityConfiguration, + ] ] = None, inputs: Optional[Dict[str, Union[Input, str, bool, int, float]]] = None, outputs: Optional[Dict] = None, @@ -170,14 +201,28 @@ def __init__( Dict[ str, Union[ - Choice, LogNormal, LogUniform, Normal, QLogNormal, QLogUniform, QNormal, QUniform, Randint, Uniform + Choice, + LogNormal, + LogUniform, + Normal, + QLogNormal, + QLogUniform, + QNormal, + QUniform, + Randint, + Uniform, ], ] ] = None, objective: Optional[Objective] = None, trial: Optional[Union[CommandJob, CommandComponent]] = None, early_termination: Optional[ - Union[EarlyTerminationPolicy, BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy] + Union[ + EarlyTerminationPolicy, + BanditPolicy, + MedianStoppingPolicy, + TruncationSelectionPolicy, + ] ] = None, queue_settings: Optional[QueueSettings] = None, resources: Optional[Union[dict, JobResourceConfiguration]] = None, @@ -221,28 +266,41 @@ def _to_rest_object(self) -> JobBase: self.trial.command = map_single_brackets_and_warn(self.trial.command) if self.search_space is not None: - search_space = {param: space._to_rest_object() for (param, space) in self.search_space.items()} + search_space = { + param: space._to_rest_object() + for (param, space) in self.search_space.items() + } if self.trial is not None: validate_inputs_for_command(self.trial.command, self.inputs) - for key in search_space.keys(): # pylint: disable=possibly-used-before-assignment + for ( + key + ) in search_space.keys(): # pylint: disable=possibly-used-before-assignment validate_key_contains_allowed_characters(key) if self.trial is not None: trial_component = TrialComponent( code_id=self.trial.code, - distribution=( - self.trial.distribution._to_rest_object() - if self.trial.distribution and not isinstance(self.trial.distribution, Dict) - else None + distribution=to_hybrid_rest_model( + ( + self.trial.distribution._to_rest_object() + if self.trial.distribution + and not isinstance(self.trial.distribution, Dict) + else None + ), + RestDistributionConfiguration, ), environment_id=self.trial.environment, command=self.trial.command, environment_variables=self.trial.environment_variables, - resources=( - self.trial.resources._to_rest_object() - if self.trial.resources and not isinstance(self.trial.resources, Dict) - else None + resources=to_hybrid_rest_model( + ( + self.trial.resources._to_rest_object() + if self.trial.resources + and not isinstance(self.trial.resources, Dict) + else None + ), + RestJobResourceConfiguration, ), ) @@ -250,30 +308,72 @@ def _to_rest_object(self) -> JobBase: display_name=self.display_name, description=self.description, experiment_name=self.experiment_name, + # The shared arm_ml_service SweepJob model defaults ``is_archived`` to None (omitted on the + # wire); the legacy msrest model serialized ``isArchived=false`` on create. + is_archived=False, search_space=search_space, - sampling_algorithm=self._get_rest_sampling_algorithm() if self.sampling_algorithm else None, - limits=self.limits._to_rest_object() if self.limits else None, - early_termination=( - self.early_termination._to_rest_object() - if self.early_termination and not isinstance(self.early_termination, str) - else None + # The shared rest helpers below emit msrest models; convert each nested child to its + # arm_ml_service hybrid equivalent so the hybrid SdkJSONEncoder can serialize the body. + sampling_algorithm=to_hybrid_rest_model( + ( + self._get_rest_sampling_algorithm() + if self.sampling_algorithm + else None + ), + RestSamplingAlgorithm, + ), + limits=to_hybrid_rest_model( + self.limits._to_rest_object() if self.limits else None, + RestSweepJobLimits, + ), + early_termination=to_hybrid_rest_model( + ( + self.early_termination._to_rest_object() + if self.early_termination + and not isinstance(self.early_termination, str) + else None + ), + RestEarlyTerminationPolicy, ), properties=self.properties, compute_id=self.compute, - objective=self.objective._to_rest_object() if self.objective else None, + objective=to_hybrid_rest_model( + self.objective._to_rest_object() if self.objective else None, + RestObjective, + ), trial=trial_component, # pylint: disable=possibly-used-before-assignment tags=self.tags, - inputs=to_rest_dataset_literal_inputs(self.inputs, job_type=self.type), - outputs=to_rest_data_outputs(self.outputs), - identity=self.identity._to_job_rest_object() if self.identity else None, - queue_settings=self.queue_settings._to_rest_object() if self.queue_settings else None, - resources=( - self.resources._to_rest_object() if self.resources and not isinstance(self.resources, dict) else None + inputs=to_hybrid_rest_model( + to_rest_dataset_literal_inputs(self.inputs, job_type=self.type), + RestJobInput, + ), + outputs=to_hybrid_rest_model( + to_rest_data_outputs(self.outputs), RestJobOutput + ), + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, + RestIdentityConfiguration, + ), + queue_settings=to_hybrid_rest_model( + self.queue_settings._to_rest_object() if self.queue_settings else None, + RestQueueSettings, ), ) + # ``resources`` exists on the 2023-08 SweepJob wire contract but was dropped from the + # arm_ml_service (2025-12) SweepJob model; assign it via wire-key so it still serializes. + sweep_resources = to_hybrid_rest_model( + ( + self.resources._to_rest_object() + if self.resources and not isinstance(self.resources, dict) + else None + ), + RestJobResourceConfiguration, + ) + if sweep_resources is not None: + sweep_job["resources"] = sweep_resources - if not sweep_job.resources and sweep_job.trial.resources: - sweep_job.resources = sweep_job.trial.resources + if not sweep_job.get("resources") and sweep_job.trial.resources: + sweep_job["resources"] = sweep_job.trial.resources sweep_job_resource = JobBase(properties=sweep_job) sweep_job_resource.name = self.name @@ -289,8 +389,12 @@ def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> NoRetu ) @classmethod - def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "SweepJob": - loaded_schema = load_from_dict(SweepJobSchema, data, context, additional_message, **kwargs) + def _load_from_dict( + cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any + ) -> "SweepJob": + loaded_schema = load_from_dict( + SweepJobSchema, data, context, additional_message, **kwargs + ) loaded_schema["trial"] = ParameterizedCommand(**(loaded_schema["trial"])) sweep_job = SweepJob(base_path=context[BASE_PATH_CONTEXT_KEY], **loaded_schema) return sweep_job @@ -300,10 +404,14 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": properties: RestSweepJob = obj.properties # Unpack termination schema - early_termination = EarlyTerminationPolicy._from_rest_object(properties.early_termination) + early_termination = EarlyTerminationPolicy._from_rest_object( + properties.early_termination + ) # Unpack sampling algorithm - sampling_algorithm = SamplingAlgorithm._from_rest_object(properties.sampling_algorithm) + sampling_algorithm = SamplingAlgorithm._from_rest_object( + properties.sampling_algorithm + ) trial = ParameterizedCommand._load_from_sweep_job(obj.properties) # Compute also appears in both layers of the yaml, but only one of the REST. @@ -323,21 +431,33 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": experiment_name=properties.experiment_name, services=properties.services, status=properties.status, - creation_context=SystemData._from_rest_object(obj.system_data) if obj.system_data else None, + creation_context=( + SystemData._from_rest_object(obj.system_data) + if obj.system_data + else None + ), trial=trial, # type: ignore[arg-type] compute=properties.compute_id, sampling_algorithm=sampling_algorithm, search_space=_search_space, # type: ignore[arg-type] limits=SweepJobLimits._from_rest_object(properties.limits), early_termination=early_termination, - objective=Objective._from_rest_object(properties.objective) if properties.objective else None, + objective=( + Objective._from_rest_object(properties.objective) + if properties.objective + else None + ), inputs=from_rest_inputs_to_dataset_literal(properties.inputs), outputs=from_rest_data_outputs(properties.outputs), identity=( - _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None + _BaseJobIdentityConfiguration._from_rest_object(properties.identity) + if properties.identity + else None ), queue_settings=properties.queue_settings, - resources=properties.resources if hasattr(properties, "resources") else None, + resources=JobResourceConfiguration._from_rest_object( + properties.get("resources") + ), ) def _override_missing_properties_from_trial(self) -> None: @@ -353,7 +473,15 @@ def _override_missing_properties_from_trial(self) -> None: has_trial_limits_timeout = self.trial.limits and self.trial.limits.timeout if has_trial_limits_timeout and not self.limits: - time_out = self.trial.limits.timeout if self.trial.limits is not None else None + time_out = ( + self.trial.limits.timeout if self.trial.limits is not None else None + ) self.limits = SweepJobLimits(trial_timeout=time_out) - elif has_trial_limits_timeout and self.limits is not None and not self.limits.trial_timeout: - self.limits.trial_timeout = self.trial.limits.timeout if self.trial.limits is not None else None + elif ( + has_trial_limits_timeout + and self.limits is not None + and not self.limits.trial_timeout + ): + self.limits.trial_timeout = ( + self.trial.limits.timeout if self.trial.limits is not None else None + ) diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py index 77e50aefc5f9..d1088ee032da 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py @@ -19,7 +19,11 @@ spark, ) from azure.ai.ml.dsl import pipeline -from azure.ai.ml.entities import CommandJobLimits, JobResourceConfiguration, QueueSettings +from azure.ai.ml.entities import ( + CommandJobLimits, + JobResourceConfiguration, + QueueSettings, +) from azure.ai.ml.entities._builders import Command from azure.ai.ml.entities._job.job_service import ( JobService, @@ -28,7 +32,9 @@ TensorBoardJobService, VsCodeJobService, ) -from azure.ai.ml.entities._job.pipeline._component_translatable import ComponentTranslatableMixin +from azure.ai.ml.entities._job.pipeline._component_translatable import ( + ComponentTranslatableMixin, +) from azure.ai.ml.exceptions import JobException, ValidationException from .._util import _DSL_TIMEOUT_SECOND @@ -60,8 +66,16 @@ def test_command_params(self) -> dict: "integer": 1, "string": "str", "boolean": False, - "uri_folder": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), - "uri_file": dict(type="uri_file", path="https://my-blob/path/to/data", mode="download"), + "uri_folder": Input( + type="uri_folder", + path="https://my-blob/path/to/data", + mode="ro_mount", + ), + "uri_file": dict( + type="uri_file", + path="https://my-blob/path/to/data", + mode="download", + ), }, outputs={"my_model": Output(type="mlflow_model", mode="rw_mount")}, ) @@ -96,8 +110,16 @@ def command_with_artifact_inputs(self): "integer": Input(type="integer", default=2, min=-1, max=4), "string": Input(type="string", default="default_str"), "boolean": Input(type="boolean", default=False), - "uri_folder": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), - "uri_file": Input(type="uri_file", path="https://my-blob/path/to/data", mode="download"), + "uri_folder": Input( + type="uri_folder", + path="https://my-blob/path/to/data", + mode="ro_mount", + ), + "uri_file": Input( + type="uri_file", + path="https://my-blob/path/to/data", + mode="download", + ), }, outputs={"my_model": Output(type="mlflow_model")}, ) @@ -114,14 +136,21 @@ def test_command_function(self, test_command): "_source": "BUILDER", "computeId": "cpu-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "inputs": { "boolean": {"job_input_type": "literal", "value": "False"}, "float": {"job_input_type": "literal", "value": "0.01"}, "integer": {"job_input_type": "literal", "value": "1"}, "string": {"job_input_type": "literal", "value": "str"}, - "uri_file": {"job_input_type": "uri_file", "mode": "Download", "uri": "https://my-blob/path/to/data"}, + "uri_file": { + "job_input_type": "uri_file", + "mode": "Download", + "uri": "https://my-blob/path/to/data", + }, "uri_folder": { "job_input_type": "uri_folder", "mode": "ReadOnlyMount", @@ -129,7 +158,12 @@ def test_command_function(self, test_command): }, }, "name": "my_job", - "outputs": {"my_model": {"job_output_type": "mlflow_model", "mode": "ReadWriteMount"}}, + "outputs": { + "my_model": { + "job_output_type": "mlflow_model", + "mode": "ReadWriteMount", + } + }, "type": "command", } actual_command = pydash.omit( @@ -147,7 +181,9 @@ def test_command_function(self, test_command): "_source": "BUILDER", "code": parse_local_path("./tests"), "description": "This is a fancy job", - "command": "python train.py --input-data " "${{inputs.uri_folder}} --lr " "${{inputs.float}}", + "command": "python train.py --input-data " + "${{inputs.uri_folder}} --lr " + "${{inputs.float}}", "display_name": "my-fancy-job", "distribution": {"process_count_per_instance": 4, "type": "mpi"}, "environment": "azureml:my-env:1", @@ -160,7 +196,9 @@ def test_command_function(self, test_command): "uri_folder": {"type": "uri_folder", "mode": "ro_mount"}, }, "is_deterministic": True, - "outputs": {"my_model": {"type": "mlflow_model", "mode": "rw_mount"}}, + "outputs": { + "my_model": {"type": "mlflow_model", "mode": "rw_mount"} + }, "type": "command", }, "description": "This is a fancy job", @@ -188,7 +226,9 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): "_source": "BUILDER", "code": parse_local_path("./tests"), "description": "This is a fancy job", - "command": "python train.py --input-data " "${{inputs.uri_folder}} --lr " "${{inputs.float}}", + "command": "python train.py --input-data " + "${{inputs.uri_folder}} --lr " + "${{inputs.float}}", "display_name": "my-fancy-job", "distribution": {"process_count_per_instance": 4, "type": "mpi"}, "environment": "azureml:my-env:1", @@ -201,7 +241,9 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): "uri_folder": {"type": "uri_folder", "mode": "ro_mount"}, }, "is_deterministic": False, - "outputs": {"my_model": {"type": "mlflow_model", "mode": "rw_mount"}}, + "outputs": { + "my_model": {"type": "mlflow_model", "mode": "rw_mount"} + }, "type": "command", }, "description": "This is a fancy job", @@ -220,7 +262,9 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): assert actual_component == expected_component def test_command_function_set_inputs(self, test_command): - test_data = Input(type="uri_folder", path="https://my-blob/path/to/data", mode="download") + test_data = Input( + type="uri_folder", path="https://my-blob/path/to/data", mode="download" + ) # Command can be called as a function, returning a new Component instance node1 = test_command(uri_folder=test_data, float=0.02) node2 = test_command(uri_folder=test_data, float=0.02) @@ -245,21 +289,33 @@ def test_command_function_set_inputs(self, test_command): "_source": "BUILDER", "computeId": "cpu-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "inputs": { "boolean": {"job_input_type": "literal", "value": "False"}, "float": {"job_input_type": "literal", "value": "0.02"}, "integer": {"job_input_type": "literal", "value": "1"}, "string": {"job_input_type": "literal", "value": "str"}, - "uri_file": {"job_input_type": "uri_file", "mode": "Download", "uri": "https://my-blob/path/to/data"}, + "uri_file": { + "job_input_type": "uri_file", + "mode": "Download", + "uri": "https://my-blob/path/to/data", + }, "uri_folder": { "job_input_type": "uri_folder", "mode": "Download", "uri": "https://my-blob/path/to/data", }, }, - "outputs": {"my_model": {"job_output_type": "mlflow_model", "mode": "ReadWriteMount"}}, + "outputs": { + "my_model": { + "job_output_type": "mlflow_model", + "mode": "ReadWriteMount", + } + }, "type": "command", } actual_dict = pydash.omit(node1_dict, "componentId", "properties") @@ -273,21 +329,33 @@ def test_command_function_default_values(self, test_command): "type": "command", "computeId": "cpu-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "inputs": { "boolean": {"job_input_type": "literal", "value": "False"}, "float": {"job_input_type": "literal", "value": "0.01"}, "integer": {"job_input_type": "literal", "value": "1"}, "string": {"job_input_type": "literal", "value": "str"}, - "uri_file": {"job_input_type": "uri_file", "mode": "Download", "uri": "https://my-blob/path/to/data"}, + "uri_file": { + "job_input_type": "uri_file", + "mode": "Download", + "uri": "https://my-blob/path/to/data", + }, "uri_folder": { "job_input_type": "uri_folder", "mode": "ReadOnlyMount", "uri": "https://my-blob/path/to/data", }, }, - "outputs": {"my_model": {"job_output_type": "mlflow_model", "mode": "ReadWriteMount"}}, + "outputs": { + "my_model": { + "job_output_type": "mlflow_model", + "mode": "ReadWriteMount", + } + }, } # node1 copies test_command's dict assert node1_dict == expected_dict @@ -302,14 +370,21 @@ def test_command_function_default_values(self, test_command): "type": "command", "computeId": "new-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "inputs": { "boolean": {"job_input_type": "literal", "value": "False"}, "float": {"job_input_type": "literal", "value": "0.02"}, "integer": {"job_input_type": "literal", "value": "1"}, "string": {"job_input_type": "literal", "value": "str"}, - "uri_file": {"job_input_type": "uri_file", "mode": "Download", "uri": "https://my-blob/path/to/data"}, + "uri_file": { + "job_input_type": "uri_file", + "mode": "Download", + "uri": "https://my-blob/path/to/data", + }, "uri_folder": { "job_input_type": "uri_folder", "mode": "ReadOnlyMount", @@ -317,7 +392,12 @@ def test_command_function_default_values(self, test_command): }, }, "limits": {"job_limits_type": "Command", "timeout": "PT10S"}, - "outputs": {"my_model": {"job_output_type": "mlflow_model", "mode": "ReadWriteMount"}}, + "outputs": { + "my_model": { + "job_output_type": "mlflow_model", + "mode": "ReadWriteMount", + } + }, } # node3 copies node2's property assert node3_dict == expected_dict @@ -336,7 +416,7 @@ def test_set_limits(self, test_command): nodes = [node1, node2, node3] for node in nodes: node.set_limits(timeout=10) - expected_limits = {"job_limits_type": "Command", "timeout": "PT10S"} + expected_limits = {"jobLimitsType": "Command", "timeout": "PT10S"} actual_limits = node1.limits._to_rest_object().as_dict() assert actual_limits == expected_limits @@ -352,10 +432,17 @@ def test_command_with_artifact_inputs(self, command_with_artifact_inputs): "type": "command", "computeId": "cpu-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "inputs": { - "uri_file": {"job_input_type": "uri_file", "mode": "Download", "uri": "https://my-blob/path/to/data"}, + "uri_file": { + "job_input_type": "uri_file", + "mode": "Download", + "uri": "https://my-blob/path/to/data", + }, "uri_folder": { "job_input_type": "uri_folder", "mode": "ReadOnlyMount", @@ -379,14 +466,26 @@ def test_command_with_artifact_inputs(self, command_with_artifact_inputs): "_source": "BUILDER", "description": "This is a fancy job", "code": parse_local_path("./tests"), - "command": "python train.py --input-data " "${{inputs.uri_folder}} --lr " "${{inputs.float}}", + "command": "python train.py --input-data " + "${{inputs.uri_folder}} --lr " + "${{inputs.float}}", "display_name": "my-fancy-job", "distribution": {"process_count_per_instance": 4, "type": "mpi"}, "environment": "azureml:my-env:1", "inputs": { "boolean": {"default": "False", "type": "boolean"}, - "float": {"default": "1.1", "max": "5.0", "min": "0.0", "type": "number"}, - "integer": {"default": "2", "max": "4", "min": "-1", "type": "integer"}, + "float": { + "default": "1.1", + "max": "5.0", + "min": "0.0", + "type": "number", + }, + "integer": { + "default": "2", + "max": "4", + "min": "-1", + "type": "integer", + }, "string": {"default": "default_str", "type": "string"}, "uri_file": {"type": "uri_file", "mode": "download"}, "uri_folder": {"type": "uri_folder", "mode": "ro_mount"}, @@ -452,7 +551,9 @@ def test_set_resources(self, test_command): def test_inputs_binding(self, test_command): node1 = test_command() node2 = test_command() - node3 = test_command(uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model) + node3 = test_command( + uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model + ) node1.name = "new_name1" node2.name = "new_name2" @@ -465,13 +566,23 @@ def test_inputs_binding(self, test_command): "float": 0.01, "integer": 1, "string": "str", - "uri_file": Input(path="${{parent.jobs.new_name1.outputs.my_model}}", type="uri_folder", mode=None), - "uri_folder": Input(path="${{parent.jobs.new_name2.outputs.my_model}}", type="uri_folder", mode=None), + "uri_file": Input( + path="${{parent.jobs.new_name1.outputs.my_model}}", + type="uri_folder", + mode=None, + ), + "uri_folder": Input( + path="${{parent.jobs.new_name2.outputs.my_model}}", + type="uri_folder", + mode=None, + ), } node1 = test_command() node2 = node1() - node3 = node2(uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model) + node3 = node2( + uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model + ) node1.name = "new_node1" node2.name = "new_node2" @@ -483,8 +594,16 @@ def test_inputs_binding(self, test_command): "float": 0.01, "integer": 1, "string": "str", - "uri_file": Input(path="${{parent.jobs.new_node1.outputs.my_model}}", type="uri_folder", mode=None), - "uri_folder": Input(path="${{parent.jobs.new_node2.outputs.my_model}}", type="uri_folder", mode=None), + "uri_file": Input( + path="${{parent.jobs.new_node1.outputs.my_model}}", + type="uri_folder", + mode=None, + ), + "uri_folder": Input( + path="${{parent.jobs.new_node2.outputs.my_model}}", + type="uri_folder", + mode=None, + ), } node4 = node3() @@ -499,8 +618,16 @@ def test_inputs_binding(self, test_command): "float": 0.01, "integer": 1, "string": "str", - "uri_file": Input(path="${{parent.jobs.new_node2.outputs.my_model}}", type="uri_folder", mode=None), - "uri_folder": Input(path="${{parent.jobs.new_node2.outputs.my_model}}", type="uri_folder", mode=None), + "uri_file": Input( + path="${{parent.jobs.new_node2.outputs.my_model}}", + type="uri_folder", + mode=None, + ), + "uri_folder": Input( + path="${{parent.jobs.new_node2.outputs.my_model}}", + type="uri_folder", + mode=None, + ), } def test_copy_distribution_resources(self, test_command): @@ -517,7 +644,12 @@ def test_copy_distribution_resources(self, test_command): node4 = node3() # node2 and node1 has different distribution object with same value - attrs_to_check = ["distribution", "limits", "resources", "environment_variables"] + attrs_to_check = [ + "distribution", + "limits", + "resources", + "environment_variables", + ] for attr in attrs_to_check: attr1 = getattr(node1, attr) attr2 = getattr(node2, attr) @@ -541,7 +673,9 @@ def test_invalid_command_params(self, test_command_params): assert re.match(pattern, str(e.value)), str(e.value) def test_command_unprovided_inputs_outputs(self, test_command_params): - test_command_params.update({"inputs": None, "outputs": None, "command": "echo hello"}) + test_command_params.update( + {"inputs": None, "outputs": None, "command": "echo hello"} + ) node1 = command(**test_command_params) actual_component = pydash.omit( @@ -580,7 +714,10 @@ def test_command_unprovided_inputs_outputs(self, test_command_params): "_source": "BUILDER", "computeId": "cpu-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "name": "my_job", "type": "command", @@ -594,17 +731,26 @@ def test_distribution_from_dict(self, test_command): node1.distribution = {"type": "Pytorch", "process_count_per_instance": 4} assert isinstance(node1.distribution, PyTorchDistribution) rest_dist = node1._to_rest_object()["distribution"] - assert rest_dist == {"distribution_type": "PyTorch", "process_count_per_instance": 4} + assert rest_dist == { + "distribution_type": "PyTorch", + "process_count_per_instance": 4, + } node1.distribution = {"type": "TensorFlow", "parameter_server_count": 1} assert isinstance(node1.distribution, TensorFlowDistribution) rest_dist = node1._to_rest_object()["distribution"] - assert rest_dist == {"distribution_type": "TensorFlow", "parameter_server_count": 1} + assert rest_dist == { + "distribution_type": "TensorFlow", + "parameter_server_count": 1, + } node1.distribution = {"type": "mpi", "process_count_per_instance": 1} assert isinstance(node1.distribution, MpiDistribution) rest_dist = node1._to_rest_object()["distribution"] - assert rest_dist == {"distribution_type": "Mpi", "process_count_per_instance": 1} + assert rest_dist == { + "distribution_type": "Mpi", + "process_count_per_instance": 1, + } node1.distribution = { "type": "ray", @@ -639,7 +785,10 @@ def test_docker_args_in_resources_val(self, test_command_params): { "distribution": MpiDistribution(process_count_per_instance=2), "resources": JobResourceConfiguration( - instance_count=2, instance_type="STANDARD_D2", docker_args="test command", shm_size="3g" + instance_count=2, + instance_type="STANDARD_D2", + docker_args="test command", + shm_size="3g", ), } ) @@ -651,7 +800,10 @@ def test_docker_args_in_resources_val(self, test_command_params): node1.resources.instance_count = 4 rest_dict = node1._to_rest_object() - assert rest_dict["distribution"] == {"distribution_type": "Mpi", "process_count_per_instance": 4} + assert rest_dict["distribution"] == { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + } assert rest_dict["resources"] == { "instance_count": 4, "instance_type": "STANDARD_D2", @@ -663,7 +815,9 @@ def test_distribution_resources_default_val(self, test_command_params): test_command_params.update( { "distribution": MpiDistribution(process_count_per_instance=2), - "resources": JobResourceConfiguration(instance_count=2, instance_type="STANDARD_D2"), + "resources": JobResourceConfiguration( + instance_count=2, instance_type="STANDARD_D2" + ), } ) command_func = command(**test_command_params) @@ -674,14 +828,22 @@ def test_distribution_resources_default_val(self, test_command_params): node1.resources.instance_count = 4 rest_dict = node1._to_rest_object() - assert rest_dict["distribution"] == {"distribution_type": "Mpi", "process_count_per_instance": 4} - assert rest_dict["resources"] == {"instance_count": 4, "instance_type": "STANDARD_D2"} + assert rest_dict["distribution"] == { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + } + assert rest_dict["resources"] == { + "instance_count": 4, + "instance_type": "STANDARD_D2", + } def test_resources_from_dict(self, test_command_params): expected_resources = {"instance_count": 4, "instance_type": "STANDARD_D2"} test_command_params.update( { - "resources": JobResourceConfiguration(instance_count=4, instance_type="STANDARD_D2"), + "resources": JobResourceConfiguration( + instance_count=4, instance_type="STANDARD_D2" + ), } ) command_node = command(**test_command_params) @@ -699,7 +861,9 @@ def test_resources_from_dict(self, test_command_params): test_command_params.update( { - "resources": dict(instance_count=4, instance_type="STANDARD_D2", unknown_field=1), + "resources": dict( + instance_count=4, instance_type="STANDARD_D2", unknown_field=1 + ), } ) command_node = command(**test_command_params) @@ -753,16 +917,19 @@ def test_to_component_input(self): "str": {"default": "str", "type": "string"}, } for job_input, input_type in literal_input_2_expected_type.items(): - assert ComponentTranslatableMixin._to_input(job_input, {})._to_dict() == input_type + assert ( + ComponentTranslatableMixin._to_input(job_input, {})._to_dict() + == input_type + ) with pytest.raises(JobException) as err_info: ComponentTranslatableMixin._to_input(None, {}) - assert "'' is not supported as component input" in str(err_info.value) + assert "'' is not supported as component input" in str( + err_info.value + ) # test input binding - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" job_dict = load_job(source=test_path)._to_dict() binding_2_expected_type = { "${{parent.inputs.job_data}}": {"type": "uri_folder"}, @@ -771,18 +938,27 @@ def test_to_component_input(self): } for job_input, input_type in binding_2_expected_type.items(): - assert ComponentTranslatableMixin._to_input(job_input, job_dict)._to_dict() == input_type + assert ( + ComponentTranslatableMixin._to_input(job_input, job_dict)._to_dict() + == input_type + ) def test_to_component_output(self): # test output binding test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_with_parallel_job_tabular_input_e2e.yml" job_dict = load_job(source=test_path)._to_dict() binding_2_expected_type = { - "${{parent.outputs.job_out_file}}": {"type": "uri_file", "mode": "rw_mount"}, + "${{parent.outputs.job_out_file}}": { + "type": "uri_file", + "mode": "rw_mount", + }, } for job_output, input_type in binding_2_expected_type.items(): - assert ComponentTranslatableMixin._to_output(job_output, job_dict)._to_dict() == input_type + assert ( + ComponentTranslatableMixin._to_output(job_output, job_dict)._to_dict() + == input_type + ) def test_spark_job_with_dynamic_allocation_disabled(self): node = spark( @@ -799,7 +975,9 @@ def test_spark_job_with_dynamic_allocation_disabled(self): ) result = node._validate() message = "Should not specify min or max executors when dynamic allocation is disabled." - assert "conf" in result.error_messages and message == result.error_messages["conf"] + assert ( + "conf" in result.error_messages and message == result.error_messages["conf"] + ) def test_executor_instances_is_mandatory_when_dynamic_allocation_disabled(self): node = spark( @@ -816,7 +994,9 @@ def test_executor_instances_is_mandatory_when_dynamic_allocation_disabled(self): "spark.driver.cores, spark.driver.memory, spark.executor.cores, spark.executor.memory and " "spark.executor.instances are mandatory fields." ) - assert "conf" in result.error_messages and message == result.error_messages["conf"] + assert ( + "conf" in result.error_messages and message == result.error_messages["conf"] + ) def test_executor_instances_is_specified_as_min_executor_if_unset(self): node = spark( @@ -853,7 +1033,9 @@ def test_excutor_instances_throw_error_when_out_of_range(self): "Executor instances must be a valid non-negative integer and must be between " "spark.dynamicAllocation.minExecutors and spark.dynamicAllocation.maxExecutors" ) - assert "conf" in result.error_messages and message == result.error_messages["conf"] + assert ( + "conf" in result.error_messages and message == result.error_messages["conf"] + ) def test_spark_job_with_additional_conf(self): node = spark( @@ -903,10 +1085,14 @@ def test_command_services_nodes(self) -> None: ) rest_obj = command_obj._to_rest_object() - assert rest_obj["services"]["my_jupyterlab"].get("nodes") == {"nodes_value_type": "All"} + assert rest_obj["services"]["my_jupyterlab"].get("nodes") == { + "nodes_value_type": "All" + } assert rest_obj["services"]["my_tensorboard"].get("nodes") == None - with pytest.raises(ValidationException, match="nodes should be either 'all' or None"): + with pytest.raises( + ValidationException, match="nodes should be either 'all' or None" + ): services_invalid_nodes = {"my_service": JobService(nodes="All")} def test_command_services(self) -> None: @@ -963,7 +1149,10 @@ def test_command_services(self) -> None: assert node invalid_services_1 = {"my_service": 3} - with pytest.raises(ValidationException, match="Service value for key 'my_service' must be a dict"): + with pytest.raises( + ValidationException, + match="Service value for key 'my_service' must be a dict", + ): node = command( name="interactive-command-job", description="description", @@ -1021,8 +1210,12 @@ def test_command_services_subtypes(self) -> None: command_job_services = node._to_job().services assert isinstance(command_job_services.get("my_ssh"), SshJobService) - assert isinstance(command_job_services.get("my_tensorboard"), TensorBoardJobService) - assert isinstance(command_job_services.get("my_jupyterlab"), JupyterLabJobService) + assert isinstance( + command_job_services.get("my_tensorboard"), TensorBoardJobService + ) + assert isinstance( + command_job_services.get("my_jupyterlab"), JupyterLabJobService + ) assert isinstance(command_job_services.get("my_vscode"), VsCodeJobService) node_rest_obj = node._to_rest_object() @@ -1034,7 +1227,9 @@ def test_command_hash(self, test_command_params): assert hash(node1) == hash(node2) assert node1 == node2 - component_func = load_component("./tests/test_configs/components/helloworld_component_no_paths.yml") + component_func = load_component( + "./tests/test_configs/components/helloworld_component_no_paths.yml" + ) node3 = component_func() node4 = component_func() assert hash(node3) == hash(node4) @@ -1055,13 +1250,18 @@ def my_pipeline(): pipeline_job = my_pipeline() omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields) + actual_dict = omit_with_wildcard( + pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields + ) assert actual_dict["jobs"] == { "my_job": { "computeId": "cpu-cluster", "display_name": "my-fancy-job", - "distribution": {"distribution_type": "Mpi", "process_count_per_instance": 4}, + "distribution": { + "distribution_type": "Mpi", + "process_count_per_instance": 4, + }, "environment_variables": {"foo": "bar"}, "identity": {"identity_type": "UserIdentity"}, "inputs": { @@ -1081,7 +1281,12 @@ def my_pipeline(): }, }, "name": "my_job", - "outputs": {"my_model": {"job_output_type": "mlflow_model", "mode": "ReadWriteMount"}}, + "outputs": { + "my_model": { + "job_output_type": "mlflow_model", + "mode": "ReadWriteMount", + } + }, "type": "command", } } @@ -1106,7 +1311,9 @@ def test_sweep_set_search_space(self, test_command): goal="maximize", sampling_algorithm="random", ) - sweep_node_1.search_space = {"batch_size": {"type": "choice", "values": [25, 35]}} + sweep_node_1.search_space = { + "batch_size": {"type": "choice", "values": [25, 35]} + } command_node_to_sweep_2 = node1() sweep_node_2 = command_node_to_sweep_2.sweep( diff --git a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py index 5648183d996a..4780fa1196ca 100644 --- a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py +++ b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py @@ -6,9 +6,17 @@ from azure.ai.ml.entities._assets import Code from azure.ai.ml.entities._builders.command_func import command from azure.ai.ml.entities._inputs_outputs import Input, Output -from azure.ai.ml.entities._job.distribution import MpiDistribution, PyTorchDistribution, TensorFlowDistribution -from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration -from azure.ai.ml.entities._job.sweep.early_termination_policy import TruncationSelectionPolicy +from azure.ai.ml.entities._job.distribution import ( + MpiDistribution, + PyTorchDistribution, + TensorFlowDistribution, +) +from azure.ai.ml.entities._job.job_resource_configuration import ( + JobResourceConfiguration, +) +from azure.ai.ml.entities._job.sweep.early_termination_policy import ( + TruncationSelectionPolicy, +) from azure.ai.ml.entities._job.sweep.objective import Objective from azure.ai.ml.entities._job.sweep.search_space import LogUniform from azure.ai.ml.sweep import ( @@ -40,8 +48,16 @@ def test_sweep_job_top_level_properties(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, - inputs={"input1": {"path": "top_level.csv", "type": "uri_file", "mode": "ro_mount"}}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, + inputs={ + "input1": { + "path": "top_level.csv", + "type": "uri_file", + "mode": "ro_mount", + } + }, compute="top_level", limits=SweepJobLimits(trial_timeout=600), identity=UserIdentityConfiguration(), @@ -71,7 +87,9 @@ def test_sweep_job_override_missing_properties(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, inputs=None, ) rest = sweep._to_rest_object() @@ -107,14 +125,19 @@ def test_sampling_algorithm_to_rest(self, sampling_algorithm, expected_rest_type sweep = SweepJob( sampling_algorithm=sampling_algorithm, trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, inputs={"input1": {"file": "top_level.csv", "mode": "ro_mount"}}, compute="top_level", limits=SweepJobLimits(trial_timeout=600), ) rest = sweep._to_rest_object() - assert rest.properties.sampling_algorithm.sampling_algorithm_type == expected_rest_type + assert ( + rest.properties.sampling_algorithm.sampling_algorithm_type + == expected_rest_type + ) @pytest.mark.parametrize( "sampling_algorithm, expected_from_rest_type", @@ -127,7 +150,9 @@ def test_sampling_algorithm_to_rest(self, sampling_algorithm, expected_rest_type (BayesianSamplingAlgorithm(), "bayesian"), ], ) - def test_sampling_algorithm_from_rest(self, sampling_algorithm, expected_from_rest_type): + def test_sampling_algorithm_from_rest( + self, sampling_algorithm, expected_from_rest_type + ): command_job = CommandJob( code=Code(base_path="./src"), command="python train.py --ss {search_space.ss}", @@ -141,7 +166,9 @@ def test_sampling_algorithm_from_rest(self, sampling_algorithm, expected_from_re sweep = SweepJob( sampling_algorithm=sampling_algorithm, trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, inputs={"input1": Input(path="trial.csv")}, compute="top_level", limits=SweepJobLimits(trial_timeout=600), @@ -153,7 +180,13 @@ def test_sampling_algorithm_from_rest(self, sampling_algorithm, expected_from_re @pytest.mark.parametrize( "properties_dict", - [{}, {"seed": 999}, {"rule": "sobol"}, {"logbase": "e"}, {"seed": 999, "rule": "sobol", "logbase": "e"}], + [ + {}, + {"seed": 999}, + {"rule": "sobol"}, + {"logbase": "e"}, + {"seed": 999, "rule": "sobol", "logbase": "e"}, + ], ) def test_random_sampling_object_with_props(self, properties_dict): command_job = CommandJob( @@ -174,7 +207,9 @@ def test_random_sampling_object_with_props(self, properties_dict): sweep = SweepJob( sampling_algorithm=random_sampling_algorithm, trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, inputs={"input1": Input(path="trial.csv")}, compute="top_level", limits=SweepJobLimits(trial_timeout=600), @@ -184,7 +219,9 @@ def test_random_sampling_object_with_props(self, properties_dict): assert rest.properties.sampling_algorithm.sampling_algorithm_type == "Random" assert rest.properties.sampling_algorithm.seed == expected_seed assert rest.properties.sampling_algorithm.rule == expected_rule - assert rest.properties.sampling_algorithm.logbase == expected_logbase + # ``logbase`` is not modeled on the shared arm_ml_service RandomSamplingAlgorithm; it is + # preserved as an unknown wire key on the hybrid model, so read it from the mapping. + assert rest.properties.sampling_algorithm.get("logbase") == expected_logbase sweep: SweepJob = Job._from_rest_object(rest) assert sweep.sampling_algorithm.type == "random" @@ -195,7 +232,8 @@ def test_random_sampling_object_with_props(self, properties_dict): def test_sweep_job_builder_serialization(self) -> None: inputs = { "uri": Input( - type=AssetTypes.URI_FILE, path="azureml://datastores/workspaceblobstore/paths/python/data.csv" + type=AssetTypes.URI_FILE, + path="azureml://datastores/workspaceblobstore/paths/python/data.csv", ), "lr": LogUniform(min_value=0.001, max_value=0.1), } @@ -247,7 +285,9 @@ def test_sweep_job_builder_serialization(self) -> None: command="echo ${{inputs.uri}} ${{search_space.lr}} ${{search_space.lr2}}", distribution=MpiDistribution(), environment_variables={"EVN1": "VAR1"}, - resources=JobResourceConfiguration(instance_count=2, instance_type="STANDARD_BLA"), + resources=JobResourceConfiguration( + instance_count=2, instance_type="STANDARD_BLA" + ), code="./", ) @@ -262,14 +302,20 @@ def test_sweep_job_builder_serialization(self) -> None: tags={"tag1": "value1"}, properties={"prop1": "value1"}, objective=Objective(goal="maximize", primary_metric="accuracy"), - limits=SweepJobLimits(max_concurrent_trials=10, max_total_trials=100, timeout=300, trial_timeout=60), + limits=SweepJobLimits( + max_concurrent_trials=10, + max_total_trials=100, + timeout=300, + trial_timeout=60, + ), sampling_algorithm="random", early_termination=TruncationSelectionPolicy( evaluation_interval=100, delay_evaluation=200, truncation_percentage=40 ), inputs={ "uri": Input( - type=AssetTypes.URI_FILE, path="azureml://datastores/workspaceblobstore/paths/python/data.csv" + type=AssetTypes.URI_FILE, + path="azureml://datastores/workspaceblobstore/paths/python/data.csv", ) }, outputs={"best_model": {}}, @@ -305,15 +351,27 @@ def test_sweep_job_trial_distribution_to_rest(self, distribution) -> None: sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, - inputs={"input1": {"path": "top_level.csv", "type": "uri_file", "mode": "ro_mount"}}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, + inputs={ + "input1": { + "path": "top_level.csv", + "type": "uri_file", + "mode": "ro_mount", + } + }, compute="top_level", limits=SweepJobLimits(trial_timeout=600), identity=UserIdentityConfiguration(), ) rest_obj = sweep._to_rest_object() - rest_obj.properties.trial.distribution == distribution._to_rest_object() if distribution else None + ( + rest_obj.properties.trial.distribution == distribution._to_rest_object() + if distribution + else None + ) # validate from rest scenario sweep_job: SweepJob = Job._from_rest_object(rest_obj) @@ -346,8 +404,16 @@ def test_sweep_job_resources_to_rest(self, resources) -> None: sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, - inputs={"input1": {"path": "top_level.csv", "type": "uri_file", "mode": "ro_mount"}}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, + inputs={ + "input1": { + "path": "top_level.csv", + "type": "uri_file", + "mode": "ro_mount", + } + }, compute="top_level", limits=SweepJobLimits(trial_timeout=600), identity=UserIdentityConfiguration(), @@ -355,7 +421,11 @@ def test_sweep_job_resources_to_rest(self, resources) -> None: ) rest_obj = sweep._to_rest_object() - rest_obj.properties.resources == resources._to_rest_object() if resources else None + ( + rest_obj.properties.get("resources") == resources._to_rest_object() + if resources + else None + ) # validate from rest scenario sweep_job: SweepJob = Job._from_rest_object(rest_obj) @@ -366,6 +436,12 @@ def test_sweep_job_resources_to_rest(self, resources) -> None: assert sweep_job.identity == sweep.identity if sweep_job.resources: if "instance_type" in sweep.resources: - assert sweep_job.resources.instance_type == sweep.resources["instance_type"] + assert ( + sweep_job.resources.instance_type + == sweep.resources["instance_type"] + ) if "instance_count" in sweep.resources: - assert sweep_job.resources.instance_count == sweep.resources["instance_count"] + assert ( + sweep_job.resources.instance_count + == sweep.resources["instance_count"] + ) diff --git a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py index b2fa04ff2a85..855ad24c4ee2 100644 --- a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py @@ -6,14 +6,28 @@ import yaml from azure.ai.ml import load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models import AmlToken as RestAmlToken -from azure.ai.ml._restclient.v2023_04_01_preview.models import InputDeliveryMode, JobInputType, JobOutputType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedIdentity as RestManagedIdentity +from azure.ai.ml._restclient.arm_ml_service.models import AmlToken as RestAmlToken +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + InputDeliveryMode, + JobInputType, + JobOutputType, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + ManagedIdentity as RestManagedIdentity, +) from azure.ai.ml._restclient.v2023_04_01_preview.models import OutputDeliveryMode -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFolderJobOutput as RestUriFolderJobOutput -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + UriFolderJobOutput as RestUriFolderJobOutput, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + UserIdentity as RestUserIdentity, +) from azure.ai.ml._schema import SweepJobSchema -from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, AssetTypes, InputOutputModes +from azure.ai.ml.constants._common import ( + BASE_PATH_CONTEXT_KEY, + AssetTypes, + InputOutputModes, +) from azure.ai.ml.entities import ( AmlTokenConfiguration, CommandJob, @@ -21,7 +35,9 @@ ManagedIdentityConfiguration, UserIdentityConfiguration, ) -from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration +from azure.ai.ml.entities._job.job_resource_configuration import ( + JobResourceConfiguration, +) from azure.ai.ml.entities._inputs_outputs import Input from azure.ai.ml.entities._job.sweep.search_space import SweepDistribution from azure.ai.ml.entities._job.to_rest_functions import to_rest_job_object @@ -68,7 +84,11 @@ def test_search_space_to_rest(self, search_space: SweepDistribution, expected): environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", ) - sweep = SweepJob(sampling_algorithm="random", trial=command_job, search_space={"ss": search_space}) + sweep = SweepJob( + sampling_algorithm="random", + trial=command_job, + search_space={"ss": search_space}, + ) rest = sweep._to_rest_object() assert rest.properties.search_space == {"ss": expected} @@ -88,7 +108,9 @@ def test_search_space_to_rest(self, search_space: SweepDistribution, expected): (QLogUniform(1.0, 10.0, 3), ["qloguniform", [1.0, 10.0, 3]]), ], ) - def test_search_space_from_rest(self, expected: SweepDistribution, rest_search_space): + def test_search_space_from_rest( + self, expected: SweepDistribution, rest_search_space + ): command_job = CommandJob( code="./src", command="python train.py --ss {search_space.ss}", @@ -96,7 +118,11 @@ def test_search_space_from_rest(self, expected: SweepDistribution, rest_search_s compute="local", environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", ) - sweep = SweepJob(sampling_algorithm="random", trial=command_job, search_space={"ss": Choice([1.0, 2.0, 3.0])}) + sweep = SweepJob( + sampling_algorithm="random", + trial=command_job, + search_space={"ss": Choice([1.0, 2.0, 3.0])}, + ) rest = sweep._to_rest_object() rest.properties.search_space = {"ss": rest_search_space} @@ -114,7 +140,9 @@ def test_search_space_from_rest(self, expected: SweepDistribution, rest_search_s (JobResourceConfiguration(instance_count=2), {"instance_count": 2}), ], ) - def test_resources_from_rest(self, expected_resources: JobResourceConfiguration, rest_resources): + def test_resources_from_rest( + self, expected_resources: JobResourceConfiguration, rest_resources + ): command_job = CommandJob( code="./src", command="python train.py --ss {search_space.ss}", @@ -130,7 +158,7 @@ def test_resources_from_rest(self, expected_resources: JobResourceConfiguration, ) rest = sweep._to_rest_object() - rest.properties.resources = rest_resources + rest.properties["resources"] = rest_resources sweep: SweepJob = Job._from_rest_object(rest) assert sweep.resources == expected_resources @@ -145,7 +173,9 @@ def test_resources_from_rest(self, expected_resources: JobResourceConfiguration, (JobResourceConfiguration(instance_count=2), {"instance_count": 2}), ], ) - def test_resources_to_rest(self, rest_resources: JobResourceConfiguration, expected_resources): + def test_resources_to_rest( + self, rest_resources: JobResourceConfiguration, expected_resources + ): command_job = CommandJob( code="./src", command="python train.py --lr 0.01", @@ -162,11 +192,18 @@ def test_resources_to_rest(self, rest_resources: JobResourceConfiguration, expec ) rest = sweep._to_rest_object() - if rest.properties.resources: + rest_resources_obj = rest.properties.get("resources") + if rest_resources_obj: if "instance_count" in expected_resources: - assert rest.properties.resources.instance_count == expected_resources["instance_count"] + assert ( + rest_resources_obj.instance_count + == expected_resources["instance_count"] + ) if "instance_type" in expected_resources: - assert rest.properties.resources.instance_type == expected_resources["instance_type"] + assert ( + rest_resources_obj.instance_type + == expected_resources["instance_type"] + ) def test_sweep_with_ints(self): expected_rest = ["quniform", [1, 100, 1]] @@ -182,7 +219,9 @@ def test_sweep_with_ints(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": QUniform(type="quniform", min_value=1, max_value=100, q=1)}, + search_space={ + "ss": QUniform(type="quniform", min_value=1, max_value=100, q=1) + }, ) rest = sweep._to_rest_object() sweep: SweepJob = Job._from_rest_object(rest) @@ -194,7 +233,12 @@ def test_sweep_with_ints(self): def test_sweep_with_floats(self): expected_rest = ["quniform", [1.1, 100.12, 1]] - expected_ss = {"type": "quniform", "min_value": 1.1, "max_value": 100.12, "q": 1} + expected_ss = { + "type": "quniform", + "min_value": 1.1, + "max_value": 100.12, + "q": 1, + } command_job = CommandJob( code="./src", @@ -206,7 +250,9 @@ def test_sweep_with_floats(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": QUniform(type="quniform", min_value=1.1, max_value=100.12, q=1)}, + search_space={ + "ss": QUniform(type="quniform", min_value=1.1, max_value=100.12, q=1) + }, ) rest = sweep._to_rest_object() sweep: SweepJob = Job._from_rest_object(rest) @@ -239,53 +285,100 @@ def test_sweep_with_string(self): assert vars(sweep.search_space["ss"]) == expected_ss def test_inputs_types_sweep_job(self): - original_entity = load_job(Path("./tests/test_configs/sweep_job/sweep_job_input_types.yml")) + original_entity = load_job( + Path("./tests/test_configs/sweep_job/sweep_job_input_types.yml") + ) rest_representation = to_rest_job_object(original_entity) reconstructed_entity = Job._from_rest_object(rest_representation) assert original_entity.inputs["test_dataset"].mode is None - assert rest_representation.properties.inputs["test_dataset"].job_input_type == JobInputType.URI_FOLDER + assert ( + rest_representation.properties.inputs["test_dataset"].job_input_type + == JobInputType.URI_FOLDER + ) assert rest_representation.properties.inputs["test_dataset"].mode is None assert reconstructed_entity.inputs["test_dataset"].mode is None assert original_entity.inputs["test_url"].mode == InputOutputModes.RO_MOUNT assert original_entity.inputs["test_url"].type == AssetTypes.URI_FILE assert original_entity.inputs["test_url"].path == "azureml://fake/url.json" - assert rest_representation.properties.inputs["test_url"].job_input_type == JobInputType.URI_FILE - assert rest_representation.properties.inputs["test_url"].mode == InputDeliveryMode.READ_ONLY_MOUNT - assert rest_representation.properties.inputs["test_url"].uri == "azureml://fake/url.json" + assert ( + rest_representation.properties.inputs["test_url"].job_input_type + == JobInputType.URI_FILE + ) + assert ( + rest_representation.properties.inputs["test_url"].mode + == InputDeliveryMode.READ_ONLY_MOUNT + ) + assert ( + rest_representation.properties.inputs["test_url"].uri + == "azureml://fake/url.json" + ) assert reconstructed_entity.inputs["test_url"].mode == InputOutputModes.RO_MOUNT assert reconstructed_entity.inputs["test_url"].type == AssetTypes.URI_FILE assert reconstructed_entity.inputs["test_url"].path == "azureml://fake/url.json" assert original_entity.inputs["test_string_literal"] == "literal string" - assert rest_representation.properties.inputs["test_string_literal"].job_input_type == JobInputType.LITERAL - assert rest_representation.properties.inputs["test_string_literal"].value == "literal string" + assert ( + rest_representation.properties.inputs["test_string_literal"].job_input_type + == JobInputType.LITERAL + ) + assert ( + rest_representation.properties.inputs["test_string_literal"].value + == "literal string" + ) assert reconstructed_entity.inputs["test_string_literal"] == "literal string" assert original_entity.inputs["test_literal_valued_int"] == 42 - assert rest_representation.properties.inputs["test_literal_valued_int"].job_input_type == JobInputType.LITERAL - assert rest_representation.properties.inputs["test_literal_valued_int"].value == "42" + assert ( + rest_representation.properties.inputs[ + "test_literal_valued_int" + ].job_input_type + == JobInputType.LITERAL + ) + assert ( + rest_representation.properties.inputs["test_literal_valued_int"].value + == "42" + ) assert reconstructed_entity.inputs["test_literal_valued_int"] == "42" def test_outputs_types_standalone_jobs(self): - original_entity = load_job(Path("./tests/test_configs/sweep_job/sweep_job_output_types.yml")) + original_entity = load_job( + Path("./tests/test_configs/sweep_job/sweep_job_output_types.yml") + ) rest_representation = to_rest_job_object(original_entity) - dummy_default = RestUriFolderJobOutput(uri="azureml://foo", mode=OutputDeliveryMode.READ_WRITE_MOUNT) + dummy_default = RestUriFolderJobOutput( + uri="azureml://foo", mode=OutputDeliveryMode.READ_WRITE_MOUNT + ) rest_representation.properties.outputs["default"] = dummy_default reconstructed_entity = Job._from_rest_object(rest_representation) assert original_entity.outputs["test1"] is None - assert rest_representation.properties.outputs["test1"].job_output_type == JobOutputType.URI_FOLDER + assert ( + rest_representation.properties.outputs["test1"].job_output_type + == JobOutputType.URI_FOLDER + ) assert rest_representation.properties.outputs["test1"].mode is None assert original_entity.outputs["test2"].mode == InputOutputModes.UPLOAD - assert rest_representation.properties.outputs["test2"].job_output_type == JobOutputType.URI_FOLDER - assert rest_representation.properties.outputs["test2"].mode == OutputDeliveryMode.UPLOAD + assert ( + rest_representation.properties.outputs["test2"].job_output_type + == JobOutputType.URI_FOLDER + ) + assert ( + rest_representation.properties.outputs["test2"].mode + == OutputDeliveryMode.UPLOAD + ) assert original_entity.outputs["test3"].mode == InputOutputModes.RW_MOUNT - assert rest_representation.properties.outputs["test3"].job_output_type == JobOutputType.URI_FOLDER - assert rest_representation.properties.outputs["test3"].mode == OutputDeliveryMode.READ_WRITE_MOUNT + assert ( + rest_representation.properties.outputs["test3"].job_output_type + == JobOutputType.URI_FOLDER + ) + assert ( + rest_representation.properties.outputs["test3"].mode + == OutputDeliveryMode.READ_WRITE_MOUNT + ) assert reconstructed_entity.outputs["default"].path == "azureml://foo" def test_sweep_with_dicts(self): @@ -302,7 +395,9 @@ def test_sweep_with_dicts(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, + search_space={ + "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) + }, ) rest = sweep._to_rest_object() sweep: SweepJob = Job._from_rest_object(rest) @@ -330,10 +425,15 @@ def test_sweep_termination_roundtrip(self): rest_intermediate = internal_representation._to_rest_object() internal_obj = SweepJob._from_rest_object(rest_intermediate) reconstructed_yaml = schema.dump(internal_obj) - assert reconstructed_yaml["early_termination"]["type"] == cfg["early_termination"]["type"] + assert ( + reconstructed_yaml["early_termination"]["type"] + == cfg["early_termination"]["type"] + ) def test_sweep_search_space_environment_variables(self): - sweep: SweepJob = load_job(Path("./tests/test_configs/sweep_job/sweep-search.yaml")) + sweep: SweepJob = load_job( + Path("./tests/test_configs/sweep_job/sweep-search.yaml") + ) # This is to guard against using mutable values as default for constructor args assert sweep.search_space["dropout_rate"] != sweep.search_space["dropout_rate2"] @@ -343,20 +443,26 @@ def test_sweep_search_space_environment_variables(self): assert f"--{param} ${{{{search_space.{param}}}}}" in rest_command def test_sweep_job_recursive_search_space(self): - yaml_path = Path("./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml") + yaml_path = Path( + "./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml" + ) with open(yaml_path, "r") as f: yaml_job = yaml.safe_load(f) - job: SweepJob = load_job(Path("./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml")) + job: SweepJob = load_job( + Path("./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml") + ) rest_job = job._to_rest_object() - with open("./tests/test_configs/sweep_job/expected_recursive_search_space.json") as f: + with open( + "./tests/test_configs/sweep_job/expected_recursive_search_space.json" + ) as f: expected_recursive_search_space = json.load(f) assert rest_job.properties.search_space == expected_recursive_search_space from_rest_sweep_job = Job._from_rest_object(rest_job) - assert json.loads(json.dumps(from_rest_sweep_job._to_dict()))["search_space"] == json.loads( - json.dumps(yaml_job["search_space"]) - ) + assert json.loads(json.dumps(from_rest_sweep_job._to_dict()))[ + "search_space" + ] == json.loads(json.dumps(yaml_job["search_space"])) @pytest.mark.parametrize( "yaml_path,expected_sampling_algorithm", @@ -372,7 +478,9 @@ def test_sweep_job_recursive_search_space(self): ), ], ) - def test_sampling_algorithm_string_preservation(self, yaml_path: str, expected_sampling_algorithm: str): + def test_sampling_algorithm_string_preservation( + self, yaml_path: str, expected_sampling_algorithm: str + ): sweep_entity: SweepJob = load_job(Path(yaml_path)) assert isinstance(sweep_entity.sampling_algorithm, str) assert sweep_entity.sampling_algorithm == expected_sampling_algorithm @@ -394,7 +502,9 @@ def test_sampling_algorithm_string_preservation(self, yaml_path: str, expected_s ), ], ) - def test_sampling_algorithm_object_preservation(self, yaml_path: str, expected_sampling_algorithm: str): + def test_sampling_algorithm_object_preservation( + self, yaml_path: str, expected_sampling_algorithm: str + ): sweep_entity = load_job(Path(yaml_path)) assert isinstance(sweep_entity.sampling_algorithm, SamplingAlgorithm) assert sweep_entity.sampling_algorithm.type == expected_sampling_algorithm @@ -402,8 +512,16 @@ def test_sampling_algorithm_object_preservation(self, yaml_path: str, expected_s @pytest.mark.parametrize( "yaml_path,property_name,expected_value", [ - ("./tests/test_configs/sweep_job/sampling_algorithm_properties/sweep_job_random_seed.yml", "seed", 999), - ("./tests/test_configs/sweep_job/sampling_algorithm_properties/sweep_job_random_rule.yml", "rule", "sobol"), + ( + "./tests/test_configs/sweep_job/sampling_algorithm_properties/sweep_job_random_seed.yml", + "seed", + 999, + ), + ( + "./tests/test_configs/sweep_job/sampling_algorithm_properties/sweep_job_random_rule.yml", + "rule", + "sobol", + ), ( "./tests/test_configs/sweep_job/sampling_algorithm_properties/logbase_values/sweep_job_random_logbase_e.yml", "logbase", @@ -421,7 +539,9 @@ def test_sampling_algorithm_object_preservation(self, yaml_path: str, expected_s ), ], ) - def test_sampling_algorithm_object_properties(self, yaml_path: str, property_name: str, expected_value: Any): + def test_sampling_algorithm_object_properties( + self, yaml_path: str, property_name: str, expected_value: Any + ): sweep_entity = load_job(Path(yaml_path)) assert isinstance(sweep_entity.sampling_algorithm, SamplingAlgorithm) assert sweep_entity.sampling_algorithm.__dict__[property_name] == expected_value @@ -447,7 +567,9 @@ def test_identity_to_rest(self, identity, rest_identity): sampling_algorithm="random", trial=command_job, identity=identity, - search_space={"ss": QUniform(type="quniform", min_value=1, max_value=100, q=1)}, + search_space={ + "ss": QUniform(type="quniform", min_value=1, max_value=100, q=1) + }, ) rest = sweep._to_rest_object() From cef46503dd76610d11e7555bd8b9a8e7f5d7a07e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 15:45:19 +0530 Subject: [PATCH 014/146] migrate(sweep): Objective, sampling_algorithm, SweepJobLimits to arm_ml_service Flip the three sweep leaf models off v2023_08_01_preview onto the shared arm_ml_service hybrid models, now that the SweepJob envelope (and the arm-aware DSL node serializer) consume them. - objective.py: RestObjective -> arm. - sampling_algorithm.py: Random/Grid/Bayesian/base + SamplingAlgorithmType -> arm. arm RandomSamplingAlgorithm dropped `logbase`; preserve it as an unknown wire key on the hybrid model in _to_rest_object (set only when present) and read via _is_model/Mapping in _from_rest_object. - job_limits.py: SweepJobLimits RestSweepJobLimits -> arm (CommandJobLimits was already arm). Validated: sweep UTs (82) + sweep wire smoke + command_job UTs (108 total), full dsl + pipeline_job (490 passed, 2 skipped). Retires three more v2023_08 consumers. --- .../azure/ai/ml/entities/_job/job_limits.py | 18 ++++++++++++++---- .../ai/ml/entities/_job/sweep/objective.py | 6 ++++-- .../entities/_job/sweep/sampling_algorithm.py | 18 +++++++++++------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py index 3aede86855b8..7d3cbe74063d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py @@ -6,9 +6,17 @@ from abc import ABC from typing import Any, Optional, Union -from azure.ai.ml._restclient.arm_ml_service.models import CommandJobLimits as RestCommandJobLimits -from azure.ai.ml._restclient.v2023_08_01_preview.models import SweepJobLimits as RestSweepJobLimits -from azure.ai.ml._utils.utils import from_iso_duration_format, is_data_binding_expression, to_iso_duration_format +from azure.ai.ml._restclient.arm_ml_service.models import ( + CommandJobLimits as RestCommandJobLimits, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + SweepJobLimits as RestSweepJobLimits, +) +from azure.ai.ml._utils.utils import ( + from_iso_duration_format, + is_data_binding_expression, + to_iso_duration_format, +) from azure.ai.ml.constants import JobType from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -60,7 +68,9 @@ def _to_rest_object(self) -> RestCommandJobLimits: return RestCommandJobLimits(timeout=to_iso_duration_format(self.timeout)) @classmethod - def _from_rest_object(cls, obj: Union[RestCommandJobLimits, dict]) -> Optional["CommandJobLimits"]: + def _from_rest_object( + cls, obj: Union[RestCommandJobLimits, dict] + ) -> Optional["CommandJobLimits"]: if not obj: return None if isinstance(obj, dict): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py index 45e13332ebc8..53c45e6982aa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py @@ -3,7 +3,7 @@ # --------------------------------------------------------- from typing import Optional -from azure.ai.ml._restclient.v2023_08_01_preview.models import Objective as RestObjective +from azure.ai.ml._restclient.arm_ml_service.models import Objective as RestObjective from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -26,7 +26,9 @@ class Objective(RestTranslatableMixin): :caption: Assigning an objective to a SweepJob. """ - def __init__(self, goal: Optional[str], primary_metric: Optional[str] = None) -> None: + def __init__( + self, goal: Optional[str], primary_metric: Optional[str] = None + ) -> None: """Optimization objective. :param goal: Defines supported metric goals for hyperparameter tuning. Acceptable values diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py index 38fa02f6ffae..be85da61cdb3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py @@ -5,19 +5,19 @@ from collections.abc import Mapping from typing import Any, Optional, Union, cast -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( BayesianSamplingAlgorithm as RestBayesianSamplingAlgorithm, ) -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( GridSamplingAlgorithm as RestGridSamplingAlgorithm, ) -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( RandomSamplingAlgorithm as RestRandomSamplingAlgorithm, ) -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( SamplingAlgorithm as RestSamplingAlgorithm, ) -from azure.ai.ml._restclient.v2023_08_01_preview.models import SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -91,11 +91,15 @@ def __init__( self.logbase = logbase def _to_rest_object(self) -> RestRandomSamplingAlgorithm: - return RestRandomSamplingAlgorithm( + rest_obj = RestRandomSamplingAlgorithm( rule=self.rule, seed=self.seed, - logbase=self.logbase, ) + # ``logbase`` is not modeled on the shared arm_ml_service RandomSamplingAlgorithm; preserve it + # as an unknown wire key on the hybrid (MutableMapping) model so it round-trips to the service. + if self.logbase is not None: + rest_obj["logbase"] = self.logbase + return rest_obj @classmethod def _from_rest_object( From e274f50af944ce37a7557231fdb71b16971e4c36 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 16:35:40 +0530 Subject: [PATCH 015/146] migrate(finetuning): AzureOpenAI finetuning job + hyperparameters to arm_ml_service Flip AzureOpenAiFineTuningJob and AzureOpenAiHyperparameters off v2024_01_01_preview onto the shared arm_ml_service hybrid models, mirroring the already-arm custom_model_finetuning_job. - azure_openai_finetuning_job.py: RestFineTuningJob/AzureOpenAiFineTuning -> arm; drop the msrest _resolve_inputs/_restore_inputs overrides (the arm FineTuningVertical base already provides arm-correct versions); rewrite _to_rest_object to build the arm envelope like custom_model. - azure_openai_hyperparameters.py: RestAzureOpenAiHyperParameters -> arm so the child serializes in the arm tree (fixes Class-A smoke crash where the msrest child couldn't serialize under the hybrid SdkJSONEncoder). - test_finetuning_job_convesion.py: repoint Aoai* isinstance assertions to arm types; properties bool coerces to str "True" per arm Dict[str,str] wire contract (aligns with existing custom_model test). Validated: finetuning UTs + full smoke_serialization (184 passed, incl byte-identical aoai wire oracle). Finetuning family now fully off v2024_01 (only distillation_job.py remains on that version). --- .../finetuning/azure_openai_finetuning_job.py | 116 ++++++----- .../azure_openai_hyperparameters.py | 6 +- .../test_finetuning_job_convesion.py | 194 +++++++++++++----- 3 files changed, 208 insertions(+), 108 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py index 3cf935f9267b..66fd501f0468 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py @@ -6,21 +6,29 @@ from typing import Any, Dict -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ModelProvider as RestModelProvider, AzureOpenAiFineTuning as RestAzureOpenAIFineTuning, FineTuningJob as RestFineTuningJob, JobBase as RestJobBase, + JobOutput as RestJobOutput, + JobResourceConfiguration as RestJobResourceConfiguration, MLFlowModelJobInput, + QueueSettings as RestQueueSettings, UriFileJobInput, ) from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY -from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_hybrid_rest_model, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.finetuning.finetuning_vertical import FineTuningVertical -from azure.ai.ml.entities._job.finetuning.azure_openai_hyperparameters import AzureOpenAIHyperparameters +from azure.ai.ml.entities._job.finetuning.azure_openai_hyperparameters import ( + AzureOpenAIHyperparameters, +) from azure.ai.ml.entities._util import load_from_dict from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException from azure.ai.ml._utils._experimental import experimental @@ -43,7 +51,9 @@ def __init__( training_data = kwargs.pop("training_data", None) validation_data = kwargs.pop("validation_data", None) hyperparameters = kwargs.pop("hyperparameters", None) - if hyperparameters and not isinstance(hyperparameters, AzureOpenAIHyperparameters): + if hyperparameters and not isinstance( + hyperparameters, AzureOpenAIHyperparameters + ): raise ValidationException( category=ErrorCategory.USER_ERROR, target=ErrorTarget.JOB, @@ -80,54 +90,40 @@ def hyperparameters(self, hyperparameters: AzureOpenAIHyperparameters) -> None: """ self._hyperparameters = hyperparameters - def _resolve_inputs(self, rest_job: "RestAzureOpenAIFineTuning") -> None: - """Resolve SDK ``Input`` entities to v2024-01-01-preview msrest job-input types. - - The Azure OpenAI path keeps its own (v2024-01-01-preview) msrest envelope, so its nested - inputs must be msrest of the SAME api version for the whole tree to serialize consistently. - This overrides the shared ``FineTuningVertical._resolve_inputs``, which emits arm_ml_service - types needed only by the custom-model path (whose envelope is the shared arm hybrid client). - - :param rest_job: The Azure OpenAI fine-tuning vertical rest object. - :type rest_job: RestAzureOpenAIFineTuning - """ - if isinstance(rest_job.training_data, Input): - rest_job.training_data = UriFileJobInput(uri=rest_job.training_data.path) - if isinstance(rest_job.validation_data, Input): - rest_job.validation_data = UriFileJobInput(uri=rest_job.validation_data.path) - if isinstance(rest_job.model, Input): - rest_job.model = MLFlowModelJobInput(uri=rest_job.model.path) - - def _restore_inputs(self) -> None: - """Restore v2024-01-01-preview msrest job-inputs back to SDK ``Input`` entities. - - Mirrors :meth:`_resolve_inputs` for the read path; overrides the shared arm-typed - ``FineTuningVertical._restore_inputs`` so round-tripping an Azure OpenAI job is symmetric. - """ - if isinstance(self.training_data, UriFileJobInput): - self.training_data = Input(type=AssetTypes.URI_FILE, path=self.training_data.uri) - if isinstance(self.validation_data, UriFileJobInput): - self.validation_data = Input(type=AssetTypes.URI_FILE, path=self.validation_data.uri) - if isinstance(self.model, MLFlowModelJobInput): - self.model = Input(type=AssetTypes.MLFLOW_MODEL, path=self.model.uri) - def _to_rest_object(self) -> "RestFineTuningJob": - """Convert CustomFineTuningVertical object to a RestFineTuningJob object. + """Convert AzureOpenAIFineTuningJob object to a RestFineTuningJob object. :return: REST object representation of this object. :rtype: JobBase """ + # TSP rest models coerce SDK Input entities to dicts at construction, so + # convert to TSP JobInput types up front rather than mutating after. + model = ( + MLFlowModelJobInput(uri=self._model.path) + if isinstance(self._model, Input) + else self._model + ) + training_data = ( + UriFileJobInput(uri=self._training_data.path) + if isinstance(self._training_data, Input) + else self._training_data + ) + validation_data = ( + UriFileJobInput(uri=self._validation_data.path) + if isinstance(self._validation_data, Input) + else self._validation_data + ) aoai_finetuning_vertical = RestAzureOpenAIFineTuning( task_type=self._task, - model=self._model, + model=model, model_provider=self._model_provider, - training_data=self._training_data, - validation_data=self._validation_data, - hyper_parameters=self.hyperparameters._to_rest_object() if self.hyperparameters else None, + training_data=training_data, + validation_data=validation_data, + hyper_parameters=( + self.hyperparameters._to_rest_object() if self.hyperparameters else None + ), ) - self._resolve_inputs(aoai_finetuning_vertical) - finetuning_job = RestFineTuningJob( display_name=self.display_name, description=self.description, @@ -135,7 +131,15 @@ def _to_rest_object(self) -> "RestFineTuningJob": tags=self.tags, properties=self.properties, fine_tuning_details=aoai_finetuning_vertical, - outputs=to_rest_data_outputs(self.outputs), + # The shared arm_ml_service model defaults is_archived to None (omitted on the wire), but + # the legacy msrest model serialized isArchived=false on create. Set it explicitly to keep + # the wire body identical. + is_archived=False, + # The shared ``to_rest_data_outputs`` helper emits msrest models; convert to the + # arm_ml_service hybrid equivalent so the hybrid SdkJSONEncoder can serialize the body. + outputs=to_hybrid_rest_model( + to_rest_data_outputs(self.outputs), RestJobOutput + ), ) result = RestJobBase(properties=finetuning_job) @@ -149,14 +153,18 @@ def _to_dict(self) -> Dict: :return: dictionary representation of the object. :rtype: typing.Dict """ - from azure.ai.ml._schema._finetuning.azure_openai_finetuning import AzureOpenAIFineTuningSchema + from azure.ai.ml._schema._finetuning.azure_openai_finetuning import ( + AzureOpenAIFineTuningSchema, + ) schema_dict: dict = {} # TODO: Combeback to this later for FineTuningJob in Pipelines # if inside_pipeline: # schema_dict = AutoMLClassificationNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) # else: - schema_dict = AzureOpenAIFineTuningSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AzureOpenAIFineTuningSchema( + context={BASE_PATH_CONTEXT_KEY: "./"} + ).dump(self) return schema_dict @@ -217,7 +225,9 @@ def _from_rest_object(cls, obj: RestJobBase) -> "AzureOpenAIFineTuningJob": model=finetuning_details.model, training_data=finetuning_details.training_data, validation_data=finetuning_details.validation_data, - hyperparameters=AzureOpenAIHyperparameters._from_rest_object(finetuning_details.hyper_parameters), + hyperparameters=AzureOpenAIHyperparameters._from_rest_object( + finetuning_details.hyper_parameters + ), **job_args_dict, ) @@ -244,7 +254,9 @@ def _load_from_dict( :return: AzureOpenAIFineTuningJob object. :rtype: AzureOpenAIFineTuningJob """ - from azure.ai.ml._schema._finetuning.azure_openai_finetuning import AzureOpenAIFineTuningSchema + from azure.ai.ml._schema._finetuning.azure_openai_finetuning import ( + AzureOpenAIFineTuningSchema, + ) # TODO: Combeback to this later - Pipeline part. # from azure.ai.ml._schema.pipeline.automl_node import AutoMLClassificationNodeSchema @@ -258,13 +270,17 @@ def _load_from_dict( # **kwargs, # ) # else: - loaded_data = load_from_dict(AzureOpenAIFineTuningSchema, data, context, additional_message, **kwargs) + loaded_data = load_from_dict( + AzureOpenAIFineTuningSchema, data, context, additional_message, **kwargs + ) job_instance = cls._create_instance_from_schema_dict(loaded_data) return job_instance @classmethod - def _create_instance_from_schema_dict(cls, loaded_data: Dict) -> "AzureOpenAIFineTuningJob": + def _create_instance_from_schema_dict( + cls, loaded_data: Dict + ) -> "AzureOpenAIFineTuningJob": """Create an instance from a schema dictionary. :param loaded_data: dictionary containing the data. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py index 2b420a468e13..371f8648c746 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py @@ -4,7 +4,7 @@ from typing import Optional from azure.ai.ml.entities._mixins import RestTranslatableMixin -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AzureOpenAiHyperParameters as RestAzureOpenAiHyperParameters, ) from azure.ai.ml._utils._experimental import experimental @@ -116,7 +116,9 @@ def __ne__(self, other: object) -> bool: return not self.__eq__(other) @classmethod - def _from_rest_object(cls, obj: RestAzureOpenAiHyperParameters) -> "AzureOpenAIHyperparameters": + def _from_rest_object( + cls, obj: RestAzureOpenAiHyperParameters + ) -> "AzureOpenAIHyperparameters": aoai_hyperparameters = cls( batch_size=obj.batch_size, learning_rate_multiplier=obj.learning_rate_multiplier, diff --git a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py index d2ff30181626..790169da73d6 100644 --- a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py +++ b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py @@ -5,13 +5,6 @@ UriFileJobInput, MLFlowModelJobInput, ) - -# The Azure OpenAI fine-tuning path stays on its own v2024-01-01-preview msrest models (it is not part -# of the arm_ml_service migration), so its nested inputs are that api version's types, not arm. -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( - UriFileJobInput as AoaiUriFileJobInput, - MLFlowModelJobInput as AoaiMLFlowModelJobInput, -) from azure.ai.ml.constants._job.finetuning import FineTuningTaskTypes from azure.ai.ml.entities._job.finetuning.custom_model_finetuning_job import ( CustomModelFineTuningJob, @@ -49,8 +42,12 @@ def test_custom_model_finetuning_job_conversion(self, task: str): custom_model_finetuning_job = self._get_custom_model_finetuning_job( task=task, display_name="llama-display-name", - training_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv"), - validation_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv"), + training_data=Input( + type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv" + ), + validation_data=Input( + type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv" + ), hyperparameters={"foo": "bar"}, model=Input( type=AssetTypes.MLFLOW_MODEL, @@ -60,7 +57,11 @@ def test_custom_model_finetuning_job_conversion(self, task: str): experiment_name="foo_exp", tags={"foo_tag": "bar"}, properties={"my_property": "True"}, - outputs={"registered_model": Output(type="mlflow_model", name="llama-finetune-registered")}, + outputs={ + "registered_model": Output( + type="mlflow_model", name="llama-finetune-registered" + ) + }, ) rest_obj = custom_model_finetuning_job._to_rest_object() assert isinstance( @@ -74,31 +75,60 @@ def test_custom_model_finetuning_job_conversion(self, task: str): ), "Validation data is not UriFileJobInput" original_obj = CustomModelFineTuningJob._from_rest_object(rest_obj) - assert custom_model_finetuning_job == original_obj, "Conversion to/from rest object failed" + assert ( + custom_model_finetuning_job == original_obj + ), "Conversion to/from rest object failed" assert original_obj.task.lower() == task.lower(), "Task not set correctly" - assert original_obj.display_name == "llama-display-name", "Display name not set correctly" + assert ( + original_obj.display_name == "llama-display-name" + ), "Display name not set correctly" assert original_obj.name == "llama-finetuning", "Name not set correctly" - assert original_obj.experiment_name == "foo_exp", "Experiment name not set correctly" + assert ( + original_obj.experiment_name == "foo_exp" + ), "Experiment name not set correctly" assert original_obj.tags == {"foo_tag": "bar"}, "Tags not set correctly" - assert original_obj.properties == {"my_property": "True"}, "Properties not set correctly" + assert original_obj.properties == { + "my_property": "True" + }, "Properties not set correctly" # check if the original job inputs were restored - assert isinstance(original_obj.training_data, Input), "Training data is not Input" - assert original_obj.training_data.type == AssetTypes.URI_FILE, "Training data type not set correctly" - assert original_obj.training_data.path == "https://foo/bar/train.csv", "Training data path not set correctly" + assert isinstance( + original_obj.training_data, Input + ), "Training data is not Input" + assert ( + original_obj.training_data.type == AssetTypes.URI_FILE + ), "Training data type not set correctly" + assert ( + original_obj.training_data.path == "https://foo/bar/train.csv" + ), "Training data path not set correctly" assert isinstance(original_obj.validation_data, Input), "Test data is not Input" - assert original_obj.validation_data.type == AssetTypes.URI_FILE, "Test data type not set correctly" - assert original_obj.validation_data.path == "https://foo/bar/test.csv", "Test data path not set correctly" - assert original_obj.hyperparameters == {"foo": "bar"}, "Hyperparameters not set correctly" + assert ( + original_obj.validation_data.type == AssetTypes.URI_FILE + ), "Test data type not set correctly" + assert ( + original_obj.validation_data.path == "https://foo/bar/test.csv" + ), "Test data path not set correctly" + assert original_obj.hyperparameters == { + "foo": "bar" + }, "Hyperparameters not set correctly" assert isinstance(original_obj.model, Input), "Model is not Input" - assert original_obj.model.type == AssetTypes.MLFLOW_MODEL, "Model type not set correctly" assert ( - original_obj.model.path == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" + original_obj.model.type == AssetTypes.MLFLOW_MODEL + ), "Model type not set correctly" + assert ( + original_obj.model.path + == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" ), "Model path not set correctly" - assert isinstance(original_obj.outputs["registered_model"], Output), "Output is not Output" + assert isinstance( + original_obj.outputs["registered_model"], Output + ), "Output is not Output" mlflow_model_output = original_obj.outputs["registered_model"] - assert mlflow_model_output.type == "mlflow_model", "Output type not set correctly" - assert mlflow_model_output.name == "llama-finetune-registered", "Output name not set correctly" + assert ( + mlflow_model_output.type == "mlflow_model" + ), "Output type not set correctly" + assert ( + mlflow_model_output.name == "llama-finetune-registered" + ), "Output name not set correctly" @pytest.mark.parametrize( "task", @@ -120,8 +150,12 @@ def test_custom_model_finetuning_job_read_from_wire(self, task: str): custom_model_finetuning_job = self._get_custom_model_finetuning_job( task=task, display_name="llama-display-name", - training_data=Input(type=AssetTypes.URI_FILE, path="./samsum_dataset/small_train.jsonl"), - validation_data=Input(type=AssetTypes.URI_FILE, path="./samsum_dataset/small_validation.jsonl"), + training_data=Input( + type=AssetTypes.URI_FILE, path="./samsum_dataset/small_train.jsonl" + ), + validation_data=Input( + type=AssetTypes.URI_FILE, path="./samsum_dataset/small_validation.jsonl" + ), hyperparameters={"foo": "bar"}, model=Input( type=AssetTypes.MLFLOW_MODEL, @@ -131,28 +165,49 @@ def test_custom_model_finetuning_job_read_from_wire(self, task: str): experiment_name="foo_exp", tags={"foo_tag": "bar"}, properties={"my_property": True}, - outputs={"registered_model": Output(type="mlflow_model", name="llama-finetune-registered")}, + outputs={ + "registered_model": Output( + type="mlflow_model", name="llama-finetune-registered" + ) + }, ) dict_obj = custom_model_finetuning_job._to_dict() assert dict_obj["task"].lower() == task.lower(), "Task not set correctly" - assert dict_obj["display_name"] == "llama-display-name", "Display name not set correctly" + assert ( + dict_obj["display_name"] == "llama-display-name" + ), "Display name not set correctly" assert dict_obj["name"] == "llama-finetuning", "Name not set correctly" - assert dict_obj["experiment_name"] == "foo_exp", "Experiment name not set correctly" + assert ( + dict_obj["experiment_name"] == "foo_exp" + ), "Experiment name not set correctly" assert dict_obj["tags"] == {"foo_tag": "bar"}, "Tags not set correctly" - assert dict_obj["properties"]["my_property"] == "True", "Properties not set correctly" + assert ( + dict_obj["properties"]["my_property"] == "True" + ), "Properties not set correctly" # check if the original job inputs were restored - assert dict_obj["training_data"]["type"] == AssetTypes.URI_FILE, "Training data type not set correctly" assert ( - dict_obj["training_data"]["path"] == "azureml:./samsum_dataset/small_train.jsonl" + dict_obj["training_data"]["type"] == AssetTypes.URI_FILE + ), "Training data type not set correctly" + assert ( + dict_obj["training_data"]["path"] + == "azureml:./samsum_dataset/small_train.jsonl" ), "Training data path not set correctly" - assert dict_obj["validation_data"]["type"] == AssetTypes.URI_FILE, "validation data type not set correctly" assert ( - dict_obj["validation_data"]["path"] == "azureml:./samsum_dataset/small_validation.jsonl" + dict_obj["validation_data"]["type"] == AssetTypes.URI_FILE + ), "validation data type not set correctly" + assert ( + dict_obj["validation_data"]["path"] + == "azureml:./samsum_dataset/small_validation.jsonl" ), "Validation data path not set correctly" - assert dict_obj["hyperparameters"] == {"foo": "bar"}, "Hyperparameters not set correctly" - assert dict_obj["model"]["type"] == AssetTypes.MLFLOW_MODEL, "Model type not set correctly" + assert dict_obj["hyperparameters"] == { + "foo": "bar" + }, "Hyperparameters not set correctly" + assert ( + dict_obj["model"]["type"] == AssetTypes.MLFLOW_MODEL + ), "Model type not set correctly" assert ( - dict_obj["model"]["path"] == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" + dict_obj["model"]["path"] + == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" ), "Model path not set correctly" @pytest.mark.parametrize( @@ -175,9 +230,15 @@ def test_azure_openai_finetuning_job_conversion(self, task: str): # Create Custom Model FineTuning Job custom_model_finetuning_job = self._get_azure_openai_finetuning_job( task=task, - training_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv"), - validation_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv"), - hyperparameters=AzureOpenAIHyperparameters(batch_size=2, n_epochs=3, learning_rate_multiplier=0.5), + training_data=Input( + type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv" + ), + validation_data=Input( + type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv" + ), + hyperparameters=AzureOpenAIHyperparameters( + batch_size=2, n_epochs=3, learning_rate_multiplier=0.5 + ), model=Input( type=AssetTypes.MLFLOW_MODEL, path="azureml://registries/azure-openai-v2/models/gpt-4/versions/1", @@ -185,42 +246,63 @@ def test_azure_openai_finetuning_job_conversion(self, task: str): name="gpt4-finetuning", experiment_name="foo_exp", tags={"foo_tag": "bar"}, - properties={"my_property": True}, + properties={"my_property": "True"}, ) rest_obj = custom_model_finetuning_job._to_rest_object() assert isinstance( - rest_obj.properties.fine_tuning_details.model, AoaiMLFlowModelJobInput + rest_obj.properties.fine_tuning_details.model, MLFlowModelJobInput ), "Model is not MLFlowModelJobInput" assert isinstance( - rest_obj.properties.fine_tuning_details.training_data, AoaiUriFileJobInput + rest_obj.properties.fine_tuning_details.training_data, UriFileJobInput ), "Training data is not UriFileJobInput" assert isinstance( - rest_obj.properties.fine_tuning_details.validation_data, AoaiUriFileJobInput + rest_obj.properties.fine_tuning_details.validation_data, UriFileJobInput ), "Validation data is not UriFileJobInput" original_obj = AzureOpenAIFineTuningJob._from_rest_object(rest_obj) - assert custom_model_finetuning_job == original_obj, "Conversion to/from rest object failed" + assert ( + custom_model_finetuning_job == original_obj + ), "Conversion to/from rest object failed" assert original_obj.task.lower() == task.lower(), "Task not set correctly" assert original_obj.name == "gpt4-finetuning", "Name not set correctly" - assert original_obj.experiment_name == "foo_exp", "Experiment name not set correctly" + assert ( + original_obj.experiment_name == "foo_exp" + ), "Experiment name not set correctly" assert original_obj.tags == {"foo_tag": "bar"}, "Tags not set correctly" - assert original_obj.properties == {"my_property": True}, "Properties not set correctly" + assert original_obj.properties == { + "my_property": "True" + }, "Properties not set correctly" # check if the original job inputs were restored - assert isinstance(original_obj.training_data, Input), "Training data is not Input" - assert original_obj.training_data.type == AssetTypes.URI_FILE, "Training data type not set correctly" - assert original_obj.training_data.path == "https://foo/bar/train.csv", "Training data path not set correctly" + assert isinstance( + original_obj.training_data, Input + ), "Training data is not Input" + assert ( + original_obj.training_data.type == AssetTypes.URI_FILE + ), "Training data type not set correctly" + assert ( + original_obj.training_data.path == "https://foo/bar/train.csv" + ), "Training data path not set correctly" assert isinstance(original_obj.validation_data, Input), "Test data is not Input" - assert original_obj.validation_data.type == AssetTypes.URI_FILE, "Test data type not set correctly" - assert original_obj.validation_data.path == "https://foo/bar/test.csv", "Test data path not set correctly" - assert original_obj.hyperparameters.batch_size == 2, "Batch size not set correctly" + assert ( + original_obj.validation_data.type == AssetTypes.URI_FILE + ), "Test data type not set correctly" + assert ( + original_obj.validation_data.path == "https://foo/bar/test.csv" + ), "Test data path not set correctly" + assert ( + original_obj.hyperparameters.batch_size == 2 + ), "Batch size not set correctly" assert original_obj.hyperparameters.n_epochs == 3, "n_epochs not set correctly" assert ( original_obj.hyperparameters.learning_rate_multiplier == 0.5 ), "learning_rate_multiplier not set correctly" assert isinstance(original_obj.model, Input), "Model is not Input" - assert original_obj.model.type == AssetTypes.MLFLOW_MODEL, "Model type not set correctly" assert ( - original_obj.model.path == "azureml://registries/azure-openai-v2/models/gpt-4/versions/1" + original_obj.model.type == AssetTypes.MLFLOW_MODEL + ), "Model type not set correctly" + assert ( + original_obj.model.path + == "azureml://registries/azure-openai-v2/models/gpt-4/versions/1" ), "Model path not set correctly" def _get_custom_model_finetuning_job( From 9de1fa983cdb7de45ba0b261f263977d26ed98b6 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 3 Jul 2026 17:34:47 +0530 Subject: [PATCH 016/146] migrate(finetuning): ModelProvider enum in schemas to arm_ml_service Flip the ModelProvider enum import in the azure_openai/custom_model finetuning schemas off v2024_01_01_preview onto arm_ml_service (identical enum values: AZURE_OPEN_AI, CUSTOM). Completes the finetuning family - entities + schemas now fully off v2024_01. Validated: finetuning UTs + full smoke_serialization (184 passed). --- .../azure/ai/ml/_schema/_finetuning/azure_openai_finetuning.py | 2 +- .../azure/ai/ml/_schema/_finetuning/custom_model_finetuning.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/azure_openai_finetuning.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/azure_openai_finetuning.py index f6d2a58d0564..52a6248d6dd1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/azure_openai_finetuning.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/azure_openai_finetuning.py @@ -9,7 +9,7 @@ from azure.ai.ml._schema.core.fields import StringTransformedEnum -from azure.ai.ml._restclient.v2024_01_01_preview.models import ModelProvider +from azure.ai.ml._restclient.arm_ml_service.models import ModelProvider from azure.ai.ml._schema._finetuning.azure_openai_hyperparameters import AzureOpenAIHyperparametersSchema from azure.ai.ml._schema._finetuning.finetuning_vertical import FineTuningVerticalSchema from azure.ai.ml.entities._job.finetuning.azure_openai_hyperparameters import AzureOpenAIHyperparameters diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/custom_model_finetuning.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/custom_model_finetuning.py index 9d5b22a70293..17bc0704be6d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/custom_model_finetuning.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_finetuning/custom_model_finetuning.py @@ -7,7 +7,7 @@ from typing import Any, Dict from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2024_01_01_preview.models import ModelProvider +from azure.ai.ml._restclient.arm_ml_service.models import ModelProvider from azure.ai.ml._schema._finetuning.finetuning_vertical import FineTuningVerticalSchema from azure.ai.ml._schema.core.fields import StringTransformedEnum from azure.ai.ml._utils._experimental import experimental From dbb98348b84c5c3fe2b8dc8e30bb187b48b70fd5 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 09:20:29 +0530 Subject: [PATCH 017/146] migrate(jobs): to_rest_functions JobBase type-annotation to arm_ml_service JobBaseData was a pure type annotation (never constructed); consolidate it onto arm_ml_service JobBase (same as JobBaseData202501). Removes a v2023_08 consumer with zero runtime change. Validated: job_common + command UTs (51 passed, 17 skipped). --- .../azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py index 10f72f51eb0a..7c1a1c5ce3c4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py @@ -9,7 +9,7 @@ from typing import Any from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData202501 -from azure.ai.ml._restclient.v2023_08_01_preview.models import JobBase as JobBaseData +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData from azure.ai.ml.constants._common import DEFAULT_EXPERIMENT_NAME from azure.ai.ml.entities._builders.command import Command from azure.ai.ml.entities._builders.pipeline import Pipeline From bad5d8c0393d78d8c234cb4131f7e94acb195ff0 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 15:39:38 +0530 Subject: [PATCH 018/146] migrate(jobs): PipelineJob envelope to arm_ml_service Flip the PipelineJob envelope off v2024_01_01_preview onto the shared arm_ml_service hybrid model, the largest remaining job-boundary migration. - pipeline_job.py: JobBase/PipelineJob + JobInput/JobOutput/JobService/ IdentityConfiguration -> arm. Wrap inputs/outputs/services/identity via to_hybrid_rest_model so the hybrid SdkJSONEncoder serializes the body. Set is_archived=False to match the legacy msrest wire (isArchived=false). Wire is byte-identical to main (verified against captured wire goldens). - schedule.py: the create_job=PipelineJob branch now receives an arm hybrid job_definition; normalize it via as_dict()+json(default=str) so unresolved inline components (offline entities) stringify exactly as the legacy msrest serialize() did, keeping the arm schedule envelope serializable. Test-side: pipeline rest-object assertions that read snake_case field names now use azure.core.serialization.as_attribute_dict (the arm hybrid emits camelCase from as_dict(); as_attribute_dict reproduces the snake_case that main's msrest as_dict() produced). Where residual data-binding expression objects survive in free-form nested dicts, a json(default=str) round-trip stringifies them (matching msrest). Updated shared helpers prepare_dsl_curated/assert_dsl_curated + inline call sites across test_pipeline_job_entity, test_dsl_pipeline(_samples/_with_specific_nodes), test_controlflow_pipeline, test_io_builder. Validated: pipeline_job UTs (200) + dsl (290) + full smoke_serialization + schedule + component + command + job_common all green (636 in the combined pipeline+dsl+smoke run). Retires the PipelineJob v2024_01 consumer. --- .../ml/entities/_job/pipeline/pipeline_job.py | 264 ++- .../ai/ml/entities/_schedule/schedule.py | 104 +- .../unittests/test_controlflow_pipeline.py | 266 ++- .../tests/dsl/unittests/test_dsl_pipeline.py | 1634 +++++++++++++---- .../unittests/test_dsl_pipeline_samples.py | 108 +- .../test_dsl_pipeline_with_specific_nodes.py | 363 ++-- .../tests/dsl/unittests/test_io_builder.py | 238 ++- .../unittests/test_pipeline_job_entity.py | 1094 ++++++++--- .../azure-ai-ml/tests/test_utilities/utils.py | 82 +- 9 files changed, 3183 insertions(+), 970 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py index 8f4e3caf6a22..9e5c7a25205f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py @@ -12,8 +12,14 @@ from typing_extensions import Literal -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase -from azure.ai.ml._restclient.v2024_01_01_preview.models import PipelineJob as RestPipelineJob +from azure.ai.ml._restclient.arm_ml_service.models import ( + IdentityConfiguration as RestIdentityConfiguration, +) +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import JobService as RestJobService +from azure.ai.ml._restclient.arm_ml_service.models import PipelineJob as RestPipelineJob from azure.ai.ml._schema import PathAwareSchema from azure.ai.ml._schema.pipeline.pipeline_job import PipelineJobSchema from azure.ai.ml._utils._arm_id_utils import get_resource_name_from_arm_id_safe @@ -24,7 +30,10 @@ transform_dict_keys, ) from azure.ai.ml.constants import JobType -from azure.ai.ml.constants._common import AZUREML_PRIVATE_FEATURES_ENV_VAR, BASE_PATH_CONTEXT_KEY +from azure.ai.ml.constants._common import ( + AZUREML_PRIVATE_FEATURES_ENV_VAR, + BASE_PATH_CONTEXT_KEY, +) from azure.ai.ml.constants._component import ComponentSource from azure.ai.ml.constants._job.pipeline import ValidationErrorCode from azure.ai.ml.entities._builders import BaseNode @@ -48,6 +57,7 @@ from azure.ai.ml.entities._job._input_output_helpers import ( from_rest_data_outputs, from_rest_inputs_to_dataset_literal, + to_hybrid_rest_model, to_rest_data_outputs, to_rest_dataset_literal_inputs, ) @@ -58,13 +68,18 @@ from azure.ai.ml.entities._job.pipeline.pipeline_job_settings import PipelineJobSettings from azure.ai.ml.entities._mixins import YamlTranslatableMixin from azure.ai.ml.entities._system_data import SystemData -from azure.ai.ml.entities._validation import MutableValidationResult, PathAwareSchemaValidatableMixin +from azure.ai.ml.entities._validation import ( + MutableValidationResult, + PathAwareSchemaValidatableMixin, +) from azure.ai.ml.exceptions import ErrorTarget, UserErrorException, ValidationException module_logger = logging.getLogger(__name__) -class PipelineJob(Job, YamlTranslatableMixin, PipelineJobIOMixin, PathAwareSchemaValidatableMixin): +class PipelineJob( + Job, YamlTranslatableMixin, PipelineJobIOMixin, PathAwareSchemaValidatableMixin +): """Pipeline job. You should not instantiate this class directly. Instead, you should @@ -126,7 +141,11 @@ def __init__( jobs: Optional[Dict[str, BaseNode]] = None, settings: Optional[PipelineJobSettings] = None, identity: Optional[ - Union[ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] + Union[ + ManagedIdentityConfiguration, + AmlTokenConfiguration, + UserIdentityConfiguration, + ] ] = None, compute: Optional[str] = None, tags: Optional[Dict[str, str]] = None, @@ -138,12 +157,16 @@ def __init__( ComponentSource.DSL, ComponentSource.YAML_COMPONENT, ]: - self._inputs = self._build_inputs_dict(inputs, input_definition_dict=component.inputs) + self._inputs = self._build_inputs_dict( + inputs, input_definition_dict=component.inputs + ) # for pipeline component created pipeline jobs, # it's output should have same value with the component outputs, # then override it with given outputs (filter out None value) pipeline_outputs = {k: v for k, v in (outputs or {}).items() if v} - self._outputs = self._build_pipeline_outputs_dict({**component.outputs, **pipeline_outputs}) + self._outputs = self._build_pipeline_outputs_dict( + {**component.outputs, **pipeline_outputs} + ) else: # Build inputs/outputs dict without meta when definition not available self._inputs = self._build_inputs_dict(inputs) @@ -163,12 +186,16 @@ def __init__( # If component is Pipeline component, jobs will be component.jobs self._jobs = (jobs or {}) if isinstance(component, str) else {} - self.component: Union[PipelineComponent, str] = cast(Union[PipelineComponent, str], component) + self.component: Union[PipelineComponent, str] = cast( + Union[PipelineComponent, str], component + ) if "type" not in kwargs: kwargs["type"] = JobType.PIPELINE if isinstance(component, PipelineComponent): description = component.description if description is None else description - display_name = component.display_name if display_name is None else display_name + display_name = ( + component.display_name if display_name is None else display_name + ) super(PipelineJob, self).__init__( name=name, description=description, @@ -213,7 +240,11 @@ def jobs(self) -> Dict: :return: Jobs of pipeline job. :rtype: dict """ - res: dict = self.component.jobs if isinstance(self.component, PipelineComponent) else self._jobs + res: dict = ( + self.component.jobs + if isinstance(self.component, PipelineComponent) + else self._jobs + ) return res @property @@ -242,11 +273,17 @@ def settings(self, value: Optional[Union[Dict, PipelineJobSettings]]) -> None: elif isinstance(value, dict): value = PipelineJobSettings(**value) else: - raise TypeError("settings must be PipelineJobSettings or dict but got {}".format(type(value))) + raise TypeError( + "settings must be PipelineJobSettings or dict but got {}".format( + type(value) + ) + ) self._settings = value @classmethod - def _create_validation_error(cls, message: str, no_personal_data_message: str) -> ValidationException: + def _create_validation_error( + cls, message: str, no_personal_data_message: str + ) -> ValidationException: return ValidationException( message=message, no_personal_data_message=no_personal_data_message, @@ -292,7 +329,8 @@ def _customized_validate(self) -> MutableValidationResult: # Skip top level parameter missing type error validation_result.merge_with( self.component._customized_validate(), - condition_skip=lambda x: x.error_code == ValidationErrorCode.PARAMETER_TYPE_UNKNOWN + condition_skip=lambda x: x.error_code + == ValidationErrorCode.PARAMETER_TYPE_UNKNOWN and x.yaml_path.startswith("inputs"), ) # Validate compute @@ -311,7 +349,9 @@ def _validate_input(self) -> MutableValidationResult: used_pipeline_inputs = set( itertools.chain( *[ - self.component._get_input_binding_dict(node if not isinstance(node, LoopNode) else node.body)[0] + self.component._get_input_binding_dict( + node if not isinstance(node, LoopNode) else node.body + )[0] for node in self.jobs.values() if not isinstance(node, ConditionNode) # condition node has no inputs @@ -322,7 +362,9 @@ def _validate_input(self) -> MutableValidationResult: if not isinstance(self.component, Component): return validation_result for key, meta in self.component.inputs.items(): - if key not in used_pipeline_inputs: # pylint: disable=possibly-used-before-assignment + if ( + key not in used_pipeline_inputs + ): # pylint: disable=possibly-used-before-assignment # Only validate inputs certainly used. continue # raise error when required input with no default value not set @@ -339,8 +381,13 @@ def _validate_input(self) -> MutableValidationResult: ) return validation_result - def _validate_init_finalize_job(self) -> MutableValidationResult: # pylint: disable=too-many-statements - from azure.ai.ml.entities._job.pipeline._io import InputOutputBase, _GroupAttrDict + def _validate_init_finalize_job( + self, + ) -> MutableValidationResult: # pylint: disable=too-many-statements + from azure.ai.ml.entities._job.pipeline._io import ( + InputOutputBase, + _GroupAttrDict, + ) validation_result = self._create_empty_validation_result() # subgraph (PipelineComponent) should not have on_init/on_finalize set @@ -368,15 +415,26 @@ def _validate_init_finalize_job(self) -> MutableValidationResult: # pylint: dis on_init, on_finalize = self.settings.on_init, self.settings.on_finalize - append_on_init_error = partial(validation_result.append_error, "settings.on_init") - append_on_finalize_error = partial(validation_result.append_error, "settings.on_finalize") + append_on_init_error = partial( + validation_result.append_error, "settings.on_init" + ) + append_on_finalize_error = partial( + validation_result.append_error, "settings.on_finalize" + ) # on_init and on_finalize cannot be same if on_init == on_finalize: - append_on_init_error(f"Invalid on_init job {on_init}, it should be different from on_finalize.") - append_on_finalize_error(f"Invalid on_finalize job {on_finalize}, it should be different from on_init.") + append_on_init_error( + f"Invalid on_init job {on_init}, it should be different from on_finalize." + ) + append_on_finalize_error( + f"Invalid on_finalize job {on_finalize}, it should be different from on_init." + ) # pipeline should have at least one normal node if len(set(self.jobs.keys()) - {on_init, on_finalize}) == 0: - validation_result.append_error(yaml_path="jobs", message="No other job except for on_init/on_finalize job.") + validation_result.append_error( + yaml_path="jobs", + message="No other job except for on_init/on_finalize job.", + ) def _is_control_flow_node(_validate_job_name: str) -> bool: from azure.ai.ml.entities._builders.control_flow_node import ControlFlowNode @@ -386,7 +444,8 @@ def _is_control_flow_node(_validate_job_name: str) -> bool: def _is_isolated_job(_validate_job_name: str) -> bool: def _try_get_data_bindings( - _name: str, _input_output_data: Union["_GroupAttrDict", "InputOutputBase"] + _name: str, + _input_output_data: Union["_GroupAttrDict", "InputOutputBase"], ) -> Optional[List]: """Try to get data bindings from input/output data, return None if not found. :param _name: The name to use when flattening GroupAttrDict @@ -398,9 +457,13 @@ def _try_get_data_bindings( """ # handle group input if GroupInput._is_group_attr_dict(_input_output_data): - _new_input_output_data: _GroupAttrDict = cast(_GroupAttrDict, _input_output_data) + _new_input_output_data: _GroupAttrDict = cast( + _GroupAttrDict, _input_output_data + ) # flatten to avoid nested cases - flattened_values: List[Input] = list(_new_input_output_data.flatten(_name).values()) + flattened_values: List[Input] = list( + _new_input_output_data.flatten(_name).values() + ) # handle invalid empty group if len(flattened_values) == 0: return None @@ -415,7 +478,9 @@ def _try_get_data_bindings( _validate_job = self.jobs[_validate_job_name] # no input to validate job for _input_name in _validate_job.inputs: - _data_bindings = _try_get_data_bindings(_input_name, _validate_job.inputs[_input_name]) + _data_bindings = _try_get_data_bindings( + _input_name, _validate_job.inputs[_input_name] + ) if _data_bindings is None: continue for _data_binding in _data_bindings: @@ -427,11 +492,15 @@ def _try_get_data_bindings( if _is_control_flow_node(_job_name): continue for _input_name in _job.inputs: - _data_bindings = _try_get_data_bindings(_input_name, _job.inputs[_input_name]) + _data_bindings = _try_get_data_bindings( + _input_name, _job.inputs[_input_name] + ) if _data_bindings is None: continue for _data_binding in _data_bindings: - if is_data_binding_expression(_data_binding, ["parent", "jobs", _validate_job_name]): + if is_data_binding_expression( + _data_binding, ["parent", "jobs", _validate_job_name] + ): return False return True @@ -441,25 +510,38 @@ def _try_get_data_bindings( append_on_init_error(f"On_init job name {on_init} not exists in jobs.") else: if _is_control_flow_node(on_init): - append_on_init_error("On_init job should not be a control flow node.") + append_on_init_error( + "On_init job should not be a control flow node." + ) elif not _is_isolated_job(on_init): - append_on_init_error("On_init job should not have connection to other execution node.") + append_on_init_error( + "On_init job should not have connection to other execution node." + ) # validate on_finalize if on_finalize is not None: if on_finalize not in self.jobs: - append_on_finalize_error(f"On_finalize job name {on_finalize} not exists in jobs.") + append_on_finalize_error( + f"On_finalize job name {on_finalize} not exists in jobs." + ) else: if _is_control_flow_node(on_finalize): - append_on_finalize_error("On_finalize job should not be a control flow node.") + append_on_finalize_error( + "On_finalize job should not be a control flow node." + ) elif not _is_isolated_job(on_finalize): - append_on_finalize_error("On_finalize job should not have connection to other execution node.") + append_on_finalize_error( + "On_finalize job should not have connection to other execution node." + ) return validation_result def _remove_pipeline_input(self) -> None: """Remove None pipeline input.If not remove, it will pass "None" to backend.""" redundant_pipeline_inputs = [] for pipeline_input_name, pipeline_input in self._inputs.items(): - if isinstance(pipeline_input, PipelineInput) and pipeline_input._data is None: + if ( + isinstance(pipeline_input, PipelineInput) + and pipeline_input._data is None + ): redundant_pipeline_inputs.append(pipeline_input_name) for redundant_pipeline_input in redundant_pipeline_inputs: self._inputs.pop(redundant_pipeline_input) @@ -537,17 +619,23 @@ def _to_rest_object(self) -> JobBase: source = ComponentSource.REMOTE_WORKSPACE_JOB rest_component_jobs = {} # add _source on pipeline job.settings - if "_source" not in settings_dict: # pylint: disable=possibly-used-before-assignment + if ( + "_source" not in settings_dict + ): # pylint: disable=possibly-used-before-assignment settings_dict.update({"_source": source}) # TODO: Revisit this logic when multiple types of component jobs are supported rest_compute = self.compute # This will be resolved in job_operations _resolve_arm_id_or_upload_dependencies. - component_id = self.component if isinstance(self.component, str) else self.component.id + component_id = ( + self.component if isinstance(self.component, str) else self.component.id + ) # TODO remove it in the future. # MFE not support pass None or empty input value. Remove the empty inputs in pipeline job. - built_inputs = {k: v for k, v in built_inputs.items() if v is not None and v != ""} + built_inputs = { + k: v for k, v in built_inputs.items() if v is not None and v != "" + } pipeline_job = RestPipelineJob( compute_id=rest_compute, @@ -558,11 +646,31 @@ def _to_rest_object(self) -> JobBase: properties=self.properties, experiment_name=self.experiment_name, jobs=rest_component_jobs, - inputs=to_rest_dataset_literal_inputs(built_inputs, job_type=self.type), - outputs=to_rest_data_outputs(built_outputs), + # The shared arm_ml_service PipelineJob model defaults ``is_archived`` to None (omitted on + # the wire); the legacy msrest model serialized ``isArchived=false`` on create. + is_archived=False, + # The shared rest helpers below emit msrest models; convert each nested child to its + # arm_ml_service hybrid equivalent so the hybrid SdkJSONEncoder can serialize the body. + inputs=to_hybrid_rest_model( + to_rest_dataset_literal_inputs(built_inputs, job_type=self.type), + RestJobInput, + ), + outputs=to_hybrid_rest_model( + to_rest_data_outputs(built_outputs), RestJobOutput + ), settings=settings_dict, - services={k: v._to_rest_object() for k, v in self.services.items()} if self.services else None, - identity=self.identity._to_job_rest_object() if self.identity else None, + services=( + to_hybrid_rest_model( + {k: v._to_rest_object() for k, v in self.services.items()}, + RestJobService, + ) + if self.services + else None + ), + identity=to_hybrid_rest_model( + self.identity._to_job_rest_object() if self.identity else None, + RestIdentityConfiguration, + ), ) rest_job = JobBase(properties=pipeline_job) @@ -584,10 +692,22 @@ def _load_from_rest(cls, obj: JobBase) -> "PipelineJob": from_rest_inputs = from_rest_inputs_to_dataset_literal(properties.inputs) or {} from_rest_outputs = from_rest_data_outputs(properties.outputs) or {} # Unpack the component jobs - sub_nodes = PipelineComponent._resolve_sub_nodes(properties.jobs) if properties.jobs else {} + sub_nodes = ( + PipelineComponent._resolve_sub_nodes(properties.jobs) + if properties.jobs + else {} + ) # backend may still store Camel settings, eg: DefaultDatastore, translate them to snake when load back - settings_dict = transform_dict_keys(properties.settings, camel_to_snake) if properties.settings else None - settings_sdk = PipelineJobSettings(**settings_dict) if settings_dict else PipelineJobSettings() + settings_dict = ( + transform_dict_keys(properties.settings, camel_to_snake) + if properties.settings + else None + ) + settings_sdk = ( + PipelineJobSettings(**settings_dict) + if settings_dict + else PipelineJobSettings() + ) # Create component or use component id if getattr(properties, "component_id", None): component = properties.component_id @@ -614,12 +734,22 @@ def _load_from_rest(cls, obj: JobBase) -> "PipelineJob": properties=properties.properties, experiment_name=properties.experiment_name, status=properties.status, - creation_context=SystemData._from_rest_object(obj.system_data) if obj.system_data else None, - services=JobServiceBase._from_rest_job_services(properties.services) if properties.services else None, + creation_context=( + SystemData._from_rest_object(obj.system_data) + if obj.system_data + else None + ), + services=( + JobServiceBase._from_rest_job_services(properties.services) + if properties.services + else None + ), compute=get_resource_name_from_arm_id_safe(properties.compute_id), settings=settings_sdk, identity=( - _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None + _BaseJobIdentityConfiguration._from_rest_object(properties.identity) + if properties.identity + else None ), ) @@ -633,23 +763,33 @@ def _to_dict(self) -> Dict: def _component_items_from_path(cls, data: Dict) -> Generator: if "jobs" in data: for node_name, job_instance in data["jobs"].items(): - potential_component_path = job_instance["component"] if "component" in job_instance else None - if isinstance(potential_component_path, str) and potential_component_path.startswith("file:"): + potential_component_path = ( + job_instance["component"] if "component" in job_instance else None + ) + if isinstance( + potential_component_path, str + ) and potential_component_path.startswith("file:"): yield node_name, potential_component_path @classmethod - def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "PipelineJob": + def _load_from_dict( + cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any + ) -> "PipelineJob": path_first_occurrence: dict = {} component_first_occurrence = {} for node_name, component_path in cls._component_items_from_path(data): if component_path in path_first_occurrence: - component_first_occurrence[node_name] = path_first_occurrence[component_path] + component_first_occurrence[node_name] = path_first_occurrence[ + component_path + ] # set components to be replaced here may break the validation logic else: path_first_occurrence[component_path] = node_name # use this instead of azure.ai.ml.entities._util.load_from_dict to avoid parsing - loaded_schema = cls._create_schema_for_validation(context=context).load(data, **kwargs) + loaded_schema = cls._create_schema_for_validation(context=context).load( + data, **kwargs + ) # replace repeat component with first occurrence to reduce arm id resolution # current load yaml file logic is in azure.ai.ml._schema.core.schema.YamlFileSchema.load_from_file @@ -685,7 +825,9 @@ def _get_telemetry_values(self) -> Dict: telemetry_values.pop("is_anonymous") return telemetry_values - def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> "PipelineComponent": + def _to_component( + self, context: Optional[Dict] = None, **kwargs: Any + ) -> "PipelineComponent": """Translate a pipeline job to pipeline component. :param context: Context of pipeline job YAML file. @@ -697,7 +839,11 @@ def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> "Pipel if ignored_keys: name = self.name or self.display_name name = f"{name!r} " if name else "" - module_logger.warning("%s ignored when translating PipelineJob %sto PipelineComponent.", ignored_keys, name) + module_logger.warning( + "%s ignored when translating PipelineJob %sto PipelineComponent.", + ignored_keys, + name, + ) pipeline_job_dict = kwargs.get("pipeline_job_dict", {}) context = context or {BASE_PATH_CONTEXT_KEY: Path("./")} @@ -705,7 +851,11 @@ def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> "Pipel return PipelineComponent( base_path=context[BASE_PATH_CONTEXT_KEY], display_name=self.display_name, - inputs=self._to_inputs(inputs=self.inputs, pipeline_job_dict=pipeline_job_dict), - outputs=self._to_outputs(outputs=self.outputs, pipeline_job_dict=pipeline_job_dict), + inputs=self._to_inputs( + inputs=self.inputs, pipeline_job_dict=pipeline_job_dict + ), + outputs=self._to_outputs( + outputs=self.outputs, pipeline_job_dict=pipeline_job_dict + ), jobs=self.jobs, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py index e446d1ee7681..b2b989225b21 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # pylint: disable=protected-access +import json import logging import typing from os import PathLike @@ -14,24 +15,49 @@ from azure.ai.ml._restclient.arm_ml_service.models import JobScheduleAction from azure.ai.ml._restclient.arm_ml_service.models import PipelineJob as RestPipelineJob from azure.ai.ml._restclient.arm_ml_service.models import Schedule as RestSchedule -from azure.ai.ml._restclient.arm_ml_service.models import ScheduleActionType as RestScheduleActionType +from azure.ai.ml._restclient.arm_ml_service.models import ( + ScheduleActionType as RestScheduleActionType, +) from azure.ai.ml._restclient.arm_ml_service.models import ScheduleProperties -from azure.ai.ml._restclient.v2024_01_01_preview.models import TriggerRunSubmissionDto as RestTriggerRunSubmissionDto +from azure.ai.ml._restclient.v2024_01_01_preview.models import ( + TriggerRunSubmissionDto as RestTriggerRunSubmissionDto, +) from azure.ai.ml._schema.schedule.schedule import JobScheduleSchema -from azure.ai.ml._utils.utils import camel_to_snake, dump_yaml_to_file, is_private_preview_enabled +from azure.ai.ml._utils.utils import ( + camel_to_snake, + dump_yaml_to_file, + is_private_preview_enabled, +) from azure.ai.ml.constants import JobType -from azure.ai.ml.constants._common import ARM_ID_PREFIX, BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, ScheduleType +from azure.ai.ml.constants._common import ( + ARM_ID_PREFIX, + BASE_PATH_CONTEXT_KEY, + PARAMS_OVERRIDE_KEY, + ScheduleType, +) from azure.ai.ml.entities._job.command_job import CommandJob from azure.ai.ml.entities._job.job import Job from azure.ai.ml.entities._job.pipeline.pipeline_job import PipelineJob from azure.ai.ml.entities._job.spark_job import SparkJob -from azure.ai.ml.entities._mixins import RestTranslatableMixin, TelemetryMixin, YamlTranslatableMixin +from azure.ai.ml.entities._mixins import ( + RestTranslatableMixin, + TelemetryMixin, + YamlTranslatableMixin, +) from azure.ai.ml.entities._resource import Resource from azure.ai.ml.entities._system_data import SystemData from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.entities._validation import MutableValidationResult, PathAwareSchemaValidatableMixin - -from ...exceptions import ErrorCategory, ErrorTarget, ScheduleException, ValidationException +from azure.ai.ml.entities._validation import ( + MutableValidationResult, + PathAwareSchemaValidatableMixin, +) + +from ...exceptions import ( + ErrorCategory, + ErrorTarget, + ScheduleException, + ValidationException, +) from .._builders import BaseNode from .trigger import CronTrigger, RecurrenceTrigger, TriggerBase @@ -70,7 +96,13 @@ def __init__( ) -> None: is_enabled = kwargs.pop("is_enabled", None) provisioning_state = kwargs.pop("provisioning_state", None) - super().__init__(name=name, description=description, tags=tags, properties=properties, **kwargs) + super().__init__( + name=name, + description=description, + tags=tags, + properties=properties, + **kwargs, + ) self.trigger = trigger self.display_name = display_name self._is_enabled: bool = is_enabled @@ -89,10 +121,14 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) + dump_yaml_to_file( + dest, yaml_serialized, default_flow_style=False, path=path, **kwargs + ) @classmethod - def _create_validation_error(cls, message: str, no_personal_data_message: str) -> ValidationException: + def _create_validation_error( + cls, message: str, no_personal_data_message: str + ) -> ValidationException: return ValidationException( message=message, no_personal_data_message=no_personal_data_message, @@ -100,7 +136,9 @@ def _create_validation_error(cls, message: str, no_personal_data_message: str) - ) @classmethod - def _resolve_cls_and_type(cls, data: Dict, params_override: Optional[List[Dict]] = None) -> Tuple: + def _resolve_cls_and_type( + cls, data: Dict, params_override: Optional[List[Dict]] = None + ) -> Tuple: from azure.ai.ml.entities._data_import.schedule import ImportDataSchedule from azure.ai.ml.entities._monitoring.schedule import MonitorSchedule @@ -113,7 +151,9 @@ def _resolve_cls_and_type(cls, data: Dict, params_override: Optional[List[Dict]] @property def create_job(self) -> Any: # pylint: disable=useless-return """The create_job entity associated with the schedule if exists.""" - module_logger.warning("create_job is not a valid property of %s", str(type(self))) + module_logger.warning( + "create_job is not a valid property of %s", str(type(self)) + ) # return None here just to be explicit return None @@ -124,7 +164,9 @@ def create_job(self, value: Any) -> None: # pylint: disable=unused-argument :param value: The create_job entity associated with the schedule if exists. :type value: Any """ - module_logger.warning("create_job is not a valid property of %s", str(type(self))) + module_logger.warning( + "create_job is not a valid property of %s", str(type(self)) + ) @property def is_enabled(self) -> bool: @@ -388,7 +430,11 @@ def _from_rest_object(cls, obj: RestSchedule) -> "JobSchedule": target=ErrorTarget.JOB, error_category=ErrorCategory.SYSTEM_ERROR, ) - if camel_to_snake(action.job_definition.job_type) not in [JobType.PIPELINE, JobType.COMMAND, JobType.SPARK]: + if camel_to_snake(action.job_definition.job_type) not in [ + JobType.PIPELINE, + JobType.COMMAND, + JobType.SPARK, + ]: msg = f"Unsupported job type {action.job_definition.job_type} for schedule '{{}}'." raise ScheduleException( message=msg.format(obj.name), @@ -438,7 +484,9 @@ def _to_rest_object(self) -> RestSchedule: # TODO: Update this after source job id move to JobBaseProperties # Rest pipeline job will hold a 'Default' as experiment_name, # MFE will add default if None, so pass an empty string here. - job_definition = RestPipelineJob(source_job_id=self.create_job, experiment_name="") + job_definition = RestPipelineJob( + source_job_id=self.create_job, experiment_name="" + ) job_definition["isArchived"] = False else: msg = "Unsupported job type '{}' in schedule {}." @@ -452,8 +500,18 @@ def _to_rest_object(self) -> RestSchedule: # branch builds a msrest RestPipelineJob; CommandJob already builds the shared arm_ml_service hybrid. # Convert any msrest job_definition to its camelCase wire dict so it fits inside the arm_ml_service # schedule envelope without changing the wire body. - if getattr(job_definition, "_is_model", False) is not True: + if getattr(job_definition, "_is_model", False) is not True and hasattr( + job_definition, "serialize" + ): job_definition = job_definition.serialize() + elif isinstance(self.create_job, PipelineJob): + # The arm_ml_service PipelineJob may still carry unresolved inline components in ``jobs`` + # (e.g. an offline entity whose component id has not been uploaded yet). The legacy msrest + # ``serialize`` stringified those; reproduce that with an ``as_dict`` + ``json`` round-trip + # using ``default=str`` so the arm hybrid ``SdkJSONEncoder`` never sees a non-model object. + job_definition = json.loads( + json.dumps(job_definition.as_dict(), default=str) + ) return RestSchedule( properties=ScheduleProperties( description=self.description, @@ -462,7 +520,9 @@ def _to_rest_object(self) -> RestSchedule: action=JobScheduleAction(job_definition=job_definition), display_name=self.display_name, is_enabled=self._is_enabled, - trigger=self.trigger._to_rest_object() if self.trigger is not None else None, + trigger=( + self.trigger._to_rest_object() if self.trigger is not None else None + ), ) ) @@ -475,7 +535,9 @@ def __str__(self) -> str: return res_jobSchedule # pylint: disable-next=docstring-missing-param - def _get_telemetry_values(self, *args: Any, **kwargs: Any) -> Dict[Literal["trigger_type"], str]: + def _get_telemetry_values( + self, *args: Any, **kwargs: Any + ) -> Dict[Literal["trigger_type"], str]: """Return the telemetry values of schedule. :return: A dictionary with telemetry values @@ -498,7 +560,9 @@ def __init__(self, **kwargs): self.schedule_action_type = kwargs.get("schedule_action_type", None) @classmethod - def _from_rest_object(cls, obj: RestTriggerRunSubmissionDto) -> "ScheduleTriggerResult": + def _from_rest_object( + cls, obj: RestTriggerRunSubmissionDto + ) -> "ScheduleTriggerResult": """Construct a ScheduleJob from a rest object. :param obj: The rest object to construct from. diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py index 35d0a721d73f..660696bb454f 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py @@ -4,6 +4,7 @@ from marshmallow import ValidationError from test_utilities.utils import omit_with_wildcard +from azure.core.serialization import as_attribute_dict from azure.ai.ml import Input, load_component from azure.ai.ml.constants._component import ComponentSource from azure.ai.ml.dsl import pipeline @@ -51,7 +52,7 @@ def condition_pipeline(): condition(condition=result.outputs.output, false_block=[node1, node2]) pipeline_job = condition_pipeline() - rest_pipeline_job = pipeline_job._to_rest_object().as_dict() + rest_pipeline_job = as_attribute_dict(pipeline_job._to_rest_object()) assert rest_pipeline_job["properties"]["jobs"]["conditionnode"] == { "_source": "DSL", "condition": "${{parent.jobs.result.outputs.output}}", @@ -73,12 +74,19 @@ def condition_pipeline(): node1 = hello_world_component_no_paths(component_in_number=1) node2 = hello_world_component_no_paths(component_in_number=2) # true block and false block has intersection - condition(condition=result.outputs.output, false_block=[node1, node2], true_block=[node1]) + condition( + condition=result.outputs.output, + false_block=[node1, node2], + true_block=[node1], + ) with pytest.raises(ValidationError) as e: pipeline_job = condition_pipeline() pipeline_job._validate(raise_error=True) - assert "True block and false block cannot contain same nodes: {'${{parent.jobs.node1}}'" in str(e.value) + assert ( + "True block and false block cannot contain same nodes: {'${{parent.jobs.node1}}'" + in str(e.value) + ) @pipeline(compute="cpu-cluster") def condition_pipeline(): @@ -86,7 +94,9 @@ def condition_pipeline(): node1 = hello_world_component_no_paths() node2 = hello_world_component_no_paths() # true block and false block has intersection - condition(condition=result.outputs.output, false_block=[node1], true_block=[node2]) + condition( + condition=result.outputs.output, false_block=[node1], true_block=[node2] + ) # no error raise pipeline_job = condition_pipeline() @@ -102,7 +112,9 @@ def test_create_dsl_condition_illegal_cases(self): node = condition(condition=1, true_block=basic_node) node._validate(raise_error=True) - assert f"must be an instance of {str}, {bool} or {InputOutputBase}" in str(e.value) + assert f"must be an instance of {str}, {bool} or {InputOutputBase}" in str( + e.value + ) node = condition(condition=basic_node.outputs.output3, true_block=basic_node) node._validate(raise_error=True) @@ -111,11 +123,15 @@ def test_create_dsl_condition_illegal_cases(self): node = condition(condition="${{parent.jobs.xxx.outputs.output}}") node._validate(raise_error=True) - assert "True block and false block cannot be empty at the same time." in str(e.value) + assert "True block and false block cannot be empty at the same time." in str( + e.value + ) with pytest.raises(ValidationError) as e: node = condition( - condition="${{parent.jobs.xxx.outputs.output}}", true_block=basic_node, false_block=basic_node + condition="${{parent.jobs.xxx.outputs.output}}", + true_block=basic_node, + false_block=basic_node, ) node._validate(raise_error=True) @@ -136,7 +152,9 @@ def test_condition_node(self): node2 = hello_world_component_no_paths() node2.name = "node2" control_node = condition( - condition="${{parent.jobs.condition_predicate.outputs.output}}", false_block=node1, true_block=node2 + condition="${{parent.jobs.condition_predicate.outputs.output}}", + false_block=node1, + true_block=node2, ) assert control_node._to_rest_object() == { "_source": "DSL", @@ -173,7 +191,9 @@ def condition_pipeline(): result = basic_component() node1 = hello_world_component_no_paths(component_in_number=1) node2 = hello_world_component_no_paths(component_in_number=2) - condition(condition=result.outputs.output, false_block=node1, true_block=node2) + condition( + condition=result.outputs.output, false_block=node1, true_block=node2 + ) pipeline_job = condition_pipeline() omit_fields = [ @@ -182,7 +202,9 @@ def condition_pipeline(): "properties.jobs.*.componentId", "properties.settings", ] - dsl_pipeline_job_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict(), *omit_fields) + dsl_pipeline_job_dict = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields + ) assert dsl_pipeline_job_dict["properties"]["jobs"] == { "conditionnode": { "_source": "DSL", @@ -193,17 +215,25 @@ def condition_pipeline(): }, "node1": { "_source": "YAML.COMPONENT", - "inputs": {"component_in_number": {"job_input_type": "literal", "value": "1"}}, + "inputs": { + "component_in_number": {"job_input_type": "literal", "value": "1"} + }, "name": "node1", "type": "command", }, "node2": { "_source": "YAML.COMPONENT", - "inputs": {"component_in_number": {"job_input_type": "literal", "value": "2"}}, + "inputs": { + "component_in_number": {"job_input_type": "literal", "value": "2"} + }, "name": "node2", "type": "command", }, - "result": {"_source": "YAML.COMPONENT", "name": "result", "type": "command"}, + "result": { + "_source": "YAML.COMPONENT", + "name": "result", + "type": "command", + }, } def test_condition_with_group_input(self): @@ -226,19 +256,28 @@ def condition_pipeline(group_input: ParentGroup): node1 = hello_world_component_no_paths(component_in_number=1) condition(condition=group_input.input_group.num < 100, true_block=node1) - pipeline_job = condition_pipeline(group_input=ParentGroup(input_group=SubGroup(num=10))) + pipeline_job = condition_pipeline( + group_input=ParentGroup(input_group=SubGroup(num=10)) + ) omit_fields = [ "name", "properties.display_name", "properties.jobs.*.componentId", "properties.settings", ] - dsl_pipeline_job_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict(), *omit_fields) + dsl_pipeline_job_dict = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields + ) assert dsl_pipeline_job_dict["properties"]["jobs"]["expression_component"] == { "environment_variables": {"AZURE_ML_CLI_PRIVATE_FEATURES_ENABLED": "true"}, "name": "expression_component", "type": "command", - "inputs": {"num": {"job_input_type": "literal", "value": "${{parent.inputs.group_input.input_group.num}}"}}, + "inputs": { + "num": { + "job_input_type": "literal", + "value": "${{parent.inputs.group_input.input_group.num}}", + } + }, "_source": "YAML.COMPONENT", } @@ -359,8 +398,12 @@ def pipeline_with_do_while( def validate_error_message(expect_errors, validate_errors): for path, msg in expect_errors.items(): - acture_errors = list(filter(lambda error: error["path"] == path, validate_errors)) - assert acture_errors, f"Cannot find the error of {path} in validation results." + acture_errors = list( + filter(lambda error: error["path"] == path, validate_errors) + ) + assert ( + acture_errors + ), f"Cannot find the error of {path} in validation results." for acture_error in acture_errors: assert acture_error["message"] in msg @@ -369,7 +412,9 @@ def validate_error_message(expect_errors, validate_errors): "jobs.out_of_max_iteration_count_range.limit.max_iteration_count": [ "The max iteration count cannot be less than 0 or larger than 1000." ], - "jobs.body_in_other_loop.body": ["The body of loop node cannot be promoted as another loop again."], + "jobs.body_in_other_loop.body": [ + "The body of loop node cannot be promoted as another loop again." + ], "jobs.invalid_mapping.condition": [ "is_number_larger_than_zero is the output of do_while_body_pipeline_1, dowhile only accept output of the body: do_while_body_pipeline_3." ], @@ -386,7 +431,9 @@ def validate_error_message(expect_errors, validate_errors): def test_infer_dynamic_input_type_from_mapping(self): # Pass None to dynamic input in do-while loop body, and provide it in mapping for next iteration, # which is a valid case in federated learning. - from test_configs.dsl_pipeline.dynamic_input_do_while.pipeline import pipeline_job + from test_configs.dsl_pipeline.dynamic_input_do_while.pipeline import ( + pipeline_job, + ) assert pipeline_job._customized_validate().passed # assert input type of loop body, should both have type now @@ -416,10 +463,13 @@ def invalid_pipeline(test_path1, test_path2): ) with pytest.raises(ValidationException) as e: - invalid_pipeline(test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2")) + invalid_pipeline( + test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2") + ) assert ( "Expecting (, " - ") for body" in str(e.value) + ") for body" + in str(e.value) ) # items with invalid type @@ -452,7 +502,10 @@ def invalid_pipeline(): ), ( # item meta not match - [{"component_in_path": "test_path1"}, {"component_in_path": "test_path2", "component_in_number": 1}], + [ + {"component_in_path": "test_path1"}, + {"component_in_path": "test_path2", "component_in_number": 1}, + ], "Items should have same keys with body inputs, but got ", ), ( @@ -476,7 +529,13 @@ def invalid_pipeline(): ), ( # local file input - [{"component_in_path": Input(path="./tests/test_configs/components/helloworld_component.yml")}], + [ + { + "component_in_path": Input( + path="./tests/test_configs/components/helloworld_component.yml" + ) + } + ], "Local file input", ), ( @@ -491,8 +550,12 @@ def invalid_pipeline(): ), ], ) - def test_dsl_parallel_for_pipeline_illegal_items_content(self, items, error_message): - basic_component = load_component(source="./tests/test_configs/components/helloworld_component.yml") + def test_dsl_parallel_for_pipeline_illegal_items_content( + self, items, error_message + ): + basic_component = load_component( + source="./tests/test_configs/components/helloworld_component.yml" + ) @pipeline def invalid_pipeline(): @@ -515,7 +578,9 @@ def invalid_pipeline(): ), ) def test_dsl_parallel_for_pipeline_legal_items_content(self, items): - basic_component = load_component(source="./tests/test_configs/components/helloworld_component.yml") + basic_component = load_component( + source="./tests/test_configs/components/helloworld_component.yml" + ) @pipeline def valid_pipeline(): @@ -530,8 +595,12 @@ def valid_pipeline(): def test_dsl_parallel_for_pipeline_items(self): # TODO: submit those pipelines - basic_component = load_component(source="./tests/test_configs/components/helloworld_component.yml") - complex_component = load_component(source="./tests/test_configs/components/input_types_component.yml") + basic_component = load_component( + source="./tests/test_configs/components/helloworld_component.yml" + ) + complex_component = load_component( + source="./tests/test_configs/components/input_types_component.yml" + ) # binding in items @@ -540,11 +609,16 @@ def my_pipeline(test_path1, test_path2): body = basic_component() parallel_for( body=body, - items=[{"component_in_path": test_path1}, {"component_in_path": test_path2}], + items=[ + {"component_in_path": test_path1}, + {"component_in_path": test_path2}, + ], ) - my_job = my_pipeline(test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2")) - rest_job = my_job._to_rest_object().as_dict() + my_job = my_pipeline( + test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2") + ) + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert ( rest_items == '[{"component_in_path": "${{parent.inputs.test_path1}}"}, ' @@ -555,12 +629,21 @@ def my_pipeline(test_path1, test_path2): @pipeline def my_pipeline(): body = basic_component(component_in_path=Input(path="test_path1")) - parallel_for(body=body, items={"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}}) + parallel_for( + body=body, + items={ + "iter1": {"component_in_number": 1}, + "iter2": {"component_in_number": 2}, + }, + ) my_job = my_pipeline() - rest_job = my_job._to_rest_object().as_dict() + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] - assert rest_items == '{"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}}' + assert ( + rest_items + == '{"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}}' + ) # binding items @pipeline @@ -568,8 +651,10 @@ def my_pipeline(pipeline_input: str): body = basic_component(component_in_path=Input(path="test_path1")) parallel_for(body=body, items=pipeline_input) - my_job = my_pipeline(pipeline_input='[{"component_in_number": 1}, {"component_in_number": 2}]') - rest_job = my_job._to_rest_object().as_dict() + my_job = my_pipeline( + pipeline_input='[{"component_in_number": 1}, {"component_in_number": 2}]' + ) + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert rest_items == "${{parent.inputs.pipeline_input}}" @@ -577,10 +662,13 @@ def my_pipeline(pipeline_input: str): @pipeline def my_pipeline(): body = basic_component(component_in_path=Input(path="test_path1")) - parallel_for(body=body, items='[{"component_in_number": 1}, {"component_in_number": 2}]') + parallel_for( + body=body, + items='[{"component_in_number": 1}, {"component_in_number": 2}]', + ) my_job = my_pipeline() - rest_job = my_job._to_rest_object().as_dict() + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert rest_items == '[{"component_in_number": 1}, {"component_in_number": 2}]' @@ -602,7 +690,7 @@ def my_pipeline(): ) my_job = my_pipeline() - rest_job = my_job._to_rest_object().as_dict() + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert ( rest_items == '[{"component_in_string": "component_in_string", ' @@ -614,30 +702,70 @@ def my_pipeline(): @pipeline def my_pipeline(): body = basic_component(component_in_path=Input(path="test_path1")) - parallel_for(body=body, items='[{"component_in_number": 1}, {"component_in_number": 2}]') + parallel_for( + body=body, + items='[{"component_in_number": 1}, {"component_in_number": 2}]', + ) my_job = my_pipeline() - rest_job = my_job._to_rest_object().as_dict() + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert rest_items == '[{"component_in_number": 1}, {"component_in_number": 2}]' @pytest.mark.parametrize( "output_dict, pipeline_out_dict, component_out_dict, check_pipeline_job", [ - ({"type": "uri_file"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), - ({"type": "uri_folder"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), - ({"type": "mltable"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), - ({"type": "mlflow_model"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), - ({"type": "triton_model"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), - ({"type": "custom_model"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), - ({"type": "path"}, {"job_output_type": "mltable"}, {"type": "mltable"}, True), + ( + {"type": "uri_file"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), + ( + {"type": "uri_folder"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), + ( + {"type": "mltable"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), + ( + {"type": "mlflow_model"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), + ( + {"type": "triton_model"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), + ( + {"type": "custom_model"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), + ( + {"type": "path"}, + {"job_output_type": "mltable"}, + {"type": "mltable"}, + True, + ), ({"type": "number"}, {}, {"type": "string"}, False), ({"type": "string"}, {}, {"type": "string"}, False), ({"type": "boolean"}, {}, {"type": "string"}, False), ({"type": "integer"}, {}, {"type": "string"}, False), ], ) - def test_parallel_for_outputs(self, output_dict, pipeline_out_dict, component_out_dict, check_pipeline_job): + def test_parallel_for_outputs( + self, output_dict, pipeline_out_dict, component_out_dict, check_pipeline_job + ): basic_component = load_component( source="./tests/test_configs/components/helloworld_component.yml", params_override=[{"outputs.component_out_path": output_dict}], @@ -648,20 +776,26 @@ def my_pipeline(): body = basic_component(component_in_path=Input(path="test_path1")) foreach_node = parallel_for( - body=body, items={"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}} + body=body, + items={ + "iter1": {"component_in_number": 1}, + "iter2": {"component_in_number": 2}, + }, ) return {"output": foreach_node.outputs.component_out_path} my_job = my_pipeline() if check_pipeline_job: - rest_job = my_job._to_rest_object().as_dict() + rest_job = as_attribute_dict(my_job._to_rest_object()) rest_outputs = rest_job["properties"]["outputs"] assert rest_outputs == {"output": pipeline_out_dict} pipeline_component = my_job.component rest_component = pipeline_component._to_rest_object().as_dict() - assert rest_component["properties"]["componentSpec"]["outputs"] == {"output": component_out_dict} + assert rest_component["properties"]["componentSpec"]["outputs"] == { + "output": component_out_dict + } def test_parallel_for_source(self): basic_component = load_component( @@ -673,7 +807,11 @@ def my_pipeline(): body = basic_component(component_in_path=Input(path="test_path1")) foreach_node = parallel_for( - body=body, items={"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}} + body=body, + items={ + "iter1": {"component_in_number": 1}, + "iter2": {"component_in_number": 2}, + }, ) my_job = my_pipeline() @@ -699,7 +837,11 @@ def my_pipeline(): ( # asset input with uri { - "silo1": {"uri": Input(path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv")}, + "silo1": { + "uri": Input( + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv" + ) + }, }, '{"silo1": {"uri": {"uri": "https://dprepdata.blob.core.windows.net/demo/Titanic.csv", ' '"job_input_type": "uri_folder"}}}', @@ -707,7 +849,11 @@ def my_pipeline(): ( # asset input binding { - "silo1": {"binding": PipelineInput(name="input1", owner="pipeline", meta=None)}, + "silo1": { + "binding": PipelineInput( + name="input1", owner="pipeline", meta=None + ) + }, }, '{"silo1": {"binding": "${{parent.inputs.input1}}"}}', ), @@ -743,7 +889,13 @@ def test_to_rest_items(self, items, rest_input_str): ), ( # local file input - [{"component_in_path": Input(path="./tests/test_configs/components/helloworld_component.yml")}], + [ + { + "component_in_path": Input( + path="./tests/test_configs/components/helloworld_component.yml" + ) + } + ], "Local file input", ), ( diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py index ac722ff23602..a5851920740f 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py @@ -1,3 +1,4 @@ +import json import logging import os from io import StringIO @@ -9,7 +10,11 @@ import pydash import pytest from test_configs.dsl_pipeline import data_binding_expression -from test_utilities.utils import assert_job_cancel, omit_with_wildcard, prepare_dsl_curated +from test_utilities.utils import ( + assert_job_cancel, + omit_with_wildcard, + prepare_dsl_curated, +) from azure.ai.ml import ( AmlTokenConfiguration, @@ -29,6 +34,7 @@ ComponentContainerProperties as ComponentContainerDetails, SystemData, ) +from azure.core.serialization import as_attribute_dict from azure.ai.ml.constants._common import ( AZUREML_PRIVATE_FEATURES_ENV_VAR, AZUREML_RESOURCE_PROVIDER, @@ -49,7 +55,9 @@ ) from azure.ai.ml.entities._builders import Command, DataTransferCopy, Spark from azure.ai.ml.entities._job.pipeline._io import PipelineInput -from azure.ai.ml.entities._job.pipeline._load_component import _generate_component_function +from azure.ai.ml.entities._job.pipeline._load_component import ( + _generate_component_function, +) from azure.ai.ml.exceptions import ( MultipleValueError, ParamValueNotExistsError, @@ -64,7 +72,9 @@ components_dir = tests_root_dir / "test_configs/components/" -@pytest.mark.usefixtures("enable_pipeline_private_preview_features", "enable_private_preview_schema_features") +@pytest.mark.usefixtures( + "enable_pipeline_private_preview_features", "enable_private_preview_schema_features" +) @pytest.mark.timeout(_DSL_TIMEOUT_SECOND) @pytest.mark.unittest @pytest.mark.pipeline_test @@ -75,18 +85,24 @@ def test_dsl_pipeline(self) -> None: @dsl.pipeline() def pipeline_no_arg(): component_func = load_component(source=path) - component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline1 = pipeline_no_arg() assert len(pipeline1.component.jobs) == 1, pipeline1.component.jobs def test_dsl_pipeline_name_and_display_name(self): - hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" + hello_world_component_yaml = ( + "./tests/test_configs/components/helloworld_component.yml" + ) hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() def sample_pipeline_with_no_annotation(): - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline_with_no_annotation() assert pipeline.component.name == "sample_pipeline_with_no_annotation" @@ -96,7 +112,9 @@ def sample_pipeline_with_no_annotation(): @dsl.pipeline(name="hello_world_component") def sample_pipeline_with_name(): - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline_with_name() assert pipeline.component.name == "hello_world_component" @@ -106,7 +124,9 @@ def sample_pipeline_with_name(): @dsl.pipeline(display_name="my_component") def sample_pipeline_with_display_name(): - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline_with_display_name() assert pipeline.component.name == "sample_pipeline_with_display_name" @@ -116,7 +136,9 @@ def sample_pipeline_with_display_name(): @dsl.pipeline(name="hello_world_component", display_name="my_component") def sample_pipeline_with_name_and_display_name(): - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline_with_name_and_display_name() assert pipeline.component.name == "hello_world_component" @@ -125,12 +147,16 @@ def sample_pipeline_with_name_and_display_name(): assert pipeline.display_name == pipeline.component.display_name def test_dsl_pipeline_description(self): - hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" + hello_world_component_yaml = ( + "./tests/test_configs/components/helloworld_component.yml" + ) hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() def sample_pipeline(): - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline() assert pipeline.component.description is None @@ -139,7 +165,9 @@ def sample_pipeline(): @dsl.pipeline() def sample_pipeline_with_docstring(): """Docstring for sample pipeline""" - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline_with_docstring() assert pipeline.component.description == "Docstring for sample pipeline" @@ -148,7 +176,9 @@ def sample_pipeline_with_docstring(): @dsl.pipeline(description="Top description for sample pipeline") def sample_pipeline_with_description_and_docstring(): """Docstring for sample pipeline""" - hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) pipeline = sample_pipeline_with_description_and_docstring() assert pipeline.component.description == "Top description for sample pipeline" @@ -170,23 +200,39 @@ def sample_pipeline_with_detailed_docstring(job_in_path, job_in_number): Other docstring xxxxxx random_key: random_value """ - node = hello_world_component_func(component_in_path=job_in_path, component_in_number=job_in_number) + node = hello_world_component_func( + component_in_path=job_in_path, component_in_number=job_in_number + ) return {"job_out_path": node.outputs.component_out_path} - pipeline = sample_pipeline_with_detailed_docstring(Input(path="/a/path/on/ds"), 1) - assert pipeline.component.description.startswith("A pipeline with detailed docstring") - assert pipeline.component.inputs["job_in_path"]["description"] == "a path parameter with multi-line description" - assert pipeline.component.inputs["job_in_number"]["description"] == "a number parameter" + pipeline = sample_pipeline_with_detailed_docstring( + Input(path="/a/path/on/ds"), 1 + ) + assert pipeline.component.description.startswith( + "A pipeline with detailed docstring" + ) + assert ( + pipeline.component.inputs["job_in_path"]["description"] + == "a path parameter with multi-line description" + ) + assert ( + pipeline.component.inputs["job_in_number"]["description"] + == "a number parameter" + ) assert pipeline.component.outputs["job_out_path"].description == "a path output" assert pipeline.description == pipeline.component.description def test_dsl_pipeline_comment(self) -> None: - hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" + hello_world_component_yaml = ( + "./tests/test_configs/components/helloworld_component.yml" + ) hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline def sample_pipeline_with_comment(): - node = hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) + node = hello_world_component_func( + component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 + ) node.comment = "arbitrary string" pipeline = sample_pipeline_with_comment() @@ -206,7 +252,9 @@ def pipeline(number, path): assert pipeline1._build_inputs().keys() == {"number", "path"} # un-configured output will have type of bounded node output - assert pipeline1._build_outputs() == {"pipeline_output": Output(type="uri_folder")} + assert pipeline1._build_outputs() == { + "pipeline_output": Output(type="uri_folder") + } # after setting mode, default output with type Input is built pipeline1.outputs.pipeline_output.mode = "download" @@ -217,11 +265,17 @@ def pipeline(number, path): component_node = component_nodes[0] assert component_node._build_inputs() == { - "component_in_number": Input(path="${{parent.inputs.number}}", type="uri_folder", mode=None), - "component_in_path": Input(path="${{parent.inputs.path}}", type="uri_folder", mode=None), + "component_in_number": Input( + path="${{parent.inputs.number}}", type="uri_folder", mode=None + ), + "component_in_path": Input( + path="${{parent.inputs.path}}", type="uri_folder", mode=None + ), } assert component_node._build_outputs() == { - "component_out_path": Output(path="${{parent.outputs.pipeline_output}}", type="uri_folder", mode=None) + "component_out_path": Output( + path="${{parent.outputs.pipeline_output}}", type="uri_folder", mode=None + ) } # Test Input as pipeline input @@ -233,28 +287,40 @@ def pipeline(number, path): component_node = component_nodes[0] assert component_node._build_inputs() == { - "component_in_number": Input(path="${{parent.inputs.number}}", type="uri_folder", mode=None), - "component_in_path": Input(path="${{parent.inputs.path}}", type="uri_folder", mode=None), + "component_in_number": Input( + path="${{parent.inputs.number}}", type="uri_folder", mode=None + ), + "component_in_path": Input( + path="${{parent.inputs.path}}", type="uri_folder", mode=None + ), } - @pytest.mark.parametrize("output_type", ["uri_file", "mltable", "mlflow_model", "triton_model", "custom_model"]) + @pytest.mark.parametrize( + "output_type", + ["uri_file", "mltable", "mlflow_model", "triton_model", "custom_model"], + ) def test_dsl_pipeline_output_type(self, output_type): yaml_file = "./tests/test_configs/components/helloworld_component.yml" @dsl.pipeline() def pipeline(number, path): component_func = load_component( - source=yaml_file, params_override=[{"outputs.component_out_path.type": output_type}] + source=yaml_file, + params_override=[{"outputs.component_out_path.type": output_type}], ) node1 = component_func(component_in_number=number, component_in_path=path) return {"pipeline_output": node1.outputs.component_out_path} pipeline1 = pipeline(10, Input(path="/a/path/on/ds")) # un-configured output will have type of bound output - assert pipeline1._build_outputs() == {"pipeline_output": Output(type=output_type)} + assert pipeline1._build_outputs() == { + "pipeline_output": Output(type=output_type) + } def test_dsl_pipeline_complex_input_output(self) -> None: - yaml_file = "./tests/test_configs/components/helloworld_component_multiple_data.yml" + yaml_file = ( + "./tests/test_configs/components/helloworld_component_multiple_data.yml" + ) @dsl.pipeline() def pipeline( @@ -307,7 +373,9 @@ def pipeline( job_yaml = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_data_options.yml" pipeline_job: PipelineJob = load_job(source=job_yaml) - pipeline = pipeline(**{key: val for key, val in pipeline_job._build_inputs().items()}) + pipeline = pipeline( + **{key: val for key, val in pipeline_job._build_inputs().items()} + ) pipeline.inputs.job_in_data_by_store_path_and_mount.mode = "ro_mount" pipeline.inputs.job_in_data_by_store_path_and_download.mode = "download" pipeline.inputs.job_in_data_name_version_mode_download.mode = "download" @@ -349,23 +417,31 @@ def test_dsl_pipeline_to_job(self) -> None: experiment_name="my_first_experiment", ) def pipeline(job_in_number, job_in_other_number, job_in_path): - hello_world_component = component_func(component_in_number=job_in_number, component_in_path=job_in_path) + hello_world_component = component_func( + component_in_number=job_in_number, component_in_path=job_in_path + ) hello_world_component.compute = "cpu-cluster" - hello_world_component._component._id = "microsoftsamplesCommandComponentBasic_second:1" + hello_world_component._component._id = ( + "microsoftsamplesCommandComponentBasic_second:1" + ) hello_world_component_2 = component_func( component_in_number=job_in_other_number, component_in_path=job_in_path ) - hello_world_component_2._component._id = "microsoftsamplesCommandComponentBasic_second:1" + hello_world_component_2._component._id = ( + "microsoftsamplesCommandComponentBasic_second:1" + ) hello_world_component_2.compute = "cpu-cluster" pipeline = pipeline(10, 15, Input(path="./tests/test_configs/data")) pipeline.inputs.job_in_path.mode = "mount" - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) job_yaml = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job.yml" - pipeline_job_dict = load_job(source=job_yaml)._to_rest_object().as_dict() + pipeline_job_dict = as_attribute_dict( + load_job(source=job_yaml)._to_rest_object() + ) omit_fields = [ "name", @@ -379,7 +455,9 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): assert dsl_pipeline_job_dict == pipeline_job_dict def test_dsl_pipeline_with_settings_and_overrides(self): - component_yaml = "./tests/test_configs/components/helloworld_component_no_paths.yml" + component_yaml = ( + "./tests/test_configs/components/helloworld_component_no_paths.yml" + ) component_func = load_component(source=component_yaml) @dsl.pipeline( @@ -393,15 +471,24 @@ def test_dsl_pipeline_with_settings_and_overrides(self): def pipeline(job_in_number, job_in_other_number, job_in_string): hello_world_component = component_func(component_in_number=job_in_number) hello_world_component.compute = "cpu-cluster" - hello_world_component._component._id = "microsoftsamplescommandcomponentbasic_nopaths_test:1" + hello_world_component._component._id = ( + "microsoftsamplescommandcomponentbasic_nopaths_test:1" + ) - hello_world_component_2 = component_func(component_in_number=job_in_other_number) - hello_world_component_2._component._id = "microsoftsamplescommandcomponentbasic_nopaths_test:1" + hello_world_component_2 = component_func( + component_in_number=job_in_other_number + ) + hello_world_component_2._component._id = ( + "microsoftsamplescommandcomponentbasic_nopaths_test:1" + ) hello_world_component_2.compute = "cpu-cluster" # set overrides for component job hello_world_component_2.resources = JobResourceConfiguration() hello_world_component_2.resources.instance_count = 2 - hello_world_component_2.resources.properties = {"prop1": "a_prop", "prop2": "another_prop"} + hello_world_component_2.resources.properties = { + "prop1": "a_prop", + "prop2": "another_prop", + } hello_world_component_2.distribution = MpiDistribution() hello_world_component_2.distribution.process_count_per_instance = 2 hello_world_component_2.additional_override.nested_override = 5 @@ -411,18 +498,29 @@ def pipeline(job_in_number, job_in_other_number, job_in_string): # set experiment name and settings when submit pipeline_job = pipeline - dsl_pipeline_job_dict = pipeline_job._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline_job._to_rest_object()) - job_yaml = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" - pipeline_job_dict = load_job(source=job_yaml)._to_rest_object().as_dict() + job_yaml = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + ) + pipeline_job_dict = as_attribute_dict( + load_job(source=job_yaml)._to_rest_object() + ) - omit_fields = ["name", "properties.display_name", "properties.jobs.*._source", "properties.settings._source"] + omit_fields = [ + "name", + "properties.display_name", + "properties.jobs.*._source", + "properties.settings._source", + ] dsl_pipeline_job = omit_with_wildcard(dsl_pipeline_job_dict, *omit_fields) yaml_pipeline_job = omit_with_wildcard(pipeline_job_dict, *omit_fields) assert dsl_pipeline_job == yaml_pipeline_job def test_pipeline_variable_name(self): - component_yaml = "./tests/test_configs/components/helloworld_component_no_paths.yml" + component_yaml = ( + "./tests/test_configs/components/helloworld_component_no_paths.yml" + ) component_func1 = load_component(source=component_yaml) component_yaml = "./tests/test_configs/components/helloworld_component.yml" component_func2 = load_component(source=component_yaml) @@ -431,8 +529,14 @@ def test_pipeline_variable_name(self): def pipeline_with_default_node_name(): component_func1(component_in_number=1) component_func1(component_in_number=1) - component_func2(component_in_number=1, component_in_path=Input(path="./tests/test_configs/data")) - component_func2(component_in_number=1, component_in_path=Input(path="./tests/test_configs/data")) + component_func2( + component_in_number=1, + component_in_path=Input(path="./tests/test_configs/data"), + ) + component_func2( + component_in_number=1, + component_in_path=Input(path="./tests/test_configs/data"), + ) pipeline = pipeline_with_default_node_name() variable_names = list(pipeline.component.jobs.keys()) @@ -596,13 +700,17 @@ def pipeline_with_user_defined_nodes_1(): node2.name = f"Another_{i}" pipeline_job = pipeline_with_user_defined_nodes_1() - rest_pipeline_job = pipeline_job._to_rest_object().as_dict() - assert rest_pipeline_job["properties"]["jobs"]["another_0"]["inputs"]["component_in_path"] == { + rest_pipeline_job = as_attribute_dict(pipeline_job._to_rest_object()) + assert rest_pipeline_job["properties"]["jobs"]["another_0"]["inputs"][ + "component_in_path" + ] == { "job_input_type": "literal", "mode": "Direct", "value": "${{parent.jobs.dummy_0.outputs.component_out_path}}", } - assert rest_pipeline_job["properties"]["jobs"]["another_1"]["inputs"]["component_in_path"] == { + assert rest_pipeline_job["properties"]["jobs"]["another_1"]["inputs"][ + "component_in_path" + ] == { "job_input_type": "literal", "mode": "Direct", "value": "${{parent.jobs.dummy_1.outputs.component_out_path}}", @@ -612,8 +720,12 @@ def test_connect_components_in_pipeline(self): hello_world_component_yaml = "./tests/test_configs/components/helloworld_component_with_input_and_output.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) - merge_outputs_component_yaml = "./tests/test_configs/components/merge_outputs_component.yml" - merge_outputs_component_func = load_component(source=merge_outputs_component_yaml) + merge_outputs_component_yaml = ( + "./tests/test_configs/components/merge_outputs_component.yml" + ) + merge_outputs_component_func = load_component( + source=merge_outputs_component_yaml + ) @dsl.pipeline( name="simplePipelineJobWithComponentOutput", @@ -650,22 +762,26 @@ def pipeline(job_in_number, job_in_path): "job_out_path_2": merge_component_outputs.outputs.component_out_path_2, } - pipeline = pipeline(10, Input(path="./tests/test_configs/data", mode="ro_mount")) + pipeline = pipeline( + 10, Input(path="./tests/test_configs/data", mode="ro_mount") + ) pipeline.outputs.job_out_path_1.mode = "mount" pipeline.outputs.job_out_path_2.mode = "Upload" - dsl_pipeline_job = pipeline._to_rest_object().as_dict() + dsl_pipeline_job = as_attribute_dict(pipeline._to_rest_object()) yaml_job_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_component_output.yml" - yaml_pipeline_job = ( + yaml_pipeline_job = as_attribute_dict( load_job( yaml_job_path, params_override=[ - {"jobs.hello_world_component_1.inputs.component_in_path": "${{parent.inputs.job_in_path}}"}, - {"jobs.hello_world_component_2.inputs.component_in_path": "${{parent.inputs.job_in_path}}"}, + { + "jobs.hello_world_component_1.inputs.component_in_path": "${{parent.inputs.job_in_path}}" + }, + { + "jobs.hello_world_component_2.inputs.component_in_path": "${{parent.inputs.job_in_path}}" + }, ], - ) - ._to_rest_object() - .as_dict() + )._to_rest_object() ) omit_fields = [ @@ -683,11 +799,17 @@ def pipeline(job_in_number, job_in_path): assert dsl_pipeline_job == yaml_pipeline_job def test_same_pipeline_via_dsl_or_curated_sdk(self): - hello_world_component_yaml_path = "./tests/test_configs/components/helloworld_component.yml" - merge_outputs_component_yaml_path = "./tests/test_configs/components/merge_outputs_component.yml" + hello_world_component_yaml_path = ( + "./tests/test_configs/components/helloworld_component.yml" + ) + merge_outputs_component_yaml_path = ( + "./tests/test_configs/components/merge_outputs_component.yml" + ) # Define pipeline job via curated SDK YAML - pipeline_job_from_yaml = load_job(source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml") + pipeline_job_from_yaml = load_job( + source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml" + ) # Define pipeline job via curated SDK code pipeline_job = PipelineJob( @@ -744,9 +866,13 @@ def test_same_pipeline_via_dsl_or_curated_sdk(self): ) # Define pipeline job via DSL - hello_world_component_func = load_component(source=hello_world_component_yaml_path) + hello_world_component_func = load_component( + source=hello_world_component_yaml_path + ) - merge_outputs_component_func = load_component(source=merge_outputs_component_yaml_path) + merge_outputs_component_func = load_component( + source=merge_outputs_component_yaml_path + ) @dsl.pipeline( name="SimplePipelineJob", @@ -787,9 +913,11 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): dsl_pipeline = pipeline(10, 15, Input(path="./tests/test_configs/data")) dsl_pipeline.outputs.job_out_data_1.mode = "mount" dsl_pipeline.outputs.job_out_data_2.mode = "Upload" - pipeline_job_from_yaml = pipeline_job_from_yaml._to_rest_object().as_dict() - pipeline_job = pipeline_job._to_rest_object().as_dict() - dsl_pipeline = dsl_pipeline._to_rest_object().as_dict() + pipeline_job_from_yaml = as_attribute_dict( + pipeline_job_from_yaml._to_rest_object() + ) + pipeline_job = as_attribute_dict(pipeline_job._to_rest_object()) + dsl_pipeline = as_attribute_dict(dsl_pipeline._to_rest_object()) omit_fields = [ "name", "properties.display_name", @@ -800,7 +928,9 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): "properties.inputs.job_in_path.uri", "properties.settings", ] - pipeline_job_from_yaml = omit_with_wildcard(pipeline_job_from_yaml, *omit_fields) + pipeline_job_from_yaml = omit_with_wildcard( + pipeline_job_from_yaml, *omit_fields + ) pipeline_job = omit_with_wildcard(pipeline_job, *omit_fields) dsl_pipeline = omit_with_wildcard(dsl_pipeline, *omit_fields) @@ -813,7 +943,10 @@ def test_pipeline_with_comma_after_pipeline_input_brackets(self): @dsl.pipeline() def pipeline(component_in_number, component_in_path): component_func = load_component(source=path) - component_func(component_in_number=component_in_number, component_in_path=component_in_path) + component_func( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) test_job_input = (Input(path="azureml:fake_data:1"),) with pytest.raises(UserErrorException) as ex: @@ -830,26 +963,31 @@ def test_dsl_pipeline_multi_times(self): @dsl.pipeline() def pipeline(number, path): node1 = component_func(component_in_number=number, component_in_path=path) - node2 = component_func(component_in_number=number, component_in_path=node1.outputs.component_out_path) + node2 = component_func( + component_in_number=number, + component_in_path=node1.outputs.component_out_path, + ) return {"pipeline_output": node2.outputs.component_out_path} data = Input(type=AssetTypes.URI_FOLDER, path="/a/path/on/ds") omit_fields = ["name"] pipeline1 = pipeline(10, data) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = pydash.omit(pipeline_job1, omit_fields) pipeline2 = pipeline(10, data) - pipeline_job2 = pipeline2._to_rest_object().as_dict() + pipeline_job2 = as_attribute_dict(pipeline2._to_rest_object()) pipeline_job2 = pydash.omit(pipeline_job2, omit_fields) pipeline3 = pipeline(10, data) - pipeline_job3 = pipeline3._to_rest_object().as_dict() + pipeline_job3 = as_attribute_dict(pipeline3._to_rest_object()) pipeline_job3 = pydash.omit(pipeline_job3, omit_fields) assert pipeline_job1 == pipeline_job2 assert pipeline_job2 == pipeline_job3 def test_component_source(self): - from azure.ai.ml.dsl._pipeline_component_builder import _add_component_to_current_definition_builder + from azure.ai.ml.dsl._pipeline_component_builder import ( + _add_component_to_current_definition_builder, + ) def mock_add_to_builder(component): _add_component_to_current_definition_builder(component) @@ -861,18 +999,26 @@ def mock_add_to_builder(component): # DSL yaml_file = "./tests/test_configs/components/helloworld_component.yml" - component_entity = load_component(source=yaml_file, params_override=[{"name": "hello_world_component_1"}]) + component_entity = load_component( + source=yaml_file, params_override=[{"name": "hello_world_component_1"}] + ) component_func = _generate_component_function(component_entity) - job_in_number = PipelineInput(name="job_in_number", owner="pipeline", meta=None) + job_in_number = PipelineInput( + name="job_in_number", owner="pipeline", meta=None + ) job_in_path = PipelineInput(name="job_in_path", owner="pipeline", meta=None) - component_from_dsl = component_func(component_in_number=job_in_number, component_in_path=job_in_path) + component_from_dsl = component_func( + component_in_number=job_in_number, component_in_path=job_in_path + ) component_from_dsl.compute = "cpu-cluster" component_from_dsl.outputs.component_out_path.mode = "upload" component_from_dsl.name = "hello_world_component_1" # YAML - pipeline = load_job(source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml") + pipeline = load_job( + source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml" + ) component_from_yaml = pipeline.jobs["hello_world_component_1"] # REST @@ -915,21 +1061,46 @@ def mock_add_to_builder(component): "_source": "YAML.COMPONENT", "computeId": "cpu-cluster", "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_number}}"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_number": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_number}}", + }, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "hello_world_component_1", - "outputs": {"component_out_path": {"job_output_type": "uri_folder", "mode": "Upload"}}, + "outputs": { + "component_out_path": { + "job_output_type": "uri_folder", + "mode": "Upload", + } + }, "type": "command", } omit_fields = ["componentId", "properties"] - assert pydash.omit(component_from_dsl._to_rest_object(), *omit_fields) == expected_component - assert pydash.omit(component_from_sdk._to_rest_object(), *omit_fields) == expected_component - assert pydash.omit(component_from_rest._to_rest_object(), *omit_fields) == expected_component + assert ( + pydash.omit(component_from_dsl._to_rest_object(), *omit_fields) + == expected_component + ) + assert ( + pydash.omit(component_from_sdk._to_rest_object(), *omit_fields) + == expected_component + ) + assert ( + pydash.omit(component_from_rest._to_rest_object(), *omit_fields) + == expected_component + ) expected_component.update({"_source": "YAML.JOB"}) - assert pydash.omit(component_from_yaml._to_rest_object(), *omit_fields) == expected_component + assert ( + pydash.omit(component_from_yaml._to_rest_object(), *omit_fields) + == expected_component + ) - def assert_component_reuse(self, pipeline, expected_component_num, mock_machinelearning_client: MLClient): + def assert_component_reuse( + self, pipeline, expected_component_num, mock_machinelearning_client: MLClient + ): def mock_arm_id(asset, azureml_type: str, *args, **kwargs): if azureml_type in AzureMLResourceType.NAMED_TYPES: return NAMED_RESOURCE_ID_FORMAT.format( @@ -966,10 +1137,14 @@ def mock_from_rest(*args, **kwargs): "azure.ai.ml._restclient.v2024_01_01_preview.operations.ComponentVersionsOperations.create_or_update", side_effect=mock_create, ): - with mock.patch.object(Component, "_from_rest_object", side_effect=mock_from_rest): + with mock.patch.object( + Component, "_from_rest_object", side_effect=mock_from_rest + ): for _, job in pipeline.jobs.items(): - component_name = mock_machinelearning_client.components.create_or_update( - job.component, is_anonymous=True + component_name = ( + mock_machinelearning_client.components.create_or_update( + job.component, is_anonymous=True + ) ) component_names.add(component_name) err_msg = f"Got unexpected component id: {component_names}, expecting {expected_component_num} of them." @@ -981,11 +1156,20 @@ def test_load_component_reuse(self, mock_machinelearning_client: MLClient): @dsl.pipeline() def pipeline(component_in_number, component_in_path): component_func1 = load_component(source=path) - node1 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) - node2 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) + node2 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) component_func2 = load_component(source=path) - node3 = component_func2(component_in_number=component_in_number, component_in_path=component_in_path) + node3 = component_func2( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node1.compute = "cpu-cluster" node2.compute = "cpu-cluster" @@ -1004,7 +1188,9 @@ def test_command_function_reuse(self, mock_machinelearning_client: MLClient): expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} inputs = { - "component_in_path": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), + "component_in_path": Input( + type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount" + ), "component_in_number": 0.01, } outputs = {"component_out_path": Output(type="mlflow_model", mode="rw_mount")} @@ -1023,11 +1209,21 @@ def test_command_function_reuse(self, mock_machinelearning_client: MLClient): @dsl.pipeline() def pipeline(component_in_number, component_in_path): - node1 = component_func(component_in_number=component_in_number, component_in_path=component_in_path) - node2 = component_func(component_in_number=1, component_in_path=component_in_path) + node1 = component_func( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) + node2 = component_func( + component_in_number=1, component_in_path=component_in_path + ) - node3 = command_func1(component_in_number=component_in_number, component_in_path=component_in_path) - node4 = command_func1(component_in_number=1, component_in_path=component_in_path) + node3 = command_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) + node4 = command_func1( + component_in_number=1, component_in_path=component_in_path + ) # same command func as command 1 command_func2 = command( @@ -1041,8 +1237,13 @@ def pipeline(component_in_number, component_in_path): inputs=inputs, outputs=outputs, ) - node5 = command_func2(component_in_number=component_in_number, component_in_path=component_in_path) - node6 = command_func2(component_in_number=1, component_in_path=component_in_path) + node5 = command_func2( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) + node6 = command_func2( + component_in_number=1, component_in_path=component_in_path + ) return { **node1.outputs, @@ -1188,7 +1389,9 @@ def pipeline(number, path): ), ], ) - def test_dsl_pipeline_with_data_binding_expression(self, target_yml: str, target_dsl_pipeline: PipelineJob) -> None: + def test_dsl_pipeline_with_data_binding_expression( + self, target_yml: str, target_dsl_pipeline: PipelineJob + ) -> None: dsl_pipeline_job_rest_dict, pipeline_job_rest_dict = prepare_dsl_curated( target_dsl_pipeline, target_yml, in_rest=True ) @@ -1200,24 +1403,33 @@ def test_dsl_pipeline_with_data_binding_expression(self, target_yml: str, target assert dsl_pipeline_job_dict == pipeline_job_dict def test_dsl_pipeline_support_data_binding_for_fields(self) -> None: - from azure.ai.ml._schema._utils.data_binding_expression import support_data_binding_expression_for_fields + from azure.ai.ml._schema._utils.data_binding_expression import ( + support_data_binding_expression_for_fields, + ) from azure.ai.ml._schema.job.distribution import MPIDistributionSchema schema = MPIDistributionSchema() support_data_binding_expression_for_fields(schema, ["type"]) - distribution = schema.load({"type": "mpi", "process_count_per_instance": "${{parent.inputs.test}}"}) + distribution = schema.load( + {"type": "mpi", "process_count_per_instance": "${{parent.inputs.test}}"} + ) test_input = PipelineInput("test", None) assert distribution.type == "mpi" assert distribution.process_count_per_instance == str(test_input) distribution.process_count_per_instance = test_input dumped = schema.dump(distribution) - assert dumped == {"type": "mpi", "process_count_per_instance": "${{parent.inputs.test}}"} + assert dumped == { + "type": "mpi", + "process_count_per_instance": "${{parent.inputs.test}}", + } def test_dsl_pipeline_without_setting_binding_node(self) -> None: - from dsl_pipeline.pipeline_with_set_binding_output_input.pipeline import pipeline_without_setting_binding_node + from dsl_pipeline.pipeline_with_set_binding_output_input.pipeline import ( + pipeline_without_setting_binding_node, + ) pipeline = pipeline_without_setting_binding_node() - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) omit_fields = [ "name", "properties.inputs.training_input.uri", @@ -1239,8 +1451,14 @@ def test_dsl_pipeline_without_setting_binding_node(self) -> None: "inputs": { "training_input": {"job_input_type": "uri_folder"}, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, - "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "training_learning_rate": { + "job_input_type": "literal", + "value": "1.8", + }, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_with_sample_data": { @@ -1264,7 +1482,12 @@ def test_dsl_pipeline_without_setting_binding_node(self) -> None: "value": "${{parent.inputs.learning_rate_schedule}}", }, }, - "outputs": {"model_output": {"value": "${{parent.outputs.trained_model}}", "type": "literal"}}, + "outputs": { + "model_output": { + "value": "${{parent.outputs.trained_model}}", + "type": "literal", + } + }, } }, "outputs": {"trained_model": {"job_output_type": "uri_folder"}}, @@ -1278,7 +1501,7 @@ def test_dsl_pipeline_with_only_setting_pipeline_level(self) -> None: ) pipeline = pipeline_with_only_setting_pipeline_level() - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) omit_fields = [ "name", "properties.inputs.training_input.uri", @@ -1298,10 +1521,19 @@ def test_dsl_pipeline_with_only_setting_pipeline_level(self) -> None: "is_archived": False, "job_type": "Pipeline", "inputs": { - "training_input": {"mode": "ReadOnlyMount", "job_input_type": "uri_folder"}, + "training_input": { + "mode": "ReadOnlyMount", + "job_input_type": "uri_folder", + }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, - "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "training_learning_rate": { + "job_input_type": "literal", + "value": "1.8", + }, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_with_sample_data": { @@ -1326,19 +1558,28 @@ def test_dsl_pipeline_with_only_setting_pipeline_level(self) -> None: }, }, # todo: need update here when update literal output output - "outputs": {"model_output": {"value": "${{parent.outputs.trained_model}}", "type": "literal"}}, + "outputs": { + "model_output": { + "value": "${{parent.outputs.trained_model}}", + "type": "literal", + } + }, } }, - "outputs": {"trained_model": {"mode": "Upload", "job_output_type": "uri_folder"}}, + "outputs": { + "trained_model": {"mode": "Upload", "job_output_type": "uri_folder"} + }, "settings": {}, } } def test_dsl_pipeline_with_only_setting_binding_node(self) -> None: - from dsl_pipeline.pipeline_with_set_binding_output_input.pipeline import pipeline_with_only_setting_binding_node + from dsl_pipeline.pipeline_with_set_binding_output_input.pipeline import ( + pipeline_with_only_setting_binding_node, + ) pipeline = pipeline_with_only_setting_binding_node() - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) omit_fields = [ "name", "properties.inputs.training_input.uri", @@ -1360,8 +1601,14 @@ def test_dsl_pipeline_with_only_setting_binding_node(self) -> None: "inputs": { "training_input": {"job_input_type": "uri_folder"}, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, - "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "training_learning_rate": { + "job_input_type": "literal", + "value": "1.8", + }, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_with_sample_data": { @@ -1396,7 +1643,9 @@ def test_dsl_pipeline_with_only_setting_binding_node(self) -> None: }, } }, - "outputs": {"trained_model": {"job_output_type": "uri_folder", "mode": "Upload"}}, + "outputs": { + "trained_model": {"job_output_type": "uri_folder", "mode": "Upload"} + }, "settings": {}, } } @@ -1407,7 +1656,7 @@ def test_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self) -> None ) pipeline = pipeline_with_setting_binding_node_and_pipeline_level() - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) omit_fields = [ "name", "properties.inputs.training_input.uri", @@ -1427,10 +1676,19 @@ def test_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self) -> None "is_archived": False, "job_type": "Pipeline", "inputs": { - "training_input": {"mode": "Download", "job_input_type": "uri_folder"}, + "training_input": { + "mode": "Download", + "job_input_type": "uri_folder", + }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, - "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "training_learning_rate": { + "job_input_type": "literal", + "value": "1.8", + }, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_with_sample_data": { @@ -1465,7 +1723,12 @@ def test_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self) -> None }, } }, - "outputs": {"trained_model": {"mode": "ReadWriteMount", "job_output_type": "uri_folder"}}, + "outputs": { + "trained_model": { + "mode": "ReadWriteMount", + "job_output_type": "uri_folder", + } + }, "settings": {}, } } @@ -1477,18 +1740,26 @@ def test_nested_dsl_pipeline(self): @dsl.pipeline(name="sub_pipeline") def sub_pipeline(component_in_number: int, component_in_path: str): - node1 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node2 = component_func1( - component_in_number=component_in_number, component_in_path=node1.outputs.component_out_path + component_in_number=component_in_number, + component_in_path=node1.outputs.component_out_path, ) return {"sub_pipeline_out": node2.outputs.component_out_path} @dsl.pipeline(name="root_pipeline") def root_pipeline(component_in_number: int, component_in_path: str): - node1 = sub_pipeline(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = sub_pipeline( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node1.compute = "will be ignored" node2 = sub_pipeline( - component_in_number=component_in_number, component_in_path=node1.outputs.sub_pipeline_out + component_in_number=component_in_number, + component_in_path=node1.outputs.sub_pipeline_out, ) return node2.outputs @@ -1497,23 +1768,36 @@ def root_pipeline(component_in_number: int, component_in_path: str): expected_sub_dict = { "name": "sub_pipeline", "display_name": "sub_pipeline", - "inputs": {"component_in_number": {"type": "integer"}, "component_in_path": {"type": "string"}}, + "inputs": { + "component_in_number": {"type": "integer"}, + "component_in_path": {"type": "string"}, + }, "outputs": {"sub_pipeline_out": {"type": "uri_folder"}}, "type": "pipeline", "jobs": { "node1": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.inputs.component_in_path}}" + }, }, "type": "command", }, "node2": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.jobs.node1.outputs.component_out_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.jobs.node1.outputs.component_out_path}}" + }, + }, + "outputs": { + "component_out_path": "${{parent.outputs.sub_pipeline_out}}" }, - "outputs": {"component_out_path": "${{parent.outputs.sub_pipeline_out}}"}, "type": "command", }, }, @@ -1537,17 +1821,27 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.inputs.component_in_path}}" + }, }, "type": "pipeline", }, "node2": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}" + }, + }, + "outputs": { + "sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}" }, - "outputs": {"sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}"}, "type": "pipeline", }, }, @@ -1557,13 +1851,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): actual_dict = pydash.omit(actual_dict, *omit_fields) assert actual_dict == expected_root_dict - def test_dsl_pipeline_with_command_builder_setting_binding_node_and_pipeline_level(self) -> None: + def test_dsl_pipeline_with_command_builder_setting_binding_node_and_pipeline_level( + self, + ) -> None: from dsl_pipeline.pipeline_with_set_binding_output_input.pipeline import ( pipeline_with_command_builder_setting_binding_node_and_pipeline_level, ) - pipeline = pipeline_with_command_builder_setting_binding_node_and_pipeline_level() - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + pipeline = ( + pipeline_with_command_builder_setting_binding_node_and_pipeline_level() + ) + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) omit_fields = [ "name", "properties.inputs.training_input.uri", @@ -1584,15 +1882,27 @@ def test_dsl_pipeline_with_command_builder_setting_binding_node_and_pipeline_lev "is_archived": False, "job_type": "Pipeline", "inputs": { - "training_input": {"mode": "Download", "job_input_type": "uri_folder"}, + "training_input": { + "mode": "Download", + "job_input_type": "uri_folder", + }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, - "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "training_learning_rate": { + "job_input_type": "literal", + "value": "1.8", + }, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_with_sample_data": { "type": "command", - "distribution": {"distribution_type": "PyTorch", "process_count_per_instance": 2}, + "distribution": { + "distribution_type": "PyTorch", + "process_count_per_instance": 2, + }, "name": "train_with_sample_data", "inputs": { "training_data": { @@ -1623,18 +1933,27 @@ def test_dsl_pipeline_with_command_builder_setting_binding_node_and_pipeline_lev }, } }, - "outputs": {"trained_model": {"mode": "ReadWriteMount", "job_output_type": "uri_folder"}}, + "outputs": { + "trained_model": { + "mode": "ReadWriteMount", + "job_output_type": "uri_folder", + } + }, "settings": {}, } } - def test_nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self) -> None: + def test_nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level( + self, + ) -> None: from dsl_pipeline.pipeline_with_set_binding_output_input.pipeline import ( nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level, ) pipeline = nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level() - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = json.loads( + json.dumps(as_attribute_dict(pipeline._to_rest_object()), default=str) + ) omit_fields = [ "name", "properties.inputs.pipeline_training_input.uri", @@ -1654,10 +1973,22 @@ def test_nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self) "is_archived": False, "job_type": "Pipeline", "inputs": { - "pipeline_training_input": {"mode": "Download", "job_input_type": "uri_folder"}, - "pipeline_training_max_epochs": {"job_input_type": "literal", "value": "20"}, - "pipeline_training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "pipeline_learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "pipeline_training_input": { + "mode": "Download", + "job_input_type": "uri_folder", + }, + "pipeline_training_max_epochs": { + "job_input_type": "literal", + "value": "20", + }, + "pipeline_training_learning_rate": { + "job_input_type": "literal", + "value": "1.8", + }, + "pipeline_learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "subgraph1": { @@ -1692,24 +2023,34 @@ def test_nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self) }, } }, - "outputs": {"pipeline_trained_model": {"mode": "ReadWriteMount", "job_output_type": "uri_folder"}}, + "outputs": { + "pipeline_trained_model": { + "mode": "ReadWriteMount", + "job_output_type": "uri_folder", + } + }, "settings": {}, } } def test_dsl_pipeline_build_component(self): - component_path = ( - "./tests/test_configs/pipeline_jobs/inline_file_comp_base_path_sensitive/component/component.yml" - ) + component_path = "./tests/test_configs/pipeline_jobs/inline_file_comp_base_path_sensitive/component/component.yml" component_path2 = "./tests/test_configs/components/helloworld_component.yml" - @dsl.pipeline(name="pipeline_comp", version="2", continue_on_step_failure=True, tags={"key": "val"}) + @dsl.pipeline( + name="pipeline_comp", + version="2", + continue_on_step_failure=True, + tags={"key": "val"}, + ) def pipeline_func(path: Input): component_func = load_component(source=component_path) r_iris_example = component_func(iris=path) r_iris_example.compute = "cpu-cluster" component_func = load_component(source=component_path2) - node = component_func(component_in_number="mock_data", component_in_path="mock_data") + node = component_func( + component_in_number="mock_data", component_in_path="mock_data" + ) node.outputs.component_out_path.mode = "upload" return node.outputs @@ -1730,7 +2071,9 @@ def pipeline_func(path: Input): assert expected_dict == actual_dict def test_concatenation_of_pipeline_input_with_str(self) -> None: - echo_string_func = load_component(source=str(components_dir / "echo_string_component.yml")) + echo_string_func = load_component( + source=str(components_dir / "echo_string_component.yml") + ) @dsl.pipeline(name="concatenation_of_pipeline_input_with_str") def concatenation_in_pipeline(str_param: str): @@ -1742,9 +2085,15 @@ def concatenation_in_pipeline(str_param: str): for node_name, expected_value in ( ("microsoft_samples_echo_string", "${{parent.inputs.str_param}} right"), ("microsoft_samples_echo_string_1", "left ${{parent.inputs.str_param}}"), - ("microsoft_samples_echo_string_2", "${{parent.inputs.str_param}}${{parent.inputs.str_param}}"), + ( + "microsoft_samples_echo_string_2", + "${{parent.inputs.str_param}}${{parent.inputs.str_param}}", + ), ): - assert pipeline.jobs[node_name].inputs.component_in_string._data == expected_value + assert ( + pipeline.jobs[node_name].inputs.component_in_string._data + == expected_value + ) def test_nested_dsl_pipeline_with_use_node_pipeline_as_input(self): path = "./tests/test_configs/components/helloworld_component.yml" @@ -1752,18 +2101,26 @@ def test_nested_dsl_pipeline_with_use_node_pipeline_as_input(self): @dsl.pipeline(name="sub_pipeline") def sub_pipeline(component_in_number: int, component_in_path: str): - node1 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node2 = component_func1( - component_in_number=component_in_number, component_in_path=node1 # use a node as the input + component_in_number=component_in_number, + component_in_path=node1, # use a node as the input ) return {"sub_pipeline_out": node2.outputs.component_out_path} @dsl.pipeline(name="root_pipeline") def root_pipeline(component_in_number: int, component_in_path: str): - node1 = sub_pipeline(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = sub_pipeline( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node1.compute = "will be ignored" node2 = sub_pipeline( - component_in_number=component_in_number, component_in_path=node1 # use a pipeline node as the input + component_in_number=component_in_number, + component_in_path=node1, # use a pipeline node as the input ) return node2.outputs @@ -1772,23 +2129,36 @@ def root_pipeline(component_in_number: int, component_in_path: str): expected_sub_dict = { "name": "sub_pipeline", "display_name": "sub_pipeline", - "inputs": {"component_in_number": {"type": "integer"}, "component_in_path": {"type": "string"}}, + "inputs": { + "component_in_number": {"type": "integer"}, + "component_in_path": {"type": "string"}, + }, "outputs": {"sub_pipeline_out": {"type": "uri_folder"}}, "type": "pipeline", "jobs": { "node1": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.inputs.component_in_path}}" + }, }, "type": "command", }, "node2": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.jobs.node1.outputs.component_out_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.jobs.node1.outputs.component_out_path}}" + }, + }, + "outputs": { + "component_out_path": "${{parent.outputs.sub_pipeline_out}}" }, - "outputs": {"component_out_path": "${{parent.outputs.sub_pipeline_out}}"}, "type": "command", }, }, @@ -1800,7 +2170,9 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs.node1.properties", "jobs.node2.properties", ] - actual_dict = pydash.omit(pipeline.jobs["node1"].component._to_dict(), *omit_fields) + actual_dict = pydash.omit( + pipeline.jobs["node1"].component._to_dict(), *omit_fields + ) assert actual_dict == expected_sub_dict expected_root_dict = { "display_name": "root_pipeline", @@ -1809,17 +2181,27 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.inputs.component_in_path}}" + }, }, "type": "pipeline", }, "node2": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}" + }, + }, + "outputs": { + "sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}" }, - "outputs": {"sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}"}, "type": "pipeline", }, }, @@ -1834,17 +2216,31 @@ def test_nested_dsl_pipeline_with_use_node_pipeline_to_set_input(self): @dsl.pipeline(name="sub_pipeline") def sub_pipeline(component_in_number: int, component_in_path: str): - node1 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) - node2 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) + node2 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node2.inputs.component_in_path = node1 # use a node to set the input return {"sub_pipeline_out": node2.outputs.component_out_path} @dsl.pipeline(name="root_pipeline") def root_pipeline(component_in_number: int, component_in_path: str): - node1 = sub_pipeline(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = sub_pipeline( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node1.compute = "will be ignored" - node2 = sub_pipeline(component_in_number=component_in_number, component_in_path=component_in_path) - node2.inputs.component_in_path = node1 # use a pipeline node to set the input + node2 = sub_pipeline( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) + node2.inputs.component_in_path = ( + node1 # use a pipeline node to set the input + ) return node2.outputs pipeline = root_pipeline(1, "test") @@ -1852,30 +2248,48 @@ def root_pipeline(component_in_number: int, component_in_path: str): expected_sub_dict = { "name": "sub_pipeline", "display_name": "sub_pipeline", - "inputs": {"component_in_number": {"type": "integer"}, "component_in_path": {"type": "string"}}, + "inputs": { + "component_in_number": {"type": "integer"}, + "component_in_path": {"type": "string"}, + }, "outputs": {"sub_pipeline_out": {"type": "uri_folder"}}, "type": "pipeline", "jobs": { "node1": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.inputs.component_in_path}}" + }, }, "type": "command", }, "node2": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.jobs.node1.outputs.component_out_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.jobs.node1.outputs.component_out_path}}" + }, + }, + "outputs": { + "component_out_path": "${{parent.outputs.sub_pipeline_out}}" }, - "outputs": {"component_out_path": "${{parent.outputs.sub_pipeline_out}}"}, "type": "command", }, }, } actual_dict = pydash.omit( pipeline.jobs["node1"].component._to_dict(), - *["jobs.node1.component", "jobs.node2.component", "jobs.node1.properties", "jobs.node2.properties"], + *[ + "jobs.node1.component", + "jobs.node2.component", + "jobs.node1.properties", + "jobs.node2.properties", + ], ) assert actual_dict == expected_sub_dict expected_root_dict = { @@ -1885,17 +2299,27 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.inputs.component_in_path}}" + }, }, "type": "pipeline", }, "node2": { "inputs": { - "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, - "component_in_path": {"path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}"}, + "component_in_number": { + "path": "${{parent.inputs.component_in_number}}" + }, + "component_in_path": { + "path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}" + }, + }, + "outputs": { + "sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}" }, - "outputs": {"sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}"}, "type": "pipeline", }, }, @@ -1915,9 +2339,13 @@ def test_pipeline_decorator_without_brackets(self): component_func1 = load_component(path) def my_pipeline(component_in_number: int, component_in_path: str): - node1 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) + node1 = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node2 = component_func1( - component_in_number=component_in_number, component_in_path=node1 # use a node as the input + component_in_number=component_in_number, + component_in_path=node1, # use a node as the input ) return {"pipeline_out": node2.outputs.component_out_path} @@ -1933,7 +2361,9 @@ def my_pipeline(component_in_number: int, component_in_path: str): assert pipeline_job_0._to_rest_object() == pipeline_job_1._to_rest_object() def test_dsl_pipeline_with_component_from_container_data(self): - container_rest_object = ComponentContainerData(properties=ComponentContainerDetails()) + container_rest_object = ComponentContainerData( + properties=ComponentContainerDetails() + ) # Set read only fields container_rest_object.name = "component" container_rest_object.id = "mock_id" @@ -1955,13 +2385,20 @@ def test_data_as_pipeline_inputs(self): @dsl.pipeline def pipeline_func(component_in_path): node = component_func( - component_in_number=1, component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE) + component_in_number=1, + component_in_path=Data( + name="test", version="1", type=AssetTypes.MLTABLE + ), ) node.compute = "cpu-cluster" - node2 = component_func(component_in_number=1, component_in_path=component_in_path) + node2 = component_func( + component_in_number=1, component_in_path=component_in_path + ) node2.compute = "cpu-cluster" - pipeline_job = pipeline_func(component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE)) + pipeline_job = pipeline_func( + component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE) + ) result = pipeline_job._validate() assert result._to_dict() == {"result": "Succeeded"} @@ -1971,25 +2408,38 @@ def test_pipeline_node_identity_with_component(self): @dsl.pipeline def pipeline_func(component_in_path): - node1 = component_func(component_in_number=1, component_in_path=component_in_path) + node1 = component_func( + component_in_number=1, component_in_path=component_in_path + ) node1.identity = AmlTokenConfiguration() - node2 = component_func(component_in_number=1, component_in_path=component_in_path) + node2 = component_func( + component_in_number=1, component_in_path=component_in_path + ) node2.identity = UserIdentityConfiguration() - node3 = component_func(component_in_number=1, component_in_path=component_in_path) + node3 = component_func( + component_in_number=1, component_in_path=component_in_path + ) node3.identity = ManagedIdentityConfiguration() - pipeline = pipeline_func(component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE)) + pipeline = pipeline_func( + component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE) + ) omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard(pipeline._to_rest_object().as_dict()["properties"], *omit_fields) + actual_dict = omit_with_wildcard( + as_attribute_dict(pipeline._to_rest_object())["properties"], *omit_fields + ) assert actual_dict["jobs"] == { "node1": { "identity": {"identity_type": "AMLToken"}, "inputs": { "component_in_number": {"job_input_type": "literal", "value": "1"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.component_in_path}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.component_in_path}}", + }, }, "name": "node1", "type": "command", @@ -1998,7 +2448,10 @@ def pipeline_func(component_in_path): "identity": {"identity_type": "UserIdentity"}, "inputs": { "component_in_number": {"job_input_type": "literal", "value": "1"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.component_in_path}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.component_in_path}}", + }, }, "name": "node2", "type": "command", @@ -2007,7 +2460,10 @@ def pipeline_func(component_in_path): "identity": {"identity_type": "Managed"}, "inputs": { "component_in_number": {"job_input_type": "literal", "value": "1"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.component_in_path}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.component_in_path}}", + }, }, "name": "node3", "type": "command", @@ -2016,11 +2472,20 @@ def pipeline_func(component_in_path): def test_pipeline_with_non_pipeline_inputs(self): component_yaml = components_dir / "helloworld_component.yml" - component_func1 = load_component(source=component_yaml, params_override=[{"name": "component_name_1"}]) - component_func2 = load_component(source=component_yaml, params_override=[{"name": "component_name_2"}]) + component_func1 = load_component( + source=component_yaml, params_override=[{"name": "component_name_1"}] + ) + component_func2 = load_component( + source=component_yaml, params_override=[{"name": "component_name_2"}] + ) @dsl.pipeline( - non_pipeline_inputs=["other_params", "is_add_component", "param_with_annotation", "param_with_default"] + non_pipeline_inputs=[ + "other_params", + "is_add_component", + "param_with_annotation", + "param_with_default", + ] ) def pipeline_func( job_in_number, @@ -2032,26 +2497,48 @@ def pipeline_func( ): assert param_with_default == 1 assert param_with_annotation == {"mock": "dict"} - component_func1(component_in_number=job_in_number, component_in_path=job_in_path) - component_func2(component_in_number=other_params, component_in_path=job_in_path) + component_func1( + component_in_number=job_in_number, component_in_path=job_in_path + ) + component_func2( + component_in_number=other_params, component_in_path=job_in_path + ) if is_add_component: - component_func2(component_in_number=other_params, component_in_path=job_in_path) + component_func2( + component_in_number=other_params, component_in_path=job_in_path + ) - pipeline = pipeline_func(10, Input(path="/a/path/on/ds"), 15, False, {"mock": "dict"}) + pipeline = pipeline_func( + 10, Input(path="/a/path/on/ds"), 15, False, {"mock": "dict"} + ) assert len(pipeline.jobs) == 2 assert "other_params" not in pipeline.inputs - assert isinstance(pipeline.jobs[component_func1.name].inputs["component_in_number"]._data, PipelineInput) - assert pipeline.jobs[component_func2.name].inputs["component_in_number"]._data == 15 + assert isinstance( + pipeline.jobs[component_func1.name].inputs["component_in_number"]._data, + PipelineInput, + ) + assert ( + pipeline.jobs[component_func2.name].inputs["component_in_number"]._data + == 15 + ) - pipeline = pipeline_func(10, Input(path="/a/path/on/ds"), 15, True, {"mock": "dict"}) + pipeline = pipeline_func( + 10, Input(path="/a/path/on/ds"), 15, True, {"mock": "dict"} + ) assert len(pipeline.jobs) == 3 @dsl.pipeline(non_pipeline_parameters=["other_params", "is_add_component"]) def pipeline_func(job_in_number, job_in_path, other_params, is_add_component): - component_func1(component_in_number=job_in_number, component_in_path=job_in_path) - component_func2(component_in_number=other_params, component_in_path=job_in_path) + component_func1( + component_in_number=job_in_number, component_in_path=job_in_path + ) + component_func2( + component_in_number=other_params, component_in_path=job_in_path + ) if is_add_component: - component_func2(component_in_number=other_params, component_in_path=job_in_path) + component_func2( + component_in_number=other_params, component_in_path=job_in_path + ) pipeline = pipeline_func(10, Input(path="/a/path/on/ds"), 15, True) assert len(pipeline.jobs) == 3 @@ -2063,7 +2550,10 @@ def pipeline_func(): with pytest.raises(UserErrorException) as error_info: pipeline_func() - assert "Type of 'non_pipeline_parameter' in dsl.pipeline should be a list of string" in str(error_info) + assert ( + "Type of 'non_pipeline_parameter' in dsl.pipeline should be a list of string" + in str(error_info) + ) @dsl.pipeline(non_pipeline_inputs=["non_exist_param1", "non_exist_param2"]) def pipeline_func(): @@ -2078,16 +2568,26 @@ def pipeline_func(): def test_component_func_as_non_pipeline_inputs(self): component_yaml = components_dir / "helloworld_component.yml" - component_func1 = load_component(source=component_yaml, params_override=[{"name": "component_name_1"}]) - component_func2 = load_component(source=component_yaml, params_override=[{"name": "component_name_2"}]) + component_func1 = load_component( + source=component_yaml, params_override=[{"name": "component_name_1"}] + ) + component_func2 = load_component( + source=component_yaml, params_override=[{"name": "component_name_2"}] + ) @dsl.pipeline(non_pipeline_inputs=["component_func"]) def pipeline_func(job_in_number, job_in_path, component_func): - component_func1(component_in_number=job_in_number, component_in_path=job_in_path) - component_func(component_in_number=job_in_number, component_in_path=job_in_path) + component_func1( + component_in_number=job_in_number, component_in_path=job_in_path + ) + component_func( + component_in_number=job_in_number, component_in_path=job_in_path + ) pipeline = pipeline_func( - job_in_number=10, job_in_path=Input(path="/a/path/on/ds"), component_func=component_func2 + job_in_number=10, + job_in_path=Input(path="/a/path/on/ds"), + component_func=component_func2, ) assert len(pipeline.jobs) == 2 assert component_func2.name in pipeline.jobs @@ -2100,7 +2600,8 @@ def test_pipeline_with_variable_inputs(self): @dsl.pipeline def pipeline_with_variable_args(**kwargs): node_kwargs = component_func1( - component_in_number=kwargs["component_in_number1"], component_in_path=kwargs["component_in_path1"] + component_in_number=kwargs["component_in_number1"], + component_in_path=kwargs["component_in_path1"], ) @dsl.pipeline @@ -2117,21 +2618,44 @@ def root_pipeline(component_in_number: int, component_in_path: Input, **kwargs): component_in_path1: component_in_path1 description args_0: args_0 description """ - node = component_func1(component_in_number=component_in_number, component_in_path=component_in_path) + node = component_func1( + component_in_number=component_in_number, + component_in_path=component_in_path, + ) node_kwargs = component_func1( - component_in_number=kwargs["component_in_number1"], component_in_path=kwargs["component_in_path1"] + component_in_number=kwargs["component_in_number1"], + component_in_path=kwargs["component_in_path1"], ) node_with_arg_kwarg = pipeline_with_variable_args(**kwargs) - pipeline = root_pipeline(10, data, component_in_number1=12, component_in_path1=data) + pipeline = root_pipeline( + 10, data, component_in_number1=12, component_in_path1=data + ) - assert pipeline.component.inputs["component_in_number"].description == "component_in_number description" - assert pipeline.component.inputs["component_in_path"].description == "component_in_path description" - assert pipeline.component.inputs["component_in_number1"].description == "component_in_number1 description" - assert pipeline.component.inputs["component_in_path1"].description == "component_in_path1 description" + assert ( + pipeline.component.inputs["component_in_number"].description + == "component_in_number description" + ) + assert ( + pipeline.component.inputs["component_in_path"].description + == "component_in_path description" + ) + assert ( + pipeline.component.inputs["component_in_number1"].description + == "component_in_number1 description" + ) + assert ( + pipeline.component.inputs["component_in_path1"].description + == "component_in_path1 description" + ) omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard(pipeline._to_rest_object().as_dict()["properties"], *omit_fields) + actual_dict = omit_with_wildcard( + json.loads( + json.dumps(as_attribute_dict(pipeline._to_rest_object()), default=str) + )["properties"], + *omit_fields, + ) assert actual_dict["inputs"] == { "component_in_number": {"job_input_type": "literal", "value": "10"}, @@ -2148,7 +2672,10 @@ def root_pipeline(component_in_number: int, component_in_path: Input, **kwargs): "job_input_type": "literal", "value": "${{parent.inputs.component_in_number}}", }, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.component_in_path}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.component_in_path}}", + }, }, }, "node_kwargs": { @@ -2182,7 +2709,8 @@ def root_pipeline(component_in_number: int, component_in_path: Input, **kwargs): } with pytest.raises( - UnsupportedParameterKindError, match="dsl pipeline does not accept \*custorm_args as parameters\." + UnsupportedParameterKindError, + match="dsl pipeline does not accept \*custorm_args as parameters\.", ): @dsl.pipeline @@ -2191,11 +2719,17 @@ def pipeline_with_variable_args(*custorm_args): pipeline_with_variable_args(1, 2, 3) - with mock.patch("azure.ai.ml.dsl._pipeline_decorator.is_private_preview_enabled", return_value=False): + with mock.patch( + "azure.ai.ml.dsl._pipeline_decorator.is_private_preview_enabled", + return_value=False, + ): with pytest.raises( - UnsupportedParameterKindError, match="dsl pipeline does not accept \*args or \*\*kwargs as parameters\." + UnsupportedParameterKindError, + match="dsl pipeline does not accept \*args or \*\*kwargs as parameters\.", ): - root_pipeline(10, data, 11, data, component_in_number1=11, component_in_path1=data) + root_pipeline( + 10, data, 11, data, component_in_number1=11, component_in_path1=data + ) def test_pipeline_with_dumplicate_variable_inputs(self): @dsl.pipeline @@ -2203,17 +2737,23 @@ def pipeline_with_variable_args(key_1: int, **kargs): pass with pytest.raises( - MultipleValueError, match="pipeline_with_variable_args\(\) got multiple values for argument 'key_1'\." + MultipleValueError, + match="pipeline_with_variable_args\(\) got multiple values for argument 'key_1'\.", ): pipeline_with_variable_args(10, key_1=10) def test_pipeline_with_output_binding_in_dynamic_args(self): hello_world_func = load_component(components_dir / "helloworld_component.yml") - hello_world_no_inputs_func = load_component(components_dir / "helloworld_component_no_inputs.yml") + hello_world_no_inputs_func = load_component( + components_dir / "helloworld_component_no_inputs.yml" + ) @dsl.pipeline def pipeline_func_consume_dynamic_arg(**kwargs): - hello_world_func(component_in_number=kwargs["int_param"], component_in_path=kwargs["path_param"]) + hello_world_func( + component_in_number=kwargs["int_param"], + component_in_path=kwargs["path_param"], + ) @dsl.pipeline def root_pipeline_func(): @@ -2237,7 +2777,9 @@ def pipeline_func_consume_expression(int_param: int): node1 = component_func() node2 = component_func() expression = int_param == 0 - control_node = condition(expression, true_block=node1, false_block=node2) # noqa: F841 + control_node = condition( + expression, true_block=node1, false_block=node2 + ) # noqa: F841 pipeline_job = pipeline_func_consume_expression(int_param=1) assert pipeline_job.jobs["control_node"]._to_rest_object() == { @@ -2254,11 +2796,16 @@ def pipeline_func_consume_invalid_component(): node0 = component_func() node1 = component_func() node2 = component_func() - control_node = condition(node0, true_block=node1, false_block=node2) # noqa: F841 + control_node = condition( + node0, true_block=node1, false_block=node2 + ) # noqa: F841 with pytest.raises(UserErrorException) as e: pipeline_func_consume_invalid_component() - assert str(e.value) == "Exactly one output is expected for condition node, 0 outputs found." + assert ( + str(e.value) + == "Exactly one output is expected for condition node, 0 outputs found." + ) def test_dsl_pipeline_with_spark_hobo(self) -> None: add_greeting_column_func = load_component( @@ -2271,9 +2818,15 @@ def test_dsl_pipeline_with_spark_hobo(self) -> None: @dsl.pipeline(description="submit a pipeline with spark job") def spark_pipeline_from_yaml(iris_data): add_greeting_column = add_greeting_column_func(file_input=iris_data) - add_greeting_column.resources = {"instance_type": "Standard_E8S_V3", "runtime_version": "3.4.0"} + add_greeting_column.resources = { + "instance_type": "Standard_E8S_V3", + "runtime_version": "3.4.0", + } count_by_row = count_by_row_func(file_input=iris_data) - count_by_row.resources = {"instance_type": "Standard_E8S_V3", "runtime_version": "3.4.0"} + count_by_row.resources = { + "instance_type": "Standard_E8S_V3", + "runtime_version": "3.4.0", + } count_by_row.identity = {"type": "managed"} return {"output": count_by_row.outputs.output} @@ -2298,14 +2851,18 @@ def spark_pipeline_from_yaml(iris_data): spark_node_dict_from_rest = regenerated_spark_node._to_dict() omit_fields = [] - assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit(spark_node_dict_from_rest, *omit_fields) + assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit( + spark_node_dict_from_rest, *omit_fields + ) omit_fields = [ "jobs.add_greeting_column.componentId", "jobs.count_by_row.componentId", "jobs.add_greeting_column.properties", "jobs.count_by_row.properties", ] - actual_job = pydash.omit(dsl_pipeline._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = pydash.omit( + as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields + ) assert actual_job == { "description": "submit a pipeline with spark job", "properties": {}, @@ -2323,8 +2880,14 @@ def spark_pipeline_from_yaml(iris_data): "jobs": { "add_greeting_column": { "type": "spark", - "resources": {"instance_type": "Standard_E8S_V3", "runtime_version": "3.4.0"}, - "entry": {"file": "add_greeting_column.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "resources": { + "instance_type": "Standard_E8S_V3", + "runtime_version": "3.4.0", + }, + "entry": { + "file": "add_greeting_column.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "py_files": ["utils.zip"], "files": ["my_files.txt"], "identity": {"identity_type": "UserIdentity"}, @@ -2338,13 +2901,17 @@ def spark_pipeline_from_yaml(iris_data): "args": "--file_input ${{inputs.file_input}}", "name": "add_greeting_column", "inputs": { - "file_input": {"job_input_type": "literal", "value": "${{parent.inputs.iris_data}}"}, + "file_input": { + "job_input_type": "literal", + "value": "${{parent.inputs.iris_data}}", + }, }, "_source": "YAML.COMPONENT", }, "count_by_row": { "_source": "YAML.COMPONENT", - "args": "--file_input ${{inputs.file_input}} " "--output ${{outputs.output}}", + "args": "--file_input ${{inputs.file_input}} " + "--output ${{outputs.output}}", "conf": { "spark.driver.cores": 2, "spark.driver.memory": "1g", @@ -2352,14 +2919,30 @@ def spark_pipeline_from_yaml(iris_data): "spark.executor.instances": 1, "spark.executor.memory": "1g", }, - "entry": {"file": "count_by_row.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "entry": { + "file": "count_by_row.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "files": ["my_files.txt"], "identity": {"identity_type": "Managed"}, - "inputs": {"file_input": {"job_input_type": "literal", "value": "${{parent.inputs.iris_data}}"}}, + "inputs": { + "file_input": { + "job_input_type": "literal", + "value": "${{parent.inputs.iris_data}}", + } + }, "jars": ["scalaproj.jar"], "name": "count_by_row", - "outputs": {"output": {"type": "literal", "value": "${{parent.outputs.output}}"}}, - "resources": {"instance_type": "Standard_E8S_V3", "runtime_version": "3.4.0"}, + "outputs": { + "output": { + "type": "literal", + "value": "${{parent.outputs.output}}", + } + }, + "resources": { + "instance_type": "Standard_E8S_V3", + "runtime_version": "3.4.0", + }, "type": "spark", }, }, @@ -2368,7 +2951,9 @@ def spark_pipeline_from_yaml(iris_data): } def test_dsl_pipeline_with_data_transfer_copy_node(self) -> None: - merge_files = load_component("./tests/test_configs/components/data_transfer/copy_files.yaml") + merge_files = load_component( + "./tests/test_configs/components/data_transfer/copy_files.yaml" + ) @dsl.pipeline(description="submit a pipeline with data transfer copy job") def data_transfer_copy_pipeline_from_yaml(folder1): @@ -2381,7 +2966,9 @@ def data_transfer_copy_pipeline_from_yaml(folder1): type=AssetTypes.URI_FOLDER, ), ) - dsl_pipeline.outputs.output.path = "azureml://datastores/my_blob/paths/merged_blob" + dsl_pipeline.outputs.output.path = ( + "azureml://datastores/my_blob/paths/merged_blob" + ) data_transfer_copy_node = dsl_pipeline.jobs["copy_files_node"] job_data_path_input = data_transfer_copy_node.inputs["folder1"]._meta @@ -2389,9 +2976,13 @@ def data_transfer_copy_pipeline_from_yaml(folder1): data_transfer_copy_node_dict = data_transfer_copy_node._to_dict() data_transfer_copy_node_rest_obj = data_transfer_copy_node._to_rest_object() - regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object(data_transfer_copy_node_rest_obj) + regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object( + data_transfer_copy_node_rest_obj + ) - data_transfer_copy_node_dict_from_rest = regenerated_data_transfer_copy_node._to_dict() + data_transfer_copy_node_dict_from_rest = ( + regenerated_data_transfer_copy_node._to_dict() + ) omit_fields = [] assert pydash.omit(data_transfer_copy_node_dict, *omit_fields) == pydash.omit( data_transfer_copy_node_dict_from_rest, *omit_fields @@ -2399,12 +2990,17 @@ def data_transfer_copy_pipeline_from_yaml(folder1): omit_fields = [ "jobs.copy_files_node.componentId", ] - actual_job = pydash.omit(dsl_pipeline._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = pydash.omit( + as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields + ) assert actual_job == { "description": "submit a pipeline with data transfer copy job", "display_name": "data_transfer_copy_pipeline_from_yaml", "inputs": { - "folder1": {"job_input_type": "uri_folder", "uri": "azureml://datastores/my_cosmos/paths/source_cosmos"} + "folder1": { + "job_input_type": "uri_folder", + "uri": "azureml://datastores/my_cosmos/paths/source_cosmos", + } }, "is_archived": False, "job_type": "Pipeline", @@ -2412,15 +3008,28 @@ def data_transfer_copy_pipeline_from_yaml(folder1): "copy_files_node": { "_source": "YAML.COMPONENT", "data_copy_mode": "merge_with_overwrite", - "inputs": {"folder1": {"job_input_type": "literal", "value": "${{parent.inputs.folder1}}"}}, + "inputs": { + "folder1": { + "job_input_type": "literal", + "value": "${{parent.inputs.folder1}}", + } + }, "name": "copy_files_node", - "outputs": {"output_folder": {"type": "literal", "value": "${{parent.outputs.output}}"}}, + "outputs": { + "output_folder": { + "type": "literal", + "value": "${{parent.outputs.output}}", + } + }, "task": "copy_data", "type": "data_transfer", } }, "outputs": { - "output": {"job_output_type": "uri_folder", "uri": "azureml://datastores/my_blob/paths/merged_blob"} + "output": { + "job_output_type": "uri_folder", + "uri": "azureml://datastores/my_blob/paths/merged_blob", + } }, "properties": {}, "settings": {"_source": "DSL"}, @@ -2428,7 +3037,9 @@ def data_transfer_copy_pipeline_from_yaml(folder1): } def test_dsl_pipeline_with_data_transfer_merge_node(self) -> None: - merge_files = load_component("./tests/test_configs/components/data_transfer/merge_files.yaml") + merge_files = load_component( + "./tests/test_configs/components/data_transfer/merge_files.yaml" + ) @dsl.pipeline(description="submit a pipeline with data transfer copy job") def data_transfer_copy_pipeline_from_yaml(folder1, folder2): @@ -2445,7 +3056,9 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): type=AssetTypes.URI_FOLDER, ), ) - dsl_pipeline.outputs.output.path = "azureml://datastores/my_blob/paths/merged_blob" + dsl_pipeline.outputs.output.path = ( + "azureml://datastores/my_blob/paths/merged_blob" + ) data_transfer_copy_node = dsl_pipeline.jobs["merge_files_node"] job_data_path_input = data_transfer_copy_node.inputs["folder1"]._meta @@ -2453,9 +3066,13 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): data_transfer_copy_node_dict = data_transfer_copy_node._to_dict() data_transfer_copy_node_rest_obj = data_transfer_copy_node._to_rest_object() - regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object(data_transfer_copy_node_rest_obj) + regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object( + data_transfer_copy_node_rest_obj + ) - data_transfer_copy_node_dict_from_rest = regenerated_data_transfer_copy_node._to_dict() + data_transfer_copy_node_dict_from_rest = ( + regenerated_data_transfer_copy_node._to_dict() + ) omit_fields = [] assert pydash.omit(data_transfer_copy_node_dict, *omit_fields) == pydash.omit( data_transfer_copy_node_dict_from_rest, *omit_fields @@ -2463,7 +3080,9 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): omit_fields = [ "jobs.merge_files_node.componentId", ] - actual_job = pydash.omit(dsl_pipeline._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = pydash.omit( + as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields + ) assert actual_job == { "description": "submit a pipeline with data transfer copy job", "display_name": "data_transfer_copy_pipeline_from_yaml", @@ -2484,17 +3103,31 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): "_source": "YAML.COMPONENT", "data_copy_mode": "merge_with_overwrite", "inputs": { - "folder1": {"job_input_type": "literal", "value": "${{parent.inputs.folder1}}"}, - "folder2": {"job_input_type": "literal", "value": "${{parent.inputs.folder2}}"}, + "folder1": { + "job_input_type": "literal", + "value": "${{parent.inputs.folder1}}", + }, + "folder2": { + "job_input_type": "literal", + "value": "${{parent.inputs.folder2}}", + }, }, "name": "merge_files_node", - "outputs": {"output_folder": {"type": "literal", "value": "${{parent.outputs.output}}"}}, + "outputs": { + "output_folder": { + "type": "literal", + "value": "${{parent.outputs.output}}", + } + }, "task": "copy_data", "type": "data_transfer", } }, "outputs": { - "output": {"job_output_type": "uri_folder", "uri": "azureml://datastores/my_blob/paths/merged_blob"} + "output": { + "job_output_type": "uri_folder", + "uri": "azureml://datastores/my_blob/paths/merged_blob", + } }, "properties": {}, "settings": {"_source": "DSL"}, @@ -2502,10 +3135,16 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): } def test_dsl_pipeline_with_data_transfer_import_component(self) -> None: - s3_blob = load_component("./tests/test_configs/components/data_transfer/import_file_to_blob.yaml") + s3_blob = load_component( + "./tests/test_configs/components/data_transfer/import_file_to_blob.yaml" + ) path_source_s3 = "test1/*" connection_target = "azureml:my-s3-connection" - source = {"type": "file_system", "connection": connection_target, "path": path_source_s3} + source = { + "type": "file_system", + "connection": connection_target, + "path": path_source_s3, + } with pytest.raises(ValidationException) as e: @@ -2514,15 +3153,25 @@ def data_transfer_copy_pipeline_from_yaml(): s3_blob(source=source) data_transfer_copy_pipeline_from_yaml() - assert "DataTransfer component is not callable for import task." in str(e.value) + assert "DataTransfer component is not callable for import task." in str( + e.value + ) def test_dsl_pipeline_with_data_transfer_export_component(self) -> None: - blob_azuresql = load_component("./tests/test_configs/components/data_transfer/export_blob_to_database.yaml") + blob_azuresql = load_component( + "./tests/test_configs/components/data_transfer/export_blob_to_database.yaml" + ) - my_cosmos_folder = Input(type=AssetTypes.URI_FILE, path="/data/testFile_ForSqlDB.parquet") + my_cosmos_folder = Input( + type=AssetTypes.URI_FILE, path="/data/testFile_ForSqlDB.parquet" + ) connection_target_azuresql = "azureml:my_export_azuresqldb_connection" table_name = "dbo.Persons" - sink = {"type": "database", "connection": connection_target_azuresql, "table_name": table_name} + sink = { + "type": "database", + "connection": connection_target_azuresql, + "table_name": table_name, + } with pytest.raises(ValidationException) as e: @@ -2532,7 +3181,9 @@ def data_transfer_copy_pipeline_from_yaml(): blob_azuresql_node.sink = sink data_transfer_copy_pipeline_from_yaml() - assert "DataTransfer component is not callable for import task." in str(e.value) + assert "DataTransfer component is not callable for import task." in str( + e.value + ) def test_node_sweep_with_optional_input(self) -> None: component_yaml = components_dir / "helloworld_component_optional_input.yml" @@ -2554,15 +3205,21 @@ def pipeline_func(): ) pipeline_job = pipeline_func() - jobs_dict = pipeline_job._to_rest_object().as_dict()["properties"]["jobs"] + jobs_dict = as_attribute_dict(pipeline_job._to_rest_object())["properties"][ + "jobs" + ] # for node1 inputs, should contain required_input and optional_input; # while for node2 and node_sweep, should only contain required_input. assert jobs_dict["node1"]["inputs"] == { "required_input": {"job_input_type": "literal", "value": "1"}, "optional_input": {"job_input_type": "literal", "value": "2"}, } - assert jobs_dict["node2"]["inputs"] == {"required_input": {"job_input_type": "literal", "value": "1"}} - assert jobs_dict["node_sweep"]["inputs"] == {"required_input": {"job_input_type": "literal", "value": "1"}} + assert jobs_dict["node2"]["inputs"] == { + "required_input": {"job_input_type": "literal", "value": "1"} + } + assert jobs_dict["node_sweep"]["inputs"] == { + "required_input": {"job_input_type": "literal", "value": "1"} + } def test_dsl_pipeline_unprovided_required_input(self): component_yaml = components_dir / "helloworld_component_optional_input.yml" @@ -2577,7 +3234,8 @@ def pipeline_func(required_input: int, optional_input: int = 2): pipeline_job.settings.default_compute = "cpu-cluster" validate_result = pipeline_job._validate() assert validate_result.error_messages == { - "inputs.required_input": "Required input 'required_input' for pipeline " "'pipeline_func' not provided." + "inputs.required_input": "Required input 'required_input' for pipeline " + "'pipeline_func' not provided." } validate_result = pipeline_job.component._validate() @@ -2601,14 +3259,21 @@ def outer_pipeline(): validate_result = pipeline_job._validate() assert validate_result.passed - def test_dsl_pipeline_with_unprovided_pipeline_optional_input(self, client: MLClient) -> None: - component_func = load_component(source=str(components_dir / "default_optional_component.yml")) + def test_dsl_pipeline_with_unprovided_pipeline_optional_input( + self, client: MLClient + ) -> None: + component_func = load_component( + source=str(components_dir / "default_optional_component.yml") + ) # optional pipeline input binding to optional node input @dsl.pipeline() def pipeline_func(optional_input: Input(optional=True, type="uri_file")): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_input=optional_input, ) @@ -2625,7 +3290,10 @@ def pipeline_func( optional_param_duplicate: Input(optional=True, type="string"), ): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_param=optional_param, optional_param_with_default=optional_param_duplicate, @@ -2636,14 +3304,21 @@ def pipeline_func( validate_result = pipeline_job._validate() assert validate_result.error_messages == {} - def test_dsl_pipeline_with_unprovided_pipeline_required_input(self, client: MLClient) -> None: - component_func = load_component(source=str(components_dir / "default_optional_component.yml")) + def test_dsl_pipeline_with_unprovided_pipeline_required_input( + self, client: MLClient + ) -> None: + component_func = load_component( + source=str(components_dir / "default_optional_component.yml") + ) # required pipeline input binding to optional node input @dsl.pipeline() def pipeline_func(required_input: Input(optional=False, type="uri_file")): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_input=required_input, ) @@ -2652,7 +3327,8 @@ def pipeline_func(required_input: Input(optional=False, type="uri_file")): pipeline_job.settings.default_compute = "cpu-cluster" validate_result = pipeline_job._validate() assert validate_result.error_messages == { - "inputs.required_input": "Required input 'required_input' for pipeline " "'pipeline_func' not provided." + "inputs.required_input": "Required input 'required_input' for pipeline " + "'pipeline_func' not provided." } # required pipeline parameter binding to optional node parameter @@ -2662,7 +3338,10 @@ def pipeline_func( required_param_duplicate: Input(optional=False, type="string"), ): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_param=required_param, optional_param_with_default=required_param_duplicate, @@ -2672,16 +3351,24 @@ def pipeline_func( pipeline_job.settings.default_compute = "cpu-cluster" validate_result = pipeline_job._validate() assert validate_result.error_messages == { - "inputs.required_param": "Required input 'required_param' for pipeline " "'pipeline_func' not provided.", + "inputs.required_param": "Required input 'required_param' for pipeline " + "'pipeline_func' not provided.", "inputs.required_param_duplicate": "Required input 'required_param_duplicate' for pipeline " "'pipeline_func' not provided.", } # required pipeline parameter with default value binding to optional node parameter @dsl.pipeline() - def pipeline_func(required_param: Input(optional=False, type="string", default="pipeline_required_param")): + def pipeline_func( + required_param: Input( + optional=False, type="string", default="pipeline_required_param" + ) + ): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param=required_param, optional_param=required_param, optional_param_with_default=required_param, @@ -2692,14 +3379,21 @@ def pipeline_func(required_param: Input(optional=False, type="string", default=" validate_result = pipeline_job._validate() assert validate_result.error_messages == {} - def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_optional_input(self, client: MLClient) -> None: - component_func = load_component(source=str(components_dir / "default_optional_component.yml")) + def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_optional_input( + self, client: MLClient + ) -> None: + component_func = load_component( + source=str(components_dir / "default_optional_component.yml") + ) # optional pipeline input binding to optional node input @dsl.pipeline() def subgraph_pipeline(optional_input: Input(optional=True, type="uri_file")): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_input=optional_input, ) @@ -2720,7 +3414,10 @@ def subgraph_pipeline( optional_parameter_duplicate: Input(optional=True, type="string"), ): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_param=optional_parameter, optional_param_with_default=optional_parameter_duplicate, @@ -2735,14 +3432,21 @@ def root_pipeline(): validate_result = pipeline_job._validate() assert validate_result.error_messages == {} - def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_required_input(self, client: MLClient) -> None: - component_func = load_component(source=str(components_dir / "default_optional_component.yml")) + def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_required_input( + self, client: MLClient + ) -> None: + component_func = load_component( + source=str(components_dir / "default_optional_component.yml") + ) # required pipeline input binding to optional node input @dsl.pipeline() def subgraph_pipeline(required_input: Input(optional=False, type="uri_file")): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_input=required_input, ) @@ -2774,7 +3478,10 @@ def root_pipeline(required_input: Input(optional=False, type="uri_file")): @dsl.pipeline() def subgraph_pipeline(required_parameter: Input(optional=False, type="string")): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_param=required_parameter, ) @@ -2793,9 +3500,16 @@ def root_pipeline(): # required pipeline parameter with default value binding to optional node parameter @dsl.pipeline() - def subgraph_pipeline(required_parameter: Input(optional=False, type="string", default="subgraph_pipeline")): + def subgraph_pipeline( + required_parameter: Input( + optional=False, type="string", default="subgraph_pipeline" + ) + ): component_func( - required_input=Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv"), + required_input=Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ), required_param="def", optional_param=required_parameter, ) @@ -2810,27 +3524,46 @@ def root_pipeline(): assert validate_result.error_messages == {} def test_dsl_pipeline_with_return_annotation(self, client: MLClient) -> None: - hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" + hello_world_component_yaml = ( + "./tests/test_configs/components/helloworld_component.yml" + ) hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() - def my_pipeline() -> Output(type="uri_folder", description="new description", mode="upload"): - node = hello_world_component_func(component_in_path=Input(path="path/on/ds"), component_in_number=10) + def my_pipeline() -> ( + Output(type="uri_folder", description="new description", mode="upload") + ): + node = hello_world_component_func( + component_in_path=Input(path="path/on/ds"), component_in_number=10 + ) return {"output": node.outputs.component_out_path} pipeline_job = my_pipeline() expected_outputs = { - "output": {"description": "new description", "job_output_type": "uri_folder", "mode": "Upload"} + "output": { + "description": "new description", + "job_output_type": "uri_folder", + "mode": "Upload", + } } - assert pipeline_job._to_rest_object().as_dict()["properties"]["outputs"] == expected_outputs + assert ( + as_attribute_dict(pipeline_job._to_rest_object())["properties"]["outputs"] + == expected_outputs + ) def test_dsl_pipeline_run_settings(self) -> None: - hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" + hello_world_component_yaml = ( + "./tests/test_configs/components/helloworld_component.yml" + ) hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() - def my_pipeline() -> Output(type="uri_folder", description="new description", mode="upload"): - node = hello_world_component_func(component_in_path=Input(path="path/on/ds"), component_in_number=10) + def my_pipeline() -> ( + Output(type="uri_folder", description="new description", mode="upload") + ): + node = hello_world_component_func( + component_in_path=Input(path="path/on/ds"), component_in_number=10 + ) return {"output": node.outputs.component_out_path} pipeline_job: PipelineJob = my_pipeline() @@ -2848,8 +3581,13 @@ def my_pipeline() -> Output(type="uri_folder", description="new description", mo } def test_register_output_without_name_sdk(self): - component = load_component(source="./tests/test_configs/components/helloworld_component.yml") - component_input = Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv") + component = load_component( + source="./tests/test_configs/components/helloworld_component.yml" + ) + component_input = Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ) @dsl.pipeline() def register_node_output(): @@ -2860,7 +3598,9 @@ def register_node_output(): pipeline.settings.default_compute = "azureml:cpu-cluster" with pytest.raises(UserErrorException) as e: pipeline._validate() - assert "Output name is required when output version is specified." in str(e.value) + assert "Output name is required when output version is specified." in str( + e.value + ) @dsl.pipeline() def register_pipeline_output(): @@ -2872,11 +3612,18 @@ def register_pipeline_output(): pipeline.settings.default_compute = "azureml:cpu-cluster" with pytest.raises(UserErrorException) as e: pipeline._validate() - assert "Output name is required when output version is specified." in str(e.value) + assert "Output name is required when output version is specified." in str( + e.value + ) def test_register_output_with_invalid_name_sdk(self): - component = load_component(source="./tests/test_configs/components/helloworld_component.yml") - component_input = Input(type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv") + component = load_component( + source="./tests/test_configs/components/helloworld_component.yml" + ) + component_input = Input( + type="uri_file", + path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", + ) @dsl.pipeline() def register_node_output(): @@ -2896,7 +3643,9 @@ def register_node_output(): def test_pipeline_output_settings_copy(self): component_yaml = components_dir / "helloworld_component.yml" params_override = [{"outputs": {"component_out_path": {"type": "uri_file"}}}] - component_func1 = load_component(source=component_yaml, params_override=params_override) + component_func1 = load_component( + source=component_yaml, params_override=params_override + ) @dsl.pipeline() def my_pipeline(): @@ -2914,14 +3663,14 @@ def my_pipeline(): assert pipeline_job1.component.outputs["component_out_path"].path == "path1" assert pipeline_job2.outputs.component_out_path.path == "path1" assert pipeline_job2.component.outputs["component_out_path"].path == "path1" - pipeline_dict = pipeline_job1._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved & path will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_file", "uri": "new_path", } - pipeline_dict = pipeline_job2._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job2._to_rest_object()) # type will be preserved & path will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_file", @@ -2933,7 +3682,7 @@ def my_pipeline(): assert pipeline_job3.outputs.component_out_path.path == "path1" assert pipeline_job3.component.outputs["component_out_path"].path == "path1" - pipeline_dict = pipeline_job3._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job3._to_rest_object()) # type will be preserved & path will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_file", @@ -2943,7 +3692,9 @@ def my_pipeline(): def test_node_path_promotion(self): component_yaml = components_dir / "helloworld_component.yml" params_override = [{"outputs": {"component_out_path": {"type": "uri_file"}}}] - component_func1 = load_component(source=component_yaml, params_override=params_override) + component_func1 = load_component( + source=component_yaml, params_override=params_override + ) @dsl.pipeline() def my_pipeline(): @@ -2956,7 +3707,7 @@ def my_pipeline(): pipeline_job1 = my_pipeline() assert pipeline_job1.outputs.component_out_path.path == "path" - pipeline_dict = pipeline_job1._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved & path will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_folder", @@ -2973,7 +3724,7 @@ def outer_pipeline(): pipeline_job2 = outer_pipeline() assert pipeline_job2.outputs.component_out_path.path == "new_path" - pipeline_dict = pipeline_job2._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job2._to_rest_object()) # type will be preserved & path will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_folder", @@ -2983,7 +3734,9 @@ def outer_pipeline(): def test_node_output_type_promotion(self): component_yaml = components_dir / "helloworld_component.yml" params_override = [{"outputs": {"component_out_path": {"type": "uri_file"}}}] - component_func1 = load_component(source=component_yaml, params_override=params_override) + component_func1 = load_component( + source=component_yaml, params_override=params_override + ) # without node level setting, node should have same type with component @dsl.pipeline() @@ -2994,8 +3747,11 @@ def my_pipeline(): pipeline_job1 = my_pipeline() assert pipeline_job1.outputs.component_out_path.type == "uri_file" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] - assert pipeline_dict["outputs"]["component_out_path"]["job_output_type"] == "uri_file" + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] + assert ( + pipeline_dict["outputs"]["component_out_path"]["job_output_type"] + == "uri_file" + ) # when node level has output setting except type, node should have same type with component @dsl.pipeline() @@ -3007,7 +3763,7 @@ def my_pipeline(): pipeline_job1 = my_pipeline() assert pipeline_job1.outputs.component_out_path.type == "uri_file" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] # pipeline level should have correct type & copied mode assert pipeline_dict["outputs"]["component_out_path"] == { "job_output_type": "uri_file", @@ -3031,8 +3787,11 @@ def my_pipeline(): pipeline_job1 = my_pipeline() # assert pipeline_job1.outputs.component_out_path.type == "mlflow_model" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] - assert pipeline_dict["outputs"]["component_out_path"]["job_output_type"] == "mlflow_model" + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] + assert ( + pipeline_dict["outputs"]["component_out_path"]["job_output_type"] + == "mlflow_model" + ) # when pipeline level has setting, node should respect the setting @dsl.pipeline() @@ -3046,13 +3805,20 @@ def my_pipeline(): pipeline_job1 = my_pipeline() pipeline_job1.outputs.component_out_path.type = "custom_model" assert pipeline_job1.outputs.component_out_path.type == "custom_model" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] - assert pipeline_dict["outputs"]["component_out_path"]["job_output_type"] == "custom_model" + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] + assert ( + pipeline_dict["outputs"]["component_out_path"]["job_output_type"] + == "custom_model" + ) def test_node_output_mode_promotion(self): component_yaml = components_dir / "helloworld_component.yml" - params_override = [{"outputs": {"component_out_path": {"mode": "mount", "type": "uri_file"}}}] - component_func1 = load_component(source=component_yaml, params_override=params_override) + params_override = [ + {"outputs": {"component_out_path": {"mode": "mount", "type": "uri_file"}}} + ] + component_func1 = load_component( + source=component_yaml, params_override=params_override + ) # without node level setting, node should have same type with component @dsl.pipeline() @@ -3063,9 +3829,11 @@ def my_pipeline(): pipeline_job1 = my_pipeline() # assert pipeline_job1.outputs.component_out_path.mode == "mount" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] - assert pipeline_dict["outputs"]["component_out_path"]["mode"] == "ReadWriteMount" - pipeline_dict = pipeline_job1._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] + assert ( + pipeline_dict["outputs"]["component_out_path"]["mode"] == "ReadWriteMount" + ) + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved & mode will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_file", @@ -3083,9 +3851,9 @@ def my_pipeline(): pipeline_job1 = my_pipeline() # assert pipeline_job1.outputs.component_out_path.mode == "upload" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] assert pipeline_dict["outputs"]["component_out_path"]["mode"] == "Upload" - pipeline_dict = pipeline_job1._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved & mode will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_file", @@ -3104,9 +3872,9 @@ def my_pipeline(): pipeline_job1 = my_pipeline() pipeline_job1.outputs.component_out_path.mode = "direct" assert pipeline_job1.outputs.component_out_path.mode == "direct" - pipeline_dict = pipeline_job1._to_rest_object().as_dict()["properties"] + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] assert pipeline_dict["outputs"]["component_out_path"]["mode"] == "Direct" - pipeline_dict = pipeline_job1._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved & mode will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { "job_output_type": "uri_file", @@ -3123,7 +3891,7 @@ def my_pipeline(): pipeline_job1 = my_pipeline() - pipeline_dict = pipeline_job1._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved # mode will be dropped and leave it to service side resolve # path will be promoted to pipeline level @@ -3131,7 +3899,9 @@ def my_pipeline(): "job_output_type": "uri_file", "uri": "path", } - assert pipeline_dict["properties"]["jobs"]["node1"]["outputs"]["component_out_path"] == { + assert pipeline_dict["properties"]["jobs"]["node1"]["outputs"][ + "component_out_path" + ] == { "type": "literal", "value": "${{parent.outputs.component_out_path}}", } @@ -3142,7 +3912,9 @@ def test_validate_pipeline_node_io_name_has_keyword(self, caplog): _pipeline_component_builder.module_logger = logging.getLogger(__file__) with caplog.at_level(logging.WARNING): - from test_configs.dsl_pipeline.pipeline_with_keyword_in_node_io.pipeline import pipeline_job + from test_configs.dsl_pipeline.pipeline_with_keyword_in_node_io.pipeline import ( + pipeline_job, + ) # validation should pass assert pipeline_job._customized_validate().passed @@ -3152,14 +3924,24 @@ def test_validate_pipeline_node_io_name_has_keyword(self, caplog): "can only be accessed with '{node_name}.{io}s[\"{io_name}\"]'" ) assert caplog.messages == [ - warning_template.format(io_name="__contains__", io="output", node_name="node"), - warning_template.format(io_name="items", io="output", node_name="upstream_node"), - warning_template.format(io_name="keys", io="input", node_name="downstream_node"), - warning_template.format(io_name="__hash__", io="output", node_name="pipeline_component_func"), + warning_template.format( + io_name="__contains__", io="output", node_name="node" + ), + warning_template.format( + io_name="items", io="output", node_name="upstream_node" + ), + warning_template.format( + io_name="keys", io="input", node_name="downstream_node" + ), + warning_template.format( + io_name="__hash__", io="output", node_name="pipeline_component_func" + ), ] def test_pass_pipeline_inpute_to_environment_variables(self): - component_yaml = r"./tests/test_configs/components/helloworld_component_no_paths.yml" + component_yaml = ( + r"./tests/test_configs/components/helloworld_component_no_paths.yml" + ) component_func = load_component(source=component_yaml) @dsl.pipeline( @@ -3171,14 +3953,16 @@ def pipeline(job_in_number: int, environment_variables: str): pipeline_job = pipeline() assert pipeline_job.jobs["hello_world_component"].environment_variables - pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] + pipeline_dict = as_attribute_dict(pipeline_job._to_rest_object())["properties"] assert ( pipeline_dict["jobs"]["hello_world_component"]["environment_variables"] == "${{parent.inputs.environment_variables}}" ) def test_node_name_underscore(self): - component_yaml = r"./tests/test_configs/components/helloworld_component_no_paths.yml" + component_yaml = ( + r"./tests/test_configs/components/helloworld_component_no_paths.yml" + ) component_func = load_component(source=component_yaml) @dsl.pipeline() @@ -3186,7 +3970,9 @@ def my_pipeline(): _ = component_func(component_in_number=1) pipeline_job = my_pipeline() - assert pipeline_job.jobs.keys() == {"microsoftsamplescommandcomponentbasic_nopaths_test"} + assert pipeline_job.jobs.keys() == { + "microsoftsamplescommandcomponentbasic_nopaths_test" + } assert ( pipeline_job.jobs["microsoftsamplescommandcomponentbasic_nopaths_test"].name == "microsoftsamplescommandcomponentbasic_nopaths_test" @@ -3237,7 +4023,9 @@ def my_pipeline(): assert pipeline_job.jobs.keys() == {"node", "node_1", "node_2", "node_3"} def test_pipeline_input_binding_limits_timeout(self): - component_yaml = r"./tests/test_configs/components/helloworld_component_no_paths.yml" + component_yaml = ( + r"./tests/test_configs/components/helloworld_component_no_paths.yml" + ) component_func = load_component(source=component_yaml) @dsl.pipeline @@ -3251,9 +4039,14 @@ def my_pipeline(timeout) -> PipelineJob: pipeline = my_pipeline(2) pipeline.settings.default_compute = "cpu-cluster" - pipeline_dict = pipeline._to_rest_object().as_dict() - assert pipeline_dict["properties"]["jobs"]["node_0"]["limits"]["timeout"] == "${{parent.inputs.timeout}}" - assert pipeline_dict["properties"]["jobs"]["node_1"]["limits"]["timeout"] == "PT1S" + pipeline_dict = as_attribute_dict(pipeline._to_rest_object()) + assert ( + pipeline_dict["properties"]["jobs"]["node_0"]["limits"]["timeout"] + == "${{parent.inputs.timeout}}" + ) + assert ( + pipeline_dict["properties"]["jobs"]["node_1"]["limits"]["timeout"] == "PT1S" + ) @pytest.mark.parametrize( "component_path, fields_to_test, fake_inputs", @@ -3261,7 +4054,9 @@ def my_pipeline(timeout) -> PipelineJob: pytest.param( "./tests/test_configs/components/helloworld_component.yml", { - "resources.instance_count": JobResourceConfiguration(instance_count=1), + "resources.instance_count": JobResourceConfiguration( + instance_count=1 + ), # do not support data binding expression on queue_settings as it involves value mapping in # _to_rest_object # "queue_settings.priority": QueueSettings(priority="low"), @@ -3272,7 +4067,9 @@ def my_pipeline(timeout) -> PipelineJob: pytest.param( "./tests/test_configs/components/basic_parallel_component_score.yml", { - "resources.instance_count": JobResourceConfiguration(instance_count=1), + "resources.instance_count": JobResourceConfiguration( + instance_count=1 + ), }, {}, id="parallel.resources", @@ -3280,7 +4077,9 @@ def my_pipeline(timeout) -> PipelineJob: pytest.param( "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/add_greeting_column_component.yml", { - "resources.runtime_version": SparkResourceConfiguration(runtime_version="2.4"), + "resources.runtime_version": SparkResourceConfiguration( + runtime_version="2.4" + ), # seems that `type` is the only field for `identity` and hasn't been exposed to user # "identity.type": AmlTokenConfiguration(), # spark.entry doesn't support overwrite from node level for now, more details in @@ -3295,7 +4094,10 @@ def my_pipeline(timeout) -> PipelineJob: ], ) def test_data_binding_expression_on_node_runsettings( - self, component_path: str, fields_to_test: Dict[str, Any], fake_inputs: Dict[str, Input] + self, + component_path: str, + fields_to_test: Dict[str, Any], + fake_inputs: Dict[str, Input], ): component = load_component(component_path) @@ -3338,7 +4140,9 @@ def pipeline1(): node1 = component_func() node1.name = "node1" assert get_predecessors(node1) == [] - node2 = component_func(input1=node1.outputs.output1, input2=node1.outputs.output2) + node2 = component_func( + input1=node1.outputs.output1, input2=node1.outputs.output2 + ) assert ["node1"] == [n.name for n in get_predecessors(node2)] return node1.outputs @@ -3355,7 +4159,9 @@ def pipeline2(): node2.name = "node2" assert get_predecessors(node2) == [] - node2 = component_func(input1=node1.outputs.output1, input2=node2.outputs.output2) + node2 = component_func( + input1=node1.outputs.output1, input2=node2.outputs.output2 + ) assert ["node1", "node2"] == [n.name for n in get_predecessors(node2)] return node2.outputs @@ -3365,7 +4171,9 @@ def pipeline2(): @dsl.pipeline() def pipeline3(): sub1 = pipeline1() - node3 = component_func(input1=sub1.outputs.output1, input2=sub1.outputs.output2) + node3 = component_func( + input1=sub1.outputs.output1, input2=sub1.outputs.output2 + ) assert ["node1"] == [n.name for n in get_predecessors(node3)] pipeline3() @@ -3375,7 +4183,9 @@ def pipeline3(): def pipeline4(): sub1 = pipeline1() sub2 = pipeline2() - node3 = component_func(input1=sub1.outputs.output1, input2=sub2.outputs.output2) + node3 = component_func( + input1=sub1.outputs.output1, input2=sub2.outputs.output2 + ) assert ["node1", "node2"] == [n.name for n in get_predecessors(node3)] pipeline4() @@ -3437,7 +4247,9 @@ def pipeline8(): pipeline8() def test_pipeline_singularity_strong_type(self, mock_singularity_arm_id: str): - component_yaml = "./tests/test_configs/components/helloworld_component_singularity.yml" + component_yaml = ( + "./tests/test_configs/components/helloworld_component_singularity.yml" + ) component_func = load_component(component_yaml) instance_type = "Singularity.ND40rs_v2" @@ -3446,16 +4258,28 @@ def test_pipeline_singularity_strong_type(self, mock_singularity_arm_id: str): def pipeline_func(): # basic job_tier + Low priority basic_low_node = component_func() - basic_low_node.resources = JobResourceConfiguration(instance_count=2, instance_type=instance_type) - basic_low_node.queue_settings = QueueSettings(job_tier="basic", priority="low") + basic_low_node.resources = JobResourceConfiguration( + instance_count=2, instance_type=instance_type + ) + basic_low_node.queue_settings = QueueSettings( + job_tier="basic", priority="low" + ) # standard job_tier + Medium priority standard_medium_node = component_func() - standard_medium_node.resources = JobResourceConfiguration(instance_count=2, instance_type=instance_type) - standard_medium_node.queue_settings = QueueSettings(job_tier="standard", priority="medium") + standard_medium_node.resources = JobResourceConfiguration( + instance_count=2, instance_type=instance_type + ) + standard_medium_node.queue_settings = QueueSettings( + job_tier="standard", priority="medium" + ) # premium job_tier + High priority premium_high_node = component_func() - premium_high_node.resources = JobResourceConfiguration(instance_count=2, instance_type=instance_type) - premium_high_node.queue_settings = QueueSettings(job_tier="premium", priority="high") + premium_high_node.resources = JobResourceConfiguration( + instance_count=2, instance_type=instance_type + ) + premium_high_node.queue_settings = QueueSettings( + job_tier="premium", priority="high" + ) # properties node_with_properties = component_func() properties = {"Singularity": {"imageVersion": "", "interactive": False}} @@ -3466,24 +4290,50 @@ def pipeline_func(): pipeline_job = pipeline_func() pipeline_job.settings.default_compute = mock_singularity_arm_id - pipeline_job_dict = pipeline_job._to_rest_object().as_dict() + pipeline_job_dict = as_attribute_dict(pipeline_job._to_rest_object()) # basic job_tier + Low priority basic_low_node_dict = pipeline_job_dict["properties"]["jobs"]["basic_low_node"] - assert basic_low_node_dict["queue_settings"] == {"job_tier": "Basic", "priority": 1} - assert basic_low_node_dict["resources"] == {"instance_count": 2, "instance_type": instance_type} + assert basic_low_node_dict["queue_settings"] == { + "job_tier": "Basic", + "priority": 1, + } + assert basic_low_node_dict["resources"] == { + "instance_count": 2, + "instance_type": instance_type, + } # standard job_tier + Medium priority - standard_medium_node_dict = pipeline_job_dict["properties"]["jobs"]["standard_medium_node"] - assert standard_medium_node_dict["queue_settings"] == {"job_tier": "Standard", "priority": 2} - assert standard_medium_node_dict["resources"] == {"instance_count": 2, "instance_type": instance_type} + standard_medium_node_dict = pipeline_job_dict["properties"]["jobs"][ + "standard_medium_node" + ] + assert standard_medium_node_dict["queue_settings"] == { + "job_tier": "Standard", + "priority": 2, + } + assert standard_medium_node_dict["resources"] == { + "instance_count": 2, + "instance_type": instance_type, + } # premium job_tier + High priority - premium_high_node_dict = pipeline_job_dict["properties"]["jobs"]["premium_high_node"] - assert premium_high_node_dict["queue_settings"] == {"job_tier": "Premium", "priority": 3} - assert premium_high_node_dict["resources"] == {"instance_count": 2, "instance_type": instance_type} + premium_high_node_dict = pipeline_job_dict["properties"]["jobs"][ + "premium_high_node" + ] + assert premium_high_node_dict["queue_settings"] == { + "job_tier": "Premium", + "priority": 3, + } + assert premium_high_node_dict["resources"] == { + "instance_count": 2, + "instance_type": instance_type, + } # properties - node_with_properties_dict = pipeline_job_dict["properties"]["jobs"]["node_with_properties"] + node_with_properties_dict = pipeline_job_dict["properties"]["jobs"][ + "node_with_properties" + ] assert node_with_properties_dict["resources"] == { "instance_count": 2, "instance_type": instance_type, # the mapping Singularity => AISuperComputer is expected - "properties": {"AISuperComputer": {"imageVersion": "", "interactive": False}}, + "properties": { + "AISuperComputer": {"imageVersion": "", "interactive": False} + }, } diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py index 3d4671389072..481f7f247fe1 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py @@ -14,6 +14,7 @@ from azure.ai.ml import MLClient, load_job from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.exceptions import ValidationException +from azure.core.serialization import as_attribute_dict from .._util import _DSL_TIMEOUT_SECOND @@ -26,9 +27,9 @@ def assert_dsl_curated(pipeline, job_yaml, omit_fields): omit_fields.extend(["properties.jobs.*._source", "properties.settings._source"]) - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) pipeline_from_yaml = load_job(source=job_yaml) - pipeline_job_dict = pipeline_from_yaml._to_rest_object().as_dict() + pipeline_job_dict = as_attribute_dict(pipeline_from_yaml._to_rest_object()) dsl_pipeline_job_dict = omit_with_wildcard(dsl_pipeline_job_dict, *omit_fields) pipeline_job_dict = omit_with_wildcard(pipeline_job_dict, *omit_fields) @@ -58,7 +59,9 @@ def test_e2e_local_components(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_basic_component(self) -> None: - from test_configs.dsl_pipeline.basic_component.pipeline import generate_dsl_pipeline as basic_component + from test_configs.dsl_pipeline.basic_component.pipeline import ( + generate_dsl_pipeline as basic_component, + ) pipeline = basic_component() job_yaml = str(samples_dir / "basic_component/pipeline.yml") @@ -87,7 +90,9 @@ def test_component_with_input_output(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_basic_pipeline(self) -> None: - from test_configs.dsl_pipeline.basic_pipeline.pipeline import generate_dsl_pipeline as basic_pipeline + from test_configs.dsl_pipeline.basic_pipeline.pipeline import ( + generate_dsl_pipeline as basic_pipeline, + ) pipeline = basic_pipeline() job_yaml = str(samples_dir / "basic_pipeline/pipeline.yml") @@ -100,7 +105,9 @@ def test_basic_pipeline(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_pipeline_with_data(self) -> None: - from test_configs.dsl_pipeline.pipline_with_data.pipeline import generate_dsl_pipeline as pipline_with_data + from test_configs.dsl_pipeline.pipline_with_data.pipeline import ( + generate_dsl_pipeline as pipline_with_data, + ) pipeline = pipline_with_data() job_yaml = str(samples_dir / "pipline_with_data/pipeline.yml") @@ -114,7 +121,9 @@ def test_pipeline_with_data(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_local_data_input(self) -> None: - from test_configs.dsl_pipeline.local_data_input.pipeline import generate_dsl_pipeline as local_data_input + from test_configs.dsl_pipeline.local_data_input.pipeline import ( + generate_dsl_pipeline as local_data_input, + ) pipeline = local_data_input() job_yaml = str(samples_dir / "local_data_input/pipeline.yml") @@ -158,13 +167,17 @@ def test_datastore_datapath_uri_file(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_dataset_input(self, mock_machinelearning_client: MLClient) -> None: - from test_configs.dsl_pipeline.dataset_input.pipeline import generate_dsl_pipeline as dataset_input + from test_configs.dsl_pipeline.dataset_input.pipeline import ( + generate_dsl_pipeline as dataset_input, + ) def get_dataset(*args, **kwargs): return "sampledata1235:2" # change internal assets into arm id - with mock.patch("azure.ai.ml._ml_client.DataOperations.get", side_effect=get_dataset): + with mock.patch( + "azure.ai.ml._ml_client.DataOperations.get", side_effect=get_dataset + ): pipeline = dataset_input(mock_machinelearning_client) job_yaml = str(samples_dir / "dataset_input/pipeline.yml") omit_fields = [ @@ -182,7 +195,9 @@ def get_dataset(*args, **kwargs): assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_web_url_input(self) -> None: - from test_configs.dsl_pipeline.web_url_input.pipeline import generate_dsl_pipeline as web_url_input + from test_configs.dsl_pipeline.web_url_input.pipeline import ( + generate_dsl_pipeline as web_url_input, + ) pipeline = web_url_input() job_yaml = str(samples_dir / "web_url_input/pipeline.yml") @@ -210,7 +225,9 @@ def test_env_public_docker_image(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_env_registered(self) -> None: - from test_configs.dsl_pipeline.env_registered.pipeline import generate_dsl_pipeline as env_registered + from test_configs.dsl_pipeline.env_registered.pipeline import ( + generate_dsl_pipeline as env_registered, + ) pipeline = env_registered() job_yaml = str(samples_dir / "env_registered/pipeline.yml") @@ -223,7 +240,9 @@ def test_env_registered(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_env_conda_file(self) -> None: - from test_configs.dsl_pipeline.env_conda_file.pipeline import generate_dsl_pipeline as env_conda_file + from test_configs.dsl_pipeline.env_conda_file.pipeline import ( + generate_dsl_pipeline as env_conda_file, + ) pipeline = env_conda_file() job_yaml = str(samples_dir / "env_conda_file/pipeline.yml") @@ -236,7 +255,9 @@ def test_env_conda_file(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_tf_hello_world(self) -> None: - from test_configs.dsl_pipeline.tf_hello_world.pipeline import generate_dsl_pipeline as tf_hello_world + from test_configs.dsl_pipeline.tf_hello_world.pipeline import ( + generate_dsl_pipeline as tf_hello_world, + ) pipeline = tf_hello_world() job_yaml = str(samples_dir / "tf_hello_world/pipeline.yml") @@ -249,7 +270,9 @@ def test_tf_hello_world(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_mpi_hello_world(self) -> None: - from test_configs.dsl_pipeline.mpi_hello_world.pipeline import generate_dsl_pipeline as mpi_hello_world + from test_configs.dsl_pipeline.mpi_hello_world.pipeline import ( + generate_dsl_pipeline as mpi_hello_world, + ) pipeline = mpi_hello_world() job_yaml = str(samples_dir / "mpi_hello_world/pipeline.yml") @@ -262,7 +285,9 @@ def test_mpi_hello_world(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_pytorch_hello_world(self) -> None: - from test_configs.dsl_pipeline.pytorch_hello_world.pipeline import generate_dsl_pipeline as pytorch_hello_world + from test_configs.dsl_pipeline.pytorch_hello_world.pipeline import ( + generate_dsl_pipeline as pytorch_hello_world, + ) pipeline = pytorch_hello_world() job_yaml = str(samples_dir / "pytorch_hello_world/pipeline.yml") @@ -290,7 +315,9 @@ def test_nyc_taxi_data_regression(self) -> None: assert_dsl_curated(pipeline, job_yaml, omit_fields) def test_tf_mnist(self) -> None: - from test_configs.dsl_pipeline.tf_mnist.pipeline import generate_dsl_pipeline as tf_mnist + from test_configs.dsl_pipeline.tf_mnist.pipeline import ( + generate_dsl_pipeline as tf_mnist, + ) pipeline = tf_mnist() job_yaml = str(samples_dir / "tf_mnist/pipeline.yml") @@ -350,7 +377,9 @@ def test_parallel_components_with_tabular_input( ) pipeline = pipeline_with_parallel_components() - job_yaml = str(samples_dir / "parallel_component_with_tabular_input/pipeline.yml") + job_yaml = str( + samples_dir / "parallel_component_with_tabular_input/pipeline.yml" + ) omit_fields = [ "name", "properties.display_name", @@ -453,7 +482,9 @@ def test_data_transfer_copy_job_in_pipeline(self) -> None: ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline.yml") + job_yaml = str( + samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline.yml" + ) omit_fields = [ "properties.display_name", "properties.jobs.merge_files.componentId", @@ -468,7 +499,9 @@ def test_data_transfer_copy_inline_job_in_pipeline(self) -> None: ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml") + job_yaml = str( + samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml" + ) omit_fields = [ "properties.display_name", "properties.jobs.merge_files.componentId", @@ -483,7 +516,9 @@ def test_data_transfer_copy_job_builder_with_inline_job(self) -> None: ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml") + job_yaml = str( + samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml" + ) omit_fields = [ "properties.display_name", "properties.jobs.merge_files.componentId", @@ -498,19 +533,27 @@ def test_data_transfer_import_database_job_builder_with_inline_job(self) -> None ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/import_database/pipeline_inline.yml") + job_yaml = str( + samples_dir + / "data_transfer_job_in_pipeline/import_database/pipeline_inline.yml" + ) omit_fields = [ "properties.display_name", ] assert_dsl_curated(pipeline, job_yaml, omit_fields) - def test_data_transfer_import_stored_database_job_builder_with_inline_job(self) -> None: + def test_data_transfer_import_stored_database_job_builder_with_inline_job( + self, + ) -> None: from test_configs.dsl_pipeline.data_transfer_job_in_pipeline.import_stored_database.pipeline import ( generate_dsl_pipeline_from_builder as data_transfer_job_in_pipeline, ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/import_stored_database/pipeline_inline.yml") + job_yaml = str( + samples_dir + / "data_transfer_job_in_pipeline/import_stored_database/pipeline_inline.yml" + ) omit_fields = [ "properties.display_name", ] @@ -522,7 +565,10 @@ def test_data_transfer_import_file_system_job_builder_with_inline_job(self) -> N ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/import_file_system/pipeline_inline.yml") + job_yaml = str( + samples_dir + / "data_transfer_job_in_pipeline/import_file_system/pipeline_inline.yml" + ) omit_fields = [ "properties.display_name", ] @@ -534,7 +580,10 @@ def test_data_transfer_export_database_job_builder_with_inline_job(self) -> None ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/export_database/pipeline_inline.yml") + job_yaml = str( + samples_dir + / "data_transfer_job_in_pipeline/export_database/pipeline_inline.yml" + ) omit_fields = [ "properties.display_name", "properties.inputs.cosmos_folder.uri", @@ -547,18 +596,23 @@ def test_data_transfer_export_file_system_job_builder_with_inline_job(self) -> N generate_dsl_pipeline_from_builder as data_transfer_job_in_pipeline, ) - job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/export_file_system/pipeline_inline.yml") + job_yaml = str( + samples_dir + / "data_transfer_job_in_pipeline/export_file_system/pipeline_inline.yml" + ) with pytest.raises(ValidationException) as e: data_transfer_job_in_pipeline() assert ( - "Sink is a required field for export data task and we don't support exporting file system for now." in e + "Sink is a required field for export data task and we don't support exporting file system for now." + in e ) with pytest.raises(ValidationException) as e: load_job(source=job_yaml) assert ( - "Sink is a required field for export data task and we don't support exporting file system for now." in e + "Sink is a required field for export data task and we don't support exporting file system for now." + in e ) def test_data_transfer_multi_job_in_pipeline(self) -> None: diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py index 1f461272d9b9..573abf3c9e4f 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py @@ -4,18 +4,40 @@ import pytest from test_utilities.utils import omit_with_wildcard, parse_local_path +from azure.core.serialization import as_attribute_dict from azure.ai.ml import Input, Output, command, dsl, load_component, spark from azure.ai.ml import UserIdentityConfiguration from azure.ai.ml.automl import classification, regression from azure.ai.ml.constants._common import AssetTypes, InputOutputModes from azure.ai.ml.constants._component import DataCopyMode -from azure.ai.ml.data_transfer import Database, FileSystem, copy_data, export_data, import_data +from azure.ai.ml.data_transfer import ( + Database, + FileSystem, + copy_data, + export_data, + import_data, +) from azure.ai.ml.dsl._load_import import to_component -from azure.ai.ml.entities import CommandComponent, CommandJob, Data, ParallelTask, PipelineJob, SparkJob -from azure.ai.ml.entities._builders import Command, DataTransferImport, Parallel, Spark, Sweep +from azure.ai.ml.entities import ( + CommandComponent, + CommandJob, + Data, + ParallelTask, + PipelineJob, + SparkJob, +) +from azure.ai.ml.entities._builders import ( + Command, + DataTransferImport, + Parallel, + Spark, + Sweep, +) from azure.ai.ml.entities._component.parallel_component import ParallelComponent from azure.ai.ml.entities._job.automl.tabular import ClassificationJob -from azure.ai.ml.entities._job.data_transfer.data_transfer_job import DataTransferCopyJob +from azure.ai.ml.entities._job.data_transfer.data_transfer_job import ( + DataTransferCopyJob, +) from azure.ai.ml.entities._job.job_service import ( JobService, JupyterLabJobService, @@ -52,8 +74,12 @@ class TestDSLPipelineWithSpecificNodes: def test_dsl_pipeline_sweep_node(self) -> None: yaml_file = "./tests/test_configs/components/helloworld_component.yml" - @dsl.pipeline(name="train_with_sweep_in_pipeline", default_compute="cpu-cluster") - def train_with_sweep_in_pipeline(raw_data, primary_metric: str = "AUC", max_total_trials: int = 10): + @dsl.pipeline( + name="train_with_sweep_in_pipeline", default_compute="cpu-cluster" + ) + def train_with_sweep_in_pipeline( + raw_data, primary_metric: str = "AUC", max_total_trials: int = 10 + ): component_to_sweep: CommandComponent = load_component(source=yaml_file) cmd_node1: Command = component_to_sweep( component_in_number=Choice([2, 3, 4, 5]), component_in_path=raw_data @@ -87,7 +113,9 @@ def train_with_sweep_in_pipeline(raw_data, primary_metric: str = "AUC", max_tota max_total_trials=10, ) - component_to_link = load_component(source=yaml_file, params_override=[{"name": "node_to_link"}]) + component_to_link = load_component( + source=yaml_file, params_override=[{"name": "node_to_link"}] + ) link_node = component_to_link( component_in_number=2, component_in_path=sweep_job1.outputs.component_out_path, @@ -105,7 +133,9 @@ def train_with_sweep_in_pipeline(raw_data, primary_metric: str = "AUC", max_tota max_total_trials=100, primary_metric="accuracy", ) - assert len(pipeline.jobs) == 4, f"Expect 4 nodes are collected but got {len(pipeline.jobs)}" + assert ( + len(pipeline.jobs) == 4 + ), f"Expect 4 nodes are collected but got {len(pipeline.jobs)}" assert pipeline.component._source == "DSL" assert pipeline.component._job_types == {"sweep": 3, "command": 1} assert pipeline.component._job_sources == {"YAML.COMPONENT": 4} @@ -115,9 +145,13 @@ def train_with_sweep_in_pipeline(raw_data, primary_metric: str = "AUC", max_tota sweep_node_dict = sweep_node._to_dict() assert pydash.get(sweep_node_dict, "limits.max_total_trials", None) == 10 sweep_node_rest_obj = sweep_node._to_rest_object() - sweep_node_dict_from_rest = Sweep._from_rest_object(sweep_node_rest_obj)._to_dict() + sweep_node_dict_from_rest = Sweep._from_rest_object( + sweep_node_rest_obj + )._to_dict() omit_fields = ["trial"] - assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit(sweep_node_dict_from_rest, *omit_fields) + assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit( + sweep_node_dict_from_rest, *omit_fields + ) pipeline_dict = pipeline._to_dict() for dot_key, expected_value in [ @@ -141,7 +175,9 @@ def train_with_sweep_in_pipeline(raw_data, primary_metric: str = "AUC", max_tota "outputs", # TODO: figure out why outputs can't be regenerated correctly ] # Change float to string to make dict from local and rest compatible - pipeline_dict["inputs"]["max_total_trials"] = str(pipeline_dict["inputs"]["max_total_trials"]) + pipeline_dict["inputs"]["max_total_trials"] = str( + pipeline_dict["inputs"]["max_total_trials"] + ) pipeline_dict["jobs"]["link_node"]["inputs"]["component_in_number"] = str( pipeline_dict["jobs"]["link_node"]["inputs"]["component_in_number"] ) @@ -179,8 +215,12 @@ def train_with_sweep_in_pipeline(): sampling_algorithm="random", ) hello_sweep.compute = "cpu-cluster" - hello_sweep.set_limits(max_total_trials=2, max_concurrent_trials=3, timeout=600) - hello_sweep.early_termination = BanditPolicy(evaluation_interval=2, slack_factor=0.1, delay_evaluation=1) + hello_sweep.set_limits( + max_total_trials=2, max_concurrent_trials=3, timeout=600 + ) + hello_sweep.early_termination = BanditPolicy( + evaluation_interval=2, slack_factor=0.1, delay_evaluation=1 + ) dsl_pipeline: PipelineJob = train_with_sweep_in_pipeline() dsl_pipeline.jobs["hello_sweep"].outputs.trained_model_dir = Output( @@ -194,9 +234,13 @@ def train_with_sweep_in_pipeline(): sweep_node.component._id = "azureml:test_component:1" sweep_node_dict = sweep_node._to_dict() sweep_node_rest_obj = sweep_node._to_rest_object() - sweep_node_dict_from_rest = Sweep._from_rest_object(sweep_node_rest_obj)._to_dict() + sweep_node_dict_from_rest = Sweep._from_rest_object( + sweep_node_rest_obj + )._to_dict() omit_fields = ["trial"] - assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit(sweep_node_dict_from_rest, *omit_fields) + assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit( + sweep_node_dict_from_rest, *omit_fields + ) def test_dsl_pipeline_with_sweep_distributed_component_setting_instance_type( self, @@ -206,7 +250,9 @@ def test_dsl_pipeline_with_sweep_distributed_component_setting_instance_type( @dsl.pipeline(force_rerun=True) def train_with_sweep_in_pipeline(raw_data): component_to_sweep: CommandComponent = load_component(source=yaml_file) - cmd_node: Command = component_to_sweep(component_in_number=Choice([2, 3, 4, 5]), component_in_path=raw_data) + cmd_node: Command = component_to_sweep( + component_in_number=Choice([2, 3, 4, 5]), component_in_path=raw_data + ) sweep_job: Sweep = cmd_node.sweep( primary_metric="AUC", # primary_metric, goal="maximize", @@ -216,7 +262,9 @@ def train_with_sweep_in_pipeline(raw_data): sweep_job.compute = "test-aks-large" sweep_job.set_limits(max_total_trials=10) - pipeline: PipelineJob = train_with_sweep_in_pipeline(raw_data=Input(path="/a/path/on/ds", mode="ro_mount")) + pipeline: PipelineJob = train_with_sweep_in_pipeline( + raw_data=Input(path="/a/path/on/ds", mode="ro_mount") + ) pipeline.settings.default_compute = "test-aks-large" pytorch_node = pipeline.jobs["sweep_job"] @@ -227,7 +275,9 @@ def train_with_sweep_in_pipeline(raw_data): "limits": {"max_total_trials": 10}, "sampling_algorithm": "random", "objective": {"goal": "maximize", "primary_metric": "AUC"}, - "search_space": {"component_in_number": {"values": [2, 3, 4, 5], "type": "choice"}}, + "search_space": { + "component_in_number": {"values": [2, 3, 4, 5], "type": "choice"} + }, "name": "sweep_job", "type": "sweep", "computeId": "test-aks-large", @@ -275,7 +325,9 @@ def train_with_parallel_in_pipeline(): regenerated_parallel_node._base_path = Path(yaml_file).parent parallel_node_dict_from_rest = regenerated_parallel_node._to_dict() omit_fields = ["component"] - assert pydash.omit(parallel_node_dict, *omit_fields) == pydash.omit(parallel_node_dict_from_rest, *omit_fields) + assert pydash.omit(parallel_node_dict, *omit_fields) == pydash.omit( + parallel_node_dict_from_rest, *omit_fields + ) def test_dsl_pipeline_with_spark(self) -> None: add_greeting_column_func = load_component( @@ -315,14 +367,18 @@ def spark_pipeline_from_yaml(iris_data): spark_node_dict_from_rest = regenerated_spark_node._to_dict() omit_fields = [] - assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit(spark_node_dict_from_rest, *omit_fields) + assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit( + spark_node_dict_from_rest, *omit_fields + ) omit_fields = [ "jobs.add_greeting_column.componentId", "jobs.add_greeting_column.properties", "jobs.count_by_row.componentId", "jobs.count_by_row.properties", ] - actual_job = pydash.omit(dsl_pipeline._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = pydash.omit( + as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields + ) assert actual_job == { "description": "submit a pipeline with spark job", "display_name": "spark_pipeline_from_yaml", @@ -365,7 +421,8 @@ def spark_pipeline_from_yaml(iris_data): }, "count_by_row": { "_source": "YAML.COMPONENT", - "args": "--file_input ${{inputs.file_input}} " "--output ${{outputs.output}}", + "args": "--file_input ${{inputs.file_input}} " + "--output ${{outputs.output}}", "computeId": "spark31", "conf": { "spark.driver.cores": 2, @@ -413,7 +470,9 @@ def test_pipeline_with_command_function(self): expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} inputs = { - "component_in_path": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), + "component_in_path": Input( + type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount" + ), "component_in_number": 0.01, } outputs = {"component_out_path": Output(type="mlflow_model", mode="rw_mount")} @@ -469,7 +528,7 @@ def pipeline(number, path): ] pipeline1 = pipeline(10, data) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -618,8 +677,12 @@ def test_pipeline_with_data_transfer_copy_function(self): @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_copy_function") def pipeline(folder1, folder2): node1 = component_func(folder1=folder1, folder2=folder2) - node2 = data_transfer_job_func(folder1=node1.outputs.output_folder, folder2=node1.outputs.output_folder) - node3 = data_transfer_function(folder1=node2.outputs.output, folder2=node2.outputs.output) + node2 = data_transfer_job_func( + folder1=node1.outputs.output_folder, folder2=node1.outputs.output_folder + ) + node3 = data_transfer_function( + folder1=node2.outputs.output, folder2=node2.outputs.output + ) return { "pipeline_output": node3.outputs.output, } @@ -630,7 +693,7 @@ def pipeline(folder1, folder2): ] pipeline1 = pipeline(folder1, folder2) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -727,17 +790,21 @@ def test_pipeline_with_data_transfer_import_database_function(self): "query": query_source_snowflake, } - @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_import_database_function") + @dsl.pipeline( + experiment_name="test_pipeline_with_data_transfer_import_database_function" + ) def pipeline(query_source_snowflake, connection_target_azuresql): node1 = import_data(source=Database(**source), outputs=outputs) - source_snowflake = Database(query=query_source_snowflake, connection=connection_target_azuresql) + source_snowflake = Database( + query=query_source_snowflake, connection=connection_target_azuresql + ) node2 = import_data(source=source_snowflake, outputs=outputs) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] pipeline1 = pipeline(query_source_snowflake, connection_target_azuresql) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -790,20 +857,24 @@ def pipeline(query_source_snowflake, connection_target_azuresql): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() - regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( - data_transfer_import_node_rest_obj + data_transfer_import_node_rest_obj = ( + data_transfer_import_node._to_rest_object() + ) + regenerated_data_transfer_import_node = ( + DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) ) - data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() + data_transfer_import_node_dict_from_rest = ( + regenerated_data_transfer_import_node._to_dict() + ) # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( - data_transfer_import_node_dict_from_rest, *omit_fields - ) + assert pydash.omit( + data_transfer_import_node_dict, *omit_fields + ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) def test_pipeline_with_data_transfer_import_stored_database_function(self): stored_procedure = "SelectEmployeeByJobAndDepartment" @@ -817,13 +888,15 @@ def test_pipeline_with_data_transfer_import_stored_database_function(self): "stored_procedure_params": stored_procedure_params, } - @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_import_stored_database_function") + @dsl.pipeline( + experiment_name="test_pipeline_with_data_transfer_import_stored_database_function" + ) def pipeline(): node2 = import_data(source=Database(**source), outputs=outputs) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] pipeline1 = pipeline() - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -862,20 +935,24 @@ def pipeline(): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() - regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( - data_transfer_import_node_rest_obj + data_transfer_import_node_rest_obj = ( + data_transfer_import_node._to_rest_object() + ) + regenerated_data_transfer_import_node = ( + DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) ) - data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() + data_transfer_import_node_dict_from_rest = ( + regenerated_data_transfer_import_node._to_dict() + ) # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( - data_transfer_import_node_dict_from_rest, *omit_fields - ) + assert pydash.omit( + data_transfer_import_node_dict, *omit_fields + ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) def test_pipeline_with_data_transfer_import_file_system_function(self): path_source_s3 = "s3://my_bucket/my_folder" @@ -888,17 +965,21 @@ def test_pipeline_with_data_transfer_import_file_system_function(self): } source = {"connection": connection_target, "path": path_source_s3} - @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_import_file_system_function") + @dsl.pipeline( + experiment_name="test_pipeline_with_data_transfer_import_file_system_function" + ) def pipeline(path_source_s3, connection_target): node2 = import_data(source=FileSystem(**source), outputs=outputs) - source_snowflake = FileSystem(path=path_source_s3, connection=connection_target) + source_snowflake = FileSystem( + path=path_source_s3, connection=connection_target + ) node4 = import_data(source=source_snowflake, outputs=outputs) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] pipeline1 = pipeline(path_source_s3, connection_target) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -961,20 +1042,24 @@ def pipeline(path_source_s3, connection_target): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() - regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( - data_transfer_import_node_rest_obj + data_transfer_import_node_rest_obj = ( + data_transfer_import_node._to_rest_object() + ) + regenerated_data_transfer_import_node = ( + DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) ) - data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() + data_transfer_import_node_dict_from_rest = ( + regenerated_data_transfer_import_node._to_dict() + ) # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( - data_transfer_import_node_dict_from_rest, *omit_fields - ) + assert pydash.omit( + data_transfer_import_node_dict, *omit_fields + ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) def test_pipeline_with_data_transfer_export_database_function(self): connection_target_azuresql = "azureml:my_azuresql_connection" @@ -990,17 +1075,21 @@ def test_pipeline_with_data_transfer_export_database_function(self): "table_name": table_name, } - @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_export_database_function") + @dsl.pipeline( + experiment_name="test_pipeline_with_data_transfer_export_database_function" + ) def pipeline(table_name, connection_target_azuresql): node2 = export_data(inputs={"source": cosmos_folder}, sink=sink) - source_snowflake = Database(table_name=table_name, connection=connection_target_azuresql) + source_snowflake = Database( + table_name=table_name, connection=connection_target_azuresql + ) node4 = export_data(inputs={"source": cosmos_folder}, sink=source_snowflake) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] pipeline1 = pipeline(table_name, connection_target_azuresql) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -1063,20 +1152,24 @@ def pipeline(table_name, connection_target_azuresql): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() - regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( - data_transfer_import_node_rest_obj + data_transfer_import_node_rest_obj = ( + data_transfer_import_node._to_rest_object() + ) + regenerated_data_transfer_import_node = ( + DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) ) - data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() + data_transfer_import_node_dict_from_rest = ( + regenerated_data_transfer_import_node._to_dict() + ) # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( - data_transfer_import_node_dict_from_rest, *omit_fields - ) + assert pydash.omit( + data_transfer_import_node_dict, *omit_fields + ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) def test_pipeline_with_spark_function(self): # component func @@ -1135,9 +1228,13 @@ def test_pipeline_with_spark_function(self): def pipeline(iris_data, sample_rate): node1 = component_func(input1=iris_data, sample_rate=sample_rate) node1.compute = synapse_compute_name - node2 = spark_job_func(input1=node1.outputs.output1, sample_rate=sample_rate) + node2 = spark_job_func( + input1=node1.outputs.output1, sample_rate=sample_rate + ) node2.compute = synapse_compute_name - node3 = spark_function(input1=node2.outputs.output1, sample_rate=sample_rate) + node3 = spark_function( + input1=node2.outputs.output1, sample_rate=sample_rate + ) return { "pipeline_output1": node1.outputs.output1, "pipeline_output2": node2.outputs.output1, @@ -1152,7 +1249,7 @@ def pipeline(iris_data, sample_rate): ] pipeline1 = pipeline(iris_data, sample_rate) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -1365,9 +1462,13 @@ def test_pipeline_with_spark_function_by_setting_conf(self, client): def pipeline(iris_data, sample_rate): node1 = component_func(input1=iris_data, sample_rate=sample_rate) node1.compute = synapse_compute_name - node2 = spark_job_func(input1=node1.outputs.output1, sample_rate=sample_rate) + node2 = spark_job_func( + input1=node1.outputs.output1, sample_rate=sample_rate + ) node2.compute = synapse_compute_name - node3 = spark_function(input1=node2.outputs.output1, sample_rate=sample_rate) + node3 = spark_function( + input1=node2.outputs.output1, sample_rate=sample_rate + ) return { "pipeline_output1": node1.outputs.output1, "pipeline_output2": node2.outputs.output1, @@ -1382,7 +1483,7 @@ def pipeline(iris_data, sample_rate): ] pipeline1 = pipeline(iris_data, sample_rate) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = omit_with_wildcard(pipeline_job1, *omit_fields) assert pipeline_job1 == { "properties": { @@ -1629,7 +1730,7 @@ def pipeline(iris_data, sample_rate): pipeline1 = pipeline(iris_data, sample_rate) pipeline_rest_obj = pipeline1._to_rest_object() - pipeline_job1 = pipeline_rest_obj.as_dict() + pipeline_job1 = as_attribute_dict(pipeline_rest_obj) pipeline_regenerated_from_rest = PipelineJob._load_from_rest(pipeline_rest_obj) omit_field = [ @@ -1638,7 +1739,9 @@ def pipeline(iris_data, sample_rate): pipeline1_dict = pipeline1._to_dict() # Change float to string to make dict from local and rest compatible - pipeline1_dict["inputs"]["sample_rate"] = str(pipeline1_dict["inputs"]["sample_rate"]) + pipeline1_dict["inputs"]["sample_rate"] = str( + pipeline1_dict["inputs"]["sample_rate"] + ) assert pydash.omit(pipeline1_dict, *omit_field) == pydash.omit( pipeline_regenerated_from_rest._to_dict(), *omit_field ) @@ -1739,14 +1842,16 @@ def test_pipeline_with_data_transfer_copy_job(self): @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_copy_job") def pipeline(folder1, folder2): - data_transfer_node = data_transfer_job_func(folder1=folder1, folder2=folder2) + data_transfer_node = data_transfer_job_func( + folder1=folder1, folder2=folder2 + ) return { "pipeline_output": data_transfer_node.outputs.output, } pipeline1 = pipeline(folder1, folder2) pipeline_rest_obj = pipeline1._to_rest_object() - pipeline_job1 = pipeline_rest_obj.as_dict() + pipeline_job1 = as_attribute_dict(pipeline_rest_obj) pipeline_regenerated_from_rest = PipelineJob._load_from_rest(pipeline_rest_obj) @@ -1814,7 +1919,9 @@ def test_pipeline_with_parallel_job(self): mode="eval_mount", ), } - outputs = {"job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount")} + outputs = { + "job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount") + } expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} @@ -1866,7 +1973,7 @@ def pipeline(job_data_path): pipeline1 = pipeline(data) pipeline_rest_obj = pipeline1._to_rest_object() - pipeline_job1 = pipeline_rest_obj.as_dict() + pipeline_job1 = as_attribute_dict(pipeline_rest_obj) pipeline_regenerated_from_rest = PipelineJob._load_from_rest(pipeline_rest_obj) omit_field = [ "jobs.parallel_node.task", @@ -1920,7 +2027,8 @@ def pipeline(job_data_path): ), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " + "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -1945,7 +2053,9 @@ def test_pipeline_with_parallel_function_inside(self): ), } input_data = "${{inputs.job_data_path}}" - outputs = {"job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount")} + outputs = { + "job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount") + } task = RunFunction( code="./tests/test_configs/dsl_pipeline/parallel_component_with_file_input/src/", entry_script="score.py", @@ -1978,7 +2088,11 @@ def pipeline(path): environment_variables=expected_environment_variables, ) node1 = parallel_function(job_data_path=path) - node2 = parallel_function(job_data_path=Input(type=AssetTypes.MLTABLE, path="new_path", mode="eval_mount")) + node2 = parallel_function( + job_data_path=Input( + type=AssetTypes.MLTABLE, path="new_path", mode="eval_mount" + ) + ) return { "pipeline_output1": node1.outputs.job_output_path, @@ -1995,7 +2109,7 @@ def pipeline(path): data = Input(type=AssetTypes.MLTABLE, path="/a/path/on/ds", mode="eval_mount") pipeline1 = pipeline(data) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = pydash.omit(pipeline_job1, omit_fields) assert pipeline_job1 == { "properties": { @@ -2042,7 +2156,8 @@ def pipeline(path): ), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " + "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2079,7 +2194,8 @@ def pipeline(path): ), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " + "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2106,7 +2222,9 @@ def test_pipeline_with_command_function_inside(self): expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} inputs = { - "component_in_path": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), + "component_in_path": Input( + type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount" + ), "component_in_number": 0.01, } outputs = {"component_out_path": Output(type="mlflow_model", mode="rw_mount")} @@ -2125,7 +2243,9 @@ def pipeline(number, path): outputs=outputs, ) node1 = command_function(component_in_number=number, component_in_path=path) - node2 = command_function(component_in_number=1, component_in_path=Input(path="new_path")) + node2 = command_function( + component_in_number=1, component_in_path=Input(path="new_path") + ) return { "pipeline_output1": node1.outputs.component_out_path, @@ -2142,7 +2262,7 @@ def pipeline(number, path): data = Input(type=AssetTypes.URI_FOLDER, path="/a/path/on/ds") pipeline1 = pipeline(10, data) - pipeline_job1 = pipeline1._to_rest_object().as_dict() + pipeline_job1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_job1 = pydash.omit(pipeline_job1, omit_fields) assert pipeline_job1 == { "properties": { @@ -2229,7 +2349,10 @@ def pipeline(number, path): } def test_multi_parallel_components_with_file_input_pipeline_output(self) -> None: - components_dir = tests_root_dir / "test_configs/dsl_pipeline/parallel_component_with_file_input" + components_dir = ( + tests_root_dir + / "test_configs/dsl_pipeline/parallel_component_with_file_input" + ) batch_inference1 = load_component(source=str(components_dir / "score.yml")) batch_inference2 = load_component(source=str(components_dir / "score.yml")) convert_data = load_component(source=str(components_dir / "convert_data.yml")) @@ -2238,10 +2361,16 @@ def test_multi_parallel_components_with_file_input_pipeline_output(self) -> None @dsl.pipeline(default_compute="cpu-cluster", experiment_name="sdk-cli-v2") def parallel_in_pipeline(job_data_path): batch_inference_node1 = batch_inference1(job_data_path=job_data_path) - convert_data_node = convert_data(input_data=batch_inference_node1.outputs.job_output_path) + convert_data_node = convert_data( + input_data=batch_inference_node1.outputs.job_output_path + ) convert_data_node.outputs.file_output_data.type = AssetTypes.MLTABLE - batch_inference_node2 = batch_inference2(job_data_path=convert_data_node.outputs.file_output_data) - batch_inference_node2.inputs.job_data_path.mode = InputOutputModes.EVAL_MOUNT + batch_inference_node2 = batch_inference2( + job_data_path=convert_data_node.outputs.file_output_data + ) + batch_inference_node2.inputs.job_data_path.mode = ( + InputOutputModes.EVAL_MOUNT + ) return {"job_out_data": batch_inference_node2.outputs.job_output_path} @@ -2261,7 +2390,9 @@ def parallel_in_pipeline(job_data_path): "jobs.batch_inference_node2.componentId", "jobs.batch_inference_node2.properties", ] - actual_job = pydash.omit(pipeline._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = pydash.omit( + as_attribute_dict(pipeline._to_rest_object().properties), *omit_fields + ) assert actual_job == { "display_name": "parallel_in_pipeline", "experiment_name": "sdk-cli-v2", @@ -2293,7 +2424,8 @@ def parallel_in_pipeline(job_data_path): "code": parse_local_path("./src", batch_inference1.base_path), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " + "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2323,7 +2455,8 @@ def parallel_in_pipeline(job_data_path): "code": parse_local_path("./src", batch_inference2.base_path), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " + "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2341,7 +2474,9 @@ def parallel_in_pipeline(job_data_path): "type": "command", }, }, - "outputs": {"job_out_data": {"job_output_type": "uri_folder", "mode": "Upload"}}, + "outputs": { + "job_out_data": {"job_output_type": "uri_folder", "mode": "Upload"} + }, "properties": {}, "settings": {"_source": "DSL", "default_compute": "cpu-cluster"}, "tags": {}, @@ -2349,7 +2484,9 @@ def parallel_in_pipeline(job_data_path): def test_automl_node_in_pipeline(self) -> None: # create ClassificationJob with classification func inside pipeline is also supported - @dsl.pipeline(name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster") + @dsl.pipeline( + name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster" + ) def train_with_automl_in_pipeline( main_data_input, target_column_name_input: str, @@ -2377,9 +2514,11 @@ def train_with_automl_in_pipeline( type=AssetTypes.MLTABLE, path="fake_path", ) - pipeline1: PipelineJob = train_with_automl_in_pipeline(job_input, "target", 10, 0.2) + pipeline1: PipelineJob = train_with_automl_in_pipeline( + job_input, "target", 10, 0.2 + ) - pipeline_dict1 = pipeline1._to_rest_object().as_dict() + pipeline_dict1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_dict1 = pydash.omit( pipeline_dict1["properties"], [ @@ -2431,7 +2570,9 @@ def train_with_automl_in_pipeline( assert pipeline_dict1 == expected_dict # create ClassificationJob inside pipeline is NOT supported - @dsl.pipeline(name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster") + @dsl.pipeline( + name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster" + ) def train_with_automl_in_pipeline( main_data_input, target_column_name_input: str, @@ -2457,7 +2598,9 @@ def test_automl_node_with_command_node(self): component_func1 = load_component(source=path) @dsl.pipeline(name="train_with_automl_in_pipeline", force_rerun=False) - def train_with_automl_in_pipeline(component_in_number, component_in_path, target_column_name_input: str): + def train_with_automl_in_pipeline( + component_in_number, component_in_path, target_column_name_input: str + ): node1 = component_func1( component_in_number=component_in_number, component_in_path=component_in_path, @@ -2479,7 +2622,7 @@ def train_with_automl_in_pipeline(component_in_number, component_in_path, target ) pipeline1: PipelineJob = train_with_automl_in_pipeline(10, job_input, "target") pipeline1.compute = "cpu-cluster" - pipeline_dict1 = pipeline1._to_rest_object().as_dict() + pipeline_dict1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_dict1 = pydash.omit( pipeline_dict1["properties"], "jobs.node1.componentId", @@ -2547,7 +2690,9 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): enable_model_explainability=True, outputs=dict(best_model=Output(type="mlflow_model")), ) - return {"pipeline_job_out_best_model": classification_node.outputs.best_model} + return { + "pipeline_job_out_best_model": classification_node.outputs.best_model + } job_input = Input( type=AssetTypes.MLTABLE, @@ -2556,7 +2701,7 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): pipeline1: PipelineJob = train_with_automl_in_pipeline(job_input, "target") pipeline1.compute = "cpu-cluster" - pipeline_dict1 = pipeline1._to_rest_object().as_dict() + pipeline_dict1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_dict1 = pydash.omit( pipeline_dict1["properties"], [ @@ -2596,7 +2741,9 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): } }, # pipeline level will copy node level type - "outputs": {"pipeline_job_out_best_model": {"job_output_type": "mlflow_model"}}, + "outputs": { + "pipeline_job_out_best_model": {"job_output_type": "mlflow_model"} + }, "properties": {}, "settings": {"_source": "DSL"}, "tags": {}, @@ -2605,7 +2752,7 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): # in order to get right type, user need to specify it on pipeline level pipeline1.outputs.pipeline_job_out_best_model.mode = "rw_mount" - pipeline_dict2 = pipeline1._to_rest_object().as_dict() + pipeline_dict2 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_dict2 = pydash.omit( pipeline_dict2["properties"], [ @@ -2626,7 +2773,9 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): assert pipeline_dict2 == expected_dict def test_automl_node_without_variable_name(self) -> None: - @dsl.pipeline(name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster") + @dsl.pipeline( + name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster" + ) def train_with_automl_in_pipeline(training_data, target_column_name_input: str): classification( training_data=training_data, @@ -2662,7 +2811,7 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): path="fake_path", ) pipeline1: PipelineJob = train_with_automl_in_pipeline(job_input, "target") - pipeline_dict1 = pipeline1._to_rest_object().as_dict() + pipeline_dict1 = as_attribute_dict(pipeline1._to_rest_object()) assert set(pipeline_dict1["properties"]["jobs"].keys()) == { "regressionjob", "regressionjob_1", diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py index 442cb9c78f97..803bdb4a760c 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py @@ -1,16 +1,29 @@ from pathlib import Path +import json + import pytest from test_utilities.utils import omit_with_wildcard +from azure.core.serialization import as_attribute_dict from azure.ai.ml import Input, load_component from azure.ai.ml.dsl import pipeline from azure.ai.ml.entities._job.pipeline._io import PipelineInput -from azure.ai.ml.entities._job.pipeline._io.base import _resolve_builders_2_data_bindings +from azure.ai.ml.entities._job.pipeline._io.base import ( + _resolve_builders_2_data_bindings, +) from azure.ai.ml.exceptions import UserErrorException from .._util import _DSL_TIMEOUT_SECOND, expand_pipeline_nodes + +def _rest_props_snake(rest_props): + # ``as_attribute_dict`` yields the snake_case attribute view of the arm_ml_service hybrid model; the + # ``json`` round-trip with ``default=str`` stringifies any residual data-binding objects left in + # free-form nested dicts (as the legacy msrest ``as_dict`` did) so downstream deepcopy/compare work. + return json.loads(json.dumps(as_attribute_dict(rest_props), default=str)) + + tests_root_dir = Path(__file__).parent.parent.parent components_dir = tests_root_dir / "test_configs/components/" common_omit_fields = [ @@ -54,7 +67,11 @@ def test_nested_input_output_builder(self): "data1": "${{parent.inputs.input1}}", "data2": {"1": "${{parent.inputs.input2}}"}, "data3": ["${{parent.inputs.input3}}"], - "data4": [{"1": "${{parent.inputs.input1}}"}, "${{parent.inputs.input2}}", ["${{parent.inputs.input3}}"]], + "data4": [ + {"1": "${{parent.inputs.input1}}"}, + "${{parent.inputs.input2}}", + ["${{parent.inputs.input3}}"], + ], "data5": { "1": ["${{parent.inputs.input1}}"], "2": {"1": "${{parent.inputs.input2}}"}, @@ -72,61 +89,113 @@ def my_pipeline(job_in_number, job_in_path): assert isinstance(job_in_path, PipelineInput) assert isinstance(job_in_number.result(), int) assert isinstance(job_in_path.result(), Input) - node1 = component_func(component_in_number=job_in_number, component_in_path=job_in_path) + node1 = component_func( + component_in_number=job_in_number, component_in_path=job_in_path + ) # calling result() will convert pipeline input to actual value - node2 = component_func(component_in_number=job_in_number.result(), component_in_path=job_in_path.result()) - return {"output1": node1.outputs.component_out_path, "output2": node2.outputs.component_out_path} - - pipeline_job1 = my_pipeline(job_in_number=1, job_in_path=Input(path="fake_path1")) + node2 = component_func( + component_in_number=job_in_number.result(), + component_in_path=job_in_path.result(), + ) + return { + "output1": node1.outputs.component_out_path, + "output2": node2.outputs.component_out_path, + } + + pipeline_job1 = my_pipeline( + job_in_number=1, job_in_path=Input(path="fake_path1") + ) rest_pipeline_job = omit_with_wildcard( - pipeline_job1._to_rest_object().properties.as_dict(), *common_omit_fields + _rest_props_snake(pipeline_job1._to_rest_object().properties), + *common_omit_fields ) expected_pipeline_job1 = { "node1": { "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_number}}"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_number": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_number}}", + }, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "node1", - "outputs": {"component_out_path": {"type": "literal", "value": "${{parent.outputs.output1}}"}}, + "outputs": { + "component_out_path": { + "type": "literal", + "value": "${{parent.outputs.output1}}", + } + }, "type": "command", }, "node2": { "inputs": { "component_in_number": {"job_input_type": "literal", "value": "1"}, - "component_in_path": {"job_input_type": "uri_folder", "uri": "fake_path1"}, + "component_in_path": { + "job_input_type": "uri_folder", + "uri": "fake_path1", + }, }, "name": "node2", - "outputs": {"component_out_path": {"type": "literal", "value": "${{parent.outputs.output2}}"}}, + "outputs": { + "component_out_path": { + "type": "literal", + "value": "${{parent.outputs.output2}}", + } + }, "type": "command", }, } assert rest_pipeline_job["jobs"] == expected_pipeline_job1 - pipeline_job2 = my_pipeline(job_in_number=2, job_in_path=Input(path="fake_path2")) + pipeline_job2 = my_pipeline( + job_in_number=2, job_in_path=Input(path="fake_path2") + ) rest_pipeline_job = omit_with_wildcard( - pipeline_job2._to_rest_object().properties.as_dict(), *common_omit_fields + _rest_props_snake(pipeline_job2._to_rest_object().properties), + *common_omit_fields ) expected_pipeline_job2 = { "node1": { "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_number}}"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_number": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_number}}", + }, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "node1", - "outputs": {"component_out_path": {"type": "literal", "value": "${{parent.outputs.output1}}"}}, + "outputs": { + "component_out_path": { + "type": "literal", + "value": "${{parent.outputs.output1}}", + } + }, "type": "command", }, "node2": { "inputs": { "component_in_number": {"job_input_type": "literal", "value": "2"}, - "component_in_path": {"job_input_type": "uri_folder", "uri": "fake_path2"}, + "component_in_path": { + "job_input_type": "uri_folder", + "uri": "fake_path2", + }, }, "name": "node2", - "outputs": {"component_out_path": {"type": "literal", "value": "${{parent.outputs.output2}}"}}, + "outputs": { + "component_out_path": { + "type": "literal", + "value": "${{parent.outputs.output2}}", + } + }, "type": "command", }, } @@ -137,7 +206,8 @@ def my_pipeline(job_in_number, job_in_path): pipeline_job1.jobs["node2"].inputs["component_in_path"].path == "fake_path1" rest_pipeline_job = omit_with_wildcard( - pipeline_job1._to_rest_object().properties.as_dict(), *common_omit_fields + _rest_props_snake(pipeline_job1._to_rest_object().properties), + *common_omit_fields ) assert rest_pipeline_job["jobs"] == expected_pipeline_job1 @@ -152,7 +222,9 @@ def my_pipeline_level_1(job_in_number, job_in_path): # Note: call result will get actual value assert isinstance(job_in_number.result(), int) assert isinstance(job_in_path.result(), Input) - component_func(component_in_number=job_in_number, component_in_path=job_in_path) + component_func( + component_in_number=job_in_number, component_in_path=job_in_path + ) @pipeline def my_pipeline_level_2(job_in_number, job_in_path): @@ -161,27 +233,44 @@ def my_pipeline_level_2(job_in_number, job_in_path): assert isinstance(job_in_number.result(), int) assert isinstance(job_in_path.result(), Input) my_pipeline_level_1(job_in_number=job_in_number, job_in_path=job_in_path) - component_func(component_in_number=job_in_number, component_in_path=job_in_path) + component_func( + component_in_number=job_in_number, component_in_path=job_in_path + ) - pipeline_job2 = my_pipeline_level_2(job_in_number=2, job_in_path=Input(path="fake_path2")) + pipeline_job2 = my_pipeline_level_2( + job_in_number=2, job_in_path=Input(path="fake_path2") + ) rest_pipeline_job = omit_with_wildcard( - pipeline_job2._to_rest_object().properties.as_dict(), *common_omit_fields + _rest_props_snake(pipeline_job2._to_rest_object().properties), + *common_omit_fields ) expected_pipeline_job = { "microsoftsamples_command_component_basic": { "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_number}}"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_number": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_number}}", + }, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "microsoftsamples_command_component_basic", "type": "command", }, "my_pipeline_level_1": { "inputs": { - "job_in_number": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_number}}"}, - "job_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "job_in_number": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_number}}", + }, + "job_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "my_pipeline_level_1", "type": "pipeline", @@ -195,7 +284,9 @@ def test_pipeline_expression_bool_test(self) -> None: if input1: pass else: - assert False, "bool test for PipelineInput in non-pipeline scenario should always return True." + assert ( + False + ), "bool test for PipelineInput in non-pipeline scenario should always return True." # pipeline scenario, should raise UserErrorException @pipeline @@ -217,9 +308,14 @@ def test_input_get_data_owner(self): # case1: node input from another node's output @pipeline def another_nodes_output(): - node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) + node1 = component_func1( + component_in_number=1, component_in_path=Input(path="test_path") + ) node1.name = "node1" - node2 = component_func1(component_in_number=2, component_in_path=node1.outputs.component_out_path) + node2 = component_func1( + component_in_number=2, + component_in_path=node1.outputs.component_out_path, + ) node2.name = "node2" assert node2.inputs.component_in_path._get_data_owner().name == "node1" @@ -232,12 +328,16 @@ def another_nodes_output(): # case2.1: node input from pipeline input, which has literal value @pipeline def literal_pipeline_val(component_in_path: Input): - node2 = component_func1(component_in_number=2, component_in_path=component_in_path) + node2 = component_func1( + component_in_number=2, component_in_path=component_in_path + ) node2.name = "node2" assert node2.inputs.component_in_path._get_data_owner() == None assert_node_owners_expected( - pipeline_job=literal_pipeline_val(component_in_path=Input(path="test_path")), + pipeline_job=literal_pipeline_val( + component_in_path=Input(path="test_path") + ), expected_owners={"node2": None}, input_name="component_in_path", ) @@ -245,13 +345,17 @@ def literal_pipeline_val(component_in_path: Input): # case2.2: node input from pipeline input, which is from another node's output @pipeline def sub_pipeline(component_in_path: Input): - node2 = component_func1(component_in_number=2, component_in_path=component_in_path) + node2 = component_func1( + component_in_number=2, component_in_path=component_in_path + ) node2.name = "node2" assert node2.inputs.component_in_path._get_data_owner().name == "node1" @pipeline def parent_pipeline(): - node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) + node1 = component_func1( + component_in_number=1, component_in_path=Input(path="test_path") + ) node1.name = "node1" sub_pipeline(component_in_path=node1.outputs.component_out_path) @@ -264,17 +368,23 @@ def parent_pipeline(): # case2.3: node input from pipeline input, which is from subgraph's output @pipeline def sub_pipeline1(component_in_path: Input): - node1 = component_func1(component_in_number=2, component_in_path=component_in_path) + node1 = component_func1( + component_in_number=2, component_in_path=component_in_path + ) return node1.outputs @pipeline def sub_pipeline2(component_in_path: Input): - node2 = component_func1(component_in_number=2, component_in_path=component_in_path) + node2 = component_func1( + component_in_number=2, component_in_path=component_in_path + ) assert node2.inputs.component_in_path._get_data_owner().name == "node1" @pipeline def parent_pipeline(): - src = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) + src = component_func1( + component_in_number=1, component_in_path=Input(path="test_path") + ) sub1 = sub_pipeline1(component_in_path=src) sub_pipeline2(component_in_path=sub1.outputs.component_out_path) @@ -287,13 +397,18 @@ def parent_pipeline(): # case3.1: node input from subgraph's output, which is from a normal node @pipeline def sub_pipeline(component_in_path: Input): - sub_node = component_func1(component_in_number=2, component_in_path=component_in_path) + sub_node = component_func1( + component_in_number=2, component_in_path=component_in_path + ) return sub_node.outputs @pipeline def parent_pipeline(): node1 = sub_pipeline(component_in_path=Input(path="test_path")) - node3 = component_func1(component_in_number=3, component_in_path=node1.outputs.component_out_path) + node3 = component_func1( + component_in_number=3, + component_in_path=node1.outputs.component_out_path, + ) assert node3.inputs.component_in_path._get_data_owner().name == "sub_node" return node3 @@ -306,7 +421,9 @@ def parent_pipeline(): # case3.2: node input from subgraph's output, which is from another subgraph @pipeline def sub_pipeline_1(component_in_path: Input): - sub_node_1 = component_func1(component_in_number=2, component_in_path=component_in_path) + sub_node_1 = component_func1( + component_in_number=2, component_in_path=component_in_path + ) return sub_node_1.outputs @pipeline @@ -317,7 +434,10 @@ def sub_pipeline_2(component_in_path: Input): @pipeline def parent_pipeline(): node1 = sub_pipeline_2(component_in_path=Input(path="test_path")) - node3 = component_func1(component_in_number=3, component_in_path=node1.outputs.component_out_path) + node3 = component_func1( + component_in_number=3, + component_in_path=node1.outputs.component_out_path, + ) assert node3.inputs.component_in_path._get_data_owner().name == "sub_node_1" return node3 @@ -333,19 +453,25 @@ def test_input_get_data_owner_multiple_subgraph(self): @pipeline def sub_pipeline(component_in_path: Input): - inner_node = component_func1(component_in_number=2, component_in_path=component_in_path) + inner_node = component_func1( + component_in_number=2, component_in_path=component_in_path + ) return inner_node.outputs @pipeline def parent_pipeline(): - node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path1")) + node1 = component_func1( + component_in_number=1, component_in_path=Input(path="test_path1") + ) node1.name = "node1" sub1 = sub_pipeline(component_in_path=node1.outputs.component_out_path) after1 = component_func1(component_in_path=sub1.outputs.component_out_path) source_of_branch_1 = after1.inputs.component_in_path._get_data_owner() assert source_of_branch_1.name == "inner_node" - node2 = component_func1(component_in_number=3, component_in_path=Input(path="test_path2")) + node2 = component_func1( + component_in_number=3, component_in_path=Input(path="test_path2") + ) node2.name = "node2" sub2 = sub_pipeline(component_in_path=node2.outputs.component_out_path) after2 = component_func1(component_in_path=sub2.outputs.component_out_path) @@ -355,8 +481,14 @@ def parent_pipeline(): # subgraph called twice, source for each branch should not be the same assert source_of_branch_1._instance_id != source_of_branch_2._instance_id # one is from node1, the other is from node2 - assert source_of_branch_1.inputs.component_in_path._get_data_owner().name == "node1" - assert source_of_branch_2.inputs.component_in_path._get_data_owner().name == "node2" + assert ( + source_of_branch_1.inputs.component_in_path._get_data_owner().name + == "node1" + ) + assert ( + source_of_branch_2.inputs.component_in_path._get_data_owner().name + == "node2" + ) parent_pipeline() @@ -430,7 +562,9 @@ def sub_pipeline(component_in_path: Input): @pipeline def my_pipeline(): - node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) + node1 = component_func1( + component_in_number=1, component_in_path=Input(path="test_path") + ) node1.name = "node1" # node input literal value, don't have owner assert node1.inputs.component_in_number._get_data_owner() is None @@ -451,6 +585,10 @@ def my_pipeline(): assert_node_owners_expected( pipeline_job=my_pipeline, - expected_owners={"node1": None, "inner_node": "node1", "node3": "inner_node"}, + expected_owners={ + "node1": None, + "inner_node": "node1", + "node3": "inner_node", + }, input_name="component_in_path", ) diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index 76c855940ac3..c007aa9f9cab 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -14,6 +14,7 @@ from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase as RestJob from azure.ai.ml._schema.automl import AutoMLRegressionSchema from azure.ai.ml._utils.utils import dump_yaml_to_file, load_yaml +from azure.core.serialization import as_attribute_dict from azure.ai.ml.automl import classification from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.dsl import pipeline @@ -27,9 +28,19 @@ ImageInstanceSegmentationJob, ImageObjectDetectionJob, ) -from azure.ai.ml.entities._job.automl.nlp import TextClassificationJob, TextClassificationMultilabelJob, TextNerJob -from azure.ai.ml.entities._job.automl.tabular import ClassificationJob, ForecastingJob, RegressionJob -from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration +from azure.ai.ml.entities._job.automl.nlp import ( + TextClassificationJob, + TextClassificationMultilabelJob, + TextNerJob, +) +from azure.ai.ml.entities._job.automl.tabular import ( + ClassificationJob, + ForecastingJob, + RegressionJob, +) +from azure.ai.ml.entities._job.job_resource_configuration import ( + JobResourceConfiguration, +) from azure.ai.ml.entities._job.pipeline._io import PipelineInput, _GroupAttrDict from azure.ai.ml.exceptions import ValidationException @@ -48,13 +59,19 @@ def load_pipeline_entity_from_rest_json(job_dict) -> PipelineJob: @pytest.mark.unittest @pytest.mark.pipeline_test class TestPipelineJobEntity: - def test_automl_node_in_pipeline_regression(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_automl_node_in_pipeline_regression( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_regression.yml" # overwrite some fields to data bindings to make sure it's supported params_override = [ - {"jobs.hello_automl_regression.primary_metric": "${{parent.inputs.primary_metric}}"}, - {"jobs.hello_automl_regression.limits.max_trials": "${{parent.inputs.max_trials}}"}, + { + "jobs.hello_automl_regression.primary_metric": "${{parent.inputs.primary_metric}}" + }, + { + "jobs.hello_automl_regression.limits.max_trials": "${{parent.inputs.max_trials}}" + }, ] def simple_job_validation(job): @@ -62,23 +79,32 @@ def simple_job_validation(job): node = next(iter(job.jobs.values())) assert isinstance(node, RegressionJob) - job = verify_entity_load_and_dump(load_job, simple_job_validation, test_path, params_override=params_override)[ - 0 - ] + job = verify_entity_load_and_dump( + load_job, simple_job_validation, test_path, params_override=params_override + )[0] mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["hello_automl_regression"], omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["hello_automl_regression"], omit_fields + ) expected_dict = { "featurization": {"mode": "off"}, - "limits": {"max_concurrent_trials": 1, "max_trials": "${{parent.inputs.max_trials}}"}, + "limits": { + "max_concurrent_trials": 1, + "max_trials": "${{parent.inputs.max_trials}}", + }, "log_verbosity": "info", "outputs": {}, "primary_metric": "${{parent.inputs.primary_metric}}", @@ -96,23 +122,34 @@ def simple_job_validation(job): # same regression node won't load as AutoMLRegressionSchema since there's data binding with pytest.raises(ValidationError) as e: AutoMLRegressionSchema(context={"base_path": "./"}).load(expected_dict) - assert "Value '${{parent.inputs.primary_metric}}' passed is not in set" in str(e.value) + assert "Value '${{parent.inputs.primary_metric}}' passed is not in set" in str( + e.value + ) - def test_automl_node_in_pipeline_classification(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_automl_node_in_pipeline_classification( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_classification.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) node = next(iter(job.jobs.values())) assert isinstance(node, ClassificationJob) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["hello_automl_classification"], omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["hello_automl_classification"], + omit_fields, + ) assert actual_dict == { "featurization": {"mode": "auto"}, @@ -130,21 +167,29 @@ def test_automl_node_in_pipeline_classification(self, mock_machinelearning_clien "validation_data": "${{parent.inputs.classification_validate_data}}", } - def test_automl_node_in_pipeline_forecasting(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_automl_node_in_pipeline_forecasting( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_forecasting.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) node = next(iter(job.jobs.values())) assert isinstance(node, ForecastingJob) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["hello_automl_forecasting"], omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["hello_automl_forecasting"], omit_fields + ) assert actual_dict == { "limits": {"max_concurrent_trials": 1, "max_trials": 1}, @@ -158,7 +203,11 @@ def test_automl_node_in_pipeline_forecasting(self, mock_machinelearning_client: "training": {"enable_stack_ensemble": False, "enable_vote_ensemble": False}, "training_data": "${{parent.inputs.forecasting_train_data}}", "type": "automl", - "forecasting": {"forecast_horizon": 12, "time_column_name": "DATE", "frequency": "MS"}, + "forecasting": { + "forecast_horizon": 12, + "time_column_name": "DATE", + "frequency": "MS", + }, "n_cross_validations": 2, } @@ -185,7 +234,9 @@ def test_automl_job_in_pipeline_deserialize(self, rest_job_file, node_name): pipeline = load_pipeline_entity_from_rest_json(job_dict) assert isinstance(pipeline, PipelineJob) expected_automl_job = job_dict["properties"]["jobs"][node_name] - actual_automl_job = pipeline._to_rest_object().as_dict()["properties"]["jobs"][node_name] + actual_automl_job = pipeline._to_rest_object().as_dict()["properties"]["jobs"][ + node_name + ] assert actual_automl_job == expected_automl_job @pytest.mark.parametrize( @@ -194,7 +245,9 @@ def test_automl_job_in_pipeline_deserialize(self, rest_job_file, node_name): "./tests/test_configs/pipeline_jobs/invalid_pipeline_job_without_jobs.json", ], ) - def test_invalid_pipeline_jobs_descerialize(self, invalid_pipeline_job_without_jobs): + def test_invalid_pipeline_jobs_descerialize( + self, invalid_pipeline_job_without_jobs + ): with open(invalid_pipeline_job_without_jobs, "r") as f: job_dict = yaml.safe_load(f) pipeline = load_pipeline_entity_from_rest_json(job_dict) @@ -209,7 +262,9 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): rest_obj = RestJob.from_dict(json.loads(json.dumps(job_dict))) pipeline = PipelineJob._from_rest_object(rest_obj) pipeline_dict = pipeline._to_dict() - assert pydash.omit(pipeline_dict["jobs"], *["properties", "hello_python_world_job.properties"]) == { + assert pydash.omit( + pipeline_dict["jobs"], *["properties", "hello_python_world_job.properties"] + ) == { "hello_python_world_job": { "inputs": { "sample_input_data": { @@ -222,21 +277,33 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): "path": "${{parent.inputs.pipeline_sample_input_string}}", }, }, - "outputs": {"sample_output_data": "${{parent.outputs.pipeline_sample_output_data}}"}, + "outputs": { + "sample_output_data": "${{parent.outputs.pipeline_sample_output_data}}" + }, "component": "azureml:/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli/components/azureml_anonymous/versions/9904ff48-9cb2-4733-ad1c-eb1eb9940a19", "type": "command", "compute": "azureml:cpu-cluster", } } - assert pipeline_dict["inputs"] == {"pipeline_sample_input_string": "Hello_Pipeline_World"} - assert pipeline_dict["outputs"] == {"pipeline_sample_output_data": {"mode": "upload", "type": "uri_folder"}} + assert pipeline_dict["inputs"] == { + "pipeline_sample_input_string": "Hello_Pipeline_World" + } + assert pipeline_dict["outputs"] == { + "pipeline_sample_output_data": {"mode": "upload", "type": "uri_folder"} + } pipeline_rest_dict = pipeline._to_rest_object().as_dict() pipeline_rest_dict["properties"]["inputs"] == { - "pipeline_sample_input_string": {"job_input_type": "literal", "value": "Hello_Pipeline_World"} + "pipeline_sample_input_string": { + "job_input_type": "literal", + "value": "Hello_Pipeline_World", + } } pipeline_rest_dict["properties"]["outputs"] == { - "pipeline_sample_output_data": {"mode": "Upload", "job_output_type": "uri_folder"} + "pipeline_sample_output_data": { + "mode": "Upload", + "job_output_type": "uri_folder", + } } pipeline_rest_dict["properties"]["jobs"] == { "hello_python_world_job": { @@ -268,10 +335,14 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): def test_automl_node_in_pipeline_with_binding(self): # classification node automl_classif_job = classification( - training_data=PipelineInput(name="main_data_input", owner="pipeline", meta=None), + training_data=PipelineInput( + name="main_data_input", owner="pipeline", meta=None + ), # validation_data_size=PipelineInput(name="validation_data_size", owner="pipeline", meta=None), # test_data = test_data_input # Optional, since testing is explicit below with TEST COMPONENT - target_column_name=PipelineInput(name="target_column_name_input", owner="pipeline", meta=None), + target_column_name=PipelineInput( + name="target_column_name_input", owner="pipeline", meta=None + ), # primary_metric=PipelineInput(name="primary_metric", owner="pipeline", meta=None), enable_model_explainability=True, ) @@ -293,21 +364,38 @@ def test_automl_node_in_pipeline_with_binding(self): "type": "automl", } - def test_pipeline_job_automl_regression_output(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_pipeline_job_automl_regression_output( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/automl_regression_with_command_node.yml" pipeline: PipelineJob = load_job(source=test_path) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", + ) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( + pipeline ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline) pipeline_dict = pipeline._to_rest_object().as_dict() - fields_to_omit = ["name", "display_name", "training_data", "validation_data", "experiment_name", "properties"] + fields_to_omit = [ + "name", + "display_name", + "training_data", + "validation_data", + "experiment_name", + "properties", + ] - automl_actual_dict = pydash.omit(pipeline_dict["properties"]["jobs"]["regression_node"], fields_to_omit) + automl_actual_dict = pydash.omit( + pipeline_dict["properties"]["jobs"]["regression_node"], fields_to_omit + ) assert automl_actual_dict == { "featurization": {"mode": "off"}, @@ -323,7 +411,9 @@ def test_pipeline_job_automl_regression_output(self, mock_machinelearning_client "type": "automl", } - command_actual_dict = pydash.omit(pipeline_dict["properties"]["jobs"]["command_node"], fields_to_omit) + command_actual_dict = pydash.omit( + pipeline_dict["properties"]["jobs"]["command_node"], fields_to_omit + ) assert command_actual_dict == { "_source": "YAML.JOB", @@ -347,14 +437,21 @@ def test_automl_node_in_pipeline_text_classification( node = next(iter(job.jobs.values())) assert isinstance(node, TextClassificationJob) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["automl_text_classification"], omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["automl_text_classification"], + omit_fields, + ) assert actual_dict == { "featurization": {"dataset_language": "eng"}, @@ -373,23 +470,28 @@ def test_automl_node_in_pipeline_text_classification( def test_automl_node_in_pipeline_text_classification_multilabel( self, mock_machinelearning_client: MLClient, mocker: MockFixture ): - test_path = ( - "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_text_classification_multilabel.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_text_classification_multilabel.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) node = next(iter(job.jobs.values())) assert isinstance(node, TextClassificationMultilabelJob) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["automl_text_classification_multilabel"], omit_fields + rest_job_dict["properties"]["jobs"][ + "automl_text_classification_multilabel" + ], + omit_fields, ) assert actual_dict == { @@ -405,21 +507,29 @@ def test_automl_node_in_pipeline_text_classification_multilabel( "type": "automl", } - def test_automl_node_in_pipeline_text_ner(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_automl_node_in_pipeline_text_ner( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_text_ner.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) node = next(iter(job.jobs.values())) assert isinstance(node, TextNerJob) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["automl_text_ner"], omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["automl_text_ner"], omit_fields + ) assert actual_dict == { "limits": {"max_trials": 1, "timeout_minutes": 60, "max_nodes": 1}, @@ -446,8 +556,12 @@ def test_automl_node_in_pipeline_image_multiclass_classification( test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_multiclass_classification"]["search_space"] - del test_config["jobs"]["hello_automl_image_multiclass_classification"]["sweep"] + del test_config["jobs"]["hello_automl_image_multiclass_classification"][ + "search_space" + ] + del test_config["jobs"]["hello_automl_image_multiclass_classification"][ + "sweep" + ] test_yaml_file = tmp_path / "job.yml" dump_yaml_to_file(test_yaml_file, test_config) @@ -459,17 +573,27 @@ def test_automl_node_in_pipeline_image_multiclass_classification( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", + ) mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["hello_automl_image_multiclass_classification"], omit_fields + rest_job_dict["properties"]["jobs"][ + "hello_automl_image_multiclass_classification" + ], + omit_fields, ) expected_dict = { - "limits": {"timeout_minutes": 60, "max_concurrent_trials": 4, "max_trials": 20}, + "limits": { + "timeout_minutes": 60, + "max_concurrent_trials": 4, + "max_trials": 20, + }, "log_verbosity": "info", "outputs": {}, "primary_metric": "accuracy", @@ -523,8 +647,12 @@ def test_automl_node_in_pipeline_image_multilabel_classification( test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_multilabel_classification"]["search_space"] - del test_config["jobs"]["hello_automl_image_multilabel_classification"]["sweep"] + del test_config["jobs"]["hello_automl_image_multilabel_classification"][ + "search_space" + ] + del test_config["jobs"]["hello_automl_image_multilabel_classification"][ + "sweep" + ] test_yaml_file = tmp_path / "job.yml" dump_yaml_to_file(test_yaml_file, test_config) @@ -536,17 +664,27 @@ def test_automl_node_in_pipeline_image_multilabel_classification( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", + ) mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["hello_automl_image_multilabel_classification"], omit_fields + rest_job_dict["properties"]["jobs"][ + "hello_automl_image_multilabel_classification" + ], + omit_fields, ) expected_dict = { - "limits": {"timeout_minutes": 60, "max_concurrent_trials": 4, "max_trials": 20}, + "limits": { + "timeout_minutes": 60, + "max_concurrent_trials": 4, + "max_trials": 20, + }, "log_verbosity": "info", "outputs": {}, "primary_metric": "iou", @@ -589,14 +727,20 @@ def test_automl_node_in_pipeline_image_multilabel_classification( @pytest.mark.parametrize("run_type", ["single", "sweep", "automode"]) def test_automl_node_in_pipeline_image_object_detection( - self, mock_machinelearning_client: MLClient, mocker: MockFixture, run_type: str, tmp_path: Path + self, + mock_machinelearning_client: MLClient, + mocker: MockFixture, + run_type: str, + tmp_path: Path, ): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_image_object_detection.yml" test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_object_detection"]["search_space"] + del test_config["jobs"]["hello_automl_image_object_detection"][ + "search_space" + ] del test_config["jobs"]["hello_automl_image_object_detection"]["sweep"] test_yaml_file = tmp_path / "job.yml" @@ -609,17 +753,25 @@ def test_automl_node_in_pipeline_image_object_detection( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", + ) mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["hello_automl_image_object_detection"], omit_fields + rest_job_dict["properties"]["jobs"]["hello_automl_image_object_detection"], + omit_fields, ) expected_dict = { - "limits": {"timeout_minutes": 60, "max_concurrent_trials": 4, "max_trials": 20}, + "limits": { + "timeout_minutes": 60, + "max_concurrent_trials": 4, + "max_trials": 20, + }, "log_verbosity": "info", "outputs": {}, "primary_metric": "mean_average_precision", @@ -669,14 +821,14 @@ def test_automl_node_in_pipeline_image_instance_segmentation( run_type: str, tmp_path: Path, ): - test_path = ( - "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_image_instance_segmentation.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_image_instance_segmentation.yml" test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_instance_segmentation"]["search_space"] + del test_config["jobs"]["hello_automl_image_instance_segmentation"][ + "search_space" + ] del test_config["jobs"]["hello_automl_image_instance_segmentation"]["sweep"] test_yaml_file = tmp_path / "job.yml" @@ -689,17 +841,27 @@ def test_automl_node_in_pipeline_image_instance_segmentation( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", + ) mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["hello_automl_image_instance_segmentation"], omit_fields + rest_job_dict["properties"]["jobs"][ + "hello_automl_image_instance_segmentation" + ], + omit_fields, ) expected_dict = { - "limits": {"timeout_minutes": 60, "max_concurrent_trials": 4, "max_trials": 20}, + "limits": { + "timeout_minutes": 60, + "max_concurrent_trials": 4, + "max_trials": 20, + }, "log_verbosity": "info", "outputs": {}, "primary_metric": "mean_average_precision", @@ -741,8 +903,12 @@ def test_automl_node_in_pipeline_image_instance_segmentation( del expected_dict["sweep"] assert actual_dict == expected_dict - def test_spark_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): - test_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" + def test_spark_node_in_pipeline( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): + test_path = ( + "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" + ) job = load_job(test_path) assert isinstance(job, PipelineJob) @@ -750,14 +916,22 @@ def test_spark_node_in_pipeline(self, mock_machinelearning_client: MLClient, moc assert isinstance(node, Spark) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() - omit_fields = ["properties"] # "name", "display_name", "experiment_name", "properties" - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["add_greeting_column"], omit_fields) + omit_fields = [ + "properties" + ] # "name", "display_name", "experiment_name", "properties" + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["add_greeting_column"], omit_fields + ) expected_dict = { "_source": "YAML.COMPONENT", @@ -771,18 +945,31 @@ def test_spark_node_in_pipeline(self, mock_machinelearning_client: MLClient, moc "spark.executor.instances": 1, "spark.executor.memory": "1g", }, - "entry": {"file": "add_greeting_column.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "entry": { + "file": "add_greeting_column.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "files": ["my_files.txt"], "identity": {"identity_type": "Managed"}, - "inputs": {"file_input": {"job_input_type": "literal", "value": "${{parent.inputs.iris_data}}"}}, + "inputs": { + "file_input": { + "job_input_type": "literal", + "value": "${{parent.inputs.iris_data}}", + } + }, "name": "add_greeting_column", "py_files": ["utils.zip"], - "resources": {"instance_type": "standard_e4s_v3", "runtime_version": "3.4.0"}, + "resources": { + "instance_type": "standard_e4s_v3", + "runtime_version": "3.4.0", + }, "type": "spark", } assert actual_dict == expected_dict - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["count_by_row"], omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["count_by_row"], omit_fields + ) expected_dict = { "_source": "YAML.COMPONENT", @@ -796,19 +983,34 @@ def test_spark_node_in_pipeline(self, mock_machinelearning_client: MLClient, moc "spark.executor.instances": 1, "spark.executor.memory": "1g", }, - "entry": {"file": "count_by_row.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "entry": { + "file": "count_by_row.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "files": ["my_files.txt"], "identity": {"identity_type": "Managed"}, - "inputs": {"file_input": {"job_input_type": "literal", "value": "${{parent.inputs.iris_data}}"}}, + "inputs": { + "file_input": { + "job_input_type": "literal", + "value": "${{parent.inputs.iris_data}}", + } + }, "jars": ["scalaproj.jar"], "name": "count_by_row", - "outputs": {"output": {"type": "literal", "value": "${{parent.outputs.output}}"}}, - "resources": {"instance_type": "standard_e4s_v3", "runtime_version": "3.4.0"}, + "outputs": { + "output": {"type": "literal", "value": "${{parent.outputs.output}}"} + }, + "resources": { + "instance_type": "standard_e4s_v3", + "runtime_version": "3.4.0", + }, "type": "spark", } assert actual_dict == expected_dict - def test_data_transfer_copy_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_data_transfer_copy_node_in_pipeline( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/data_transfer/copy_files.yaml" job = load_job(test_path) @@ -820,29 +1022,47 @@ def test_data_transfer_copy_node_in_pipeline(self, mock_machinelearning_client: assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["copy_files"], *omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["copy_files"], *omit_fields + ) expected_dict = { "_source": "YAML.COMPONENT", "componentId": "", "computeId": "", "data_copy_mode": "merge_with_overwrite", - "inputs": {"folder1": {"job_input_type": "literal", "value": "${{parent.inputs.cosmos_folder}}"}}, + "inputs": { + "folder1": { + "job_input_type": "literal", + "value": "${{parent.inputs.cosmos_folder}}", + } + }, "name": "copy_files", - "outputs": {"output_folder": {"type": "literal", "value": "${{parent.outputs.merged_blob}}"}}, + "outputs": { + "output_folder": { + "type": "literal", + "value": "${{parent.outputs.merged_blob}}", + } + }, "task": "copy_data", "type": "data_transfer", } assert actual_dict == expected_dict - def test_data_transfer_merge_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_data_transfer_merge_node_in_pipeline( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/data_transfer/merge_files.yaml" job = load_job(test_path) @@ -854,14 +1074,20 @@ def test_data_transfer_merge_node_in_pipeline(self, mock_machinelearning_client: assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["merge_files"], *omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["merge_files"], *omit_fields + ) expected_dict = { "_source": "YAML.COMPONENT", @@ -869,11 +1095,22 @@ def test_data_transfer_merge_node_in_pipeline(self, mock_machinelearning_client: "computeId": "", "data_copy_mode": "merge_with_overwrite", "inputs": { - "folder1": {"job_input_type": "literal", "value": "${{parent.inputs.cosmos_folder}}"}, - "folder2": {"job_input_type": "literal", "value": "${{parent.inputs.cosmos_folder_dup}}"}, + "folder1": { + "job_input_type": "literal", + "value": "${{parent.inputs.cosmos_folder}}", + }, + "folder2": { + "job_input_type": "literal", + "value": "${{parent.inputs.cosmos_folder_dup}}", + }, }, "name": "merge_files", - "outputs": {"output_folder": {"type": "literal", "value": "${{parent.outputs.merged_blob}}"}}, + "outputs": { + "output_folder": { + "type": "literal", + "value": "${{parent.outputs.merged_blob}}", + } + }, "task": "copy_data", "type": "data_transfer", } @@ -882,7 +1119,9 @@ def test_data_transfer_merge_node_in_pipeline(self, mock_machinelearning_client: def test_inline_data_transfer_merge_node_in_pipeline( self, mock_machinelearning_client: MLClient, mocker: MockFixture ): - test_path = "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" + test_path = ( + "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" + ) job = load_job(test_path) assert isinstance(job, PipelineJob) @@ -893,14 +1132,20 @@ def test_inline_data_transfer_merge_node_in_pipeline( assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["properties"] - actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["merge_files_job"], *omit_fields) + actual_dict = pydash.omit( + rest_job_dict["properties"]["jobs"]["merge_files_job"], *omit_fields + ) expected_dict = { "data_copy_mode": "merge_with_overwrite", @@ -908,11 +1153,22 @@ def test_inline_data_transfer_merge_node_in_pipeline( "componentId": "", "computeId": "", "inputs": { - "folder1": {"job_input_type": "literal", "value": "${{parent.inputs.cosmos_folder}}"}, - "folder2": {"job_input_type": "literal", "value": "${{parent.inputs.cosmos_folder_dup}}"}, + "folder1": { + "job_input_type": "literal", + "value": "${{parent.inputs.cosmos_folder}}", + }, + "folder2": { + "job_input_type": "literal", + "value": "${{parent.inputs.cosmos_folder_dup}}", + }, }, "name": "merge_files_job", - "outputs": {"output_folder": {"type": "literal", "value": "${{parent.outputs.merged_blob}}"}}, + "outputs": { + "output_folder": { + "type": "literal", + "value": "${{parent.outputs.merged_blob}}", + } + }, "type": "data_transfer", "task": "copy_data", } @@ -932,16 +1188,22 @@ def test_inline_data_transfer_import_database_node_in_pipeline( assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) omit_fields = [ "properties.jobs.snowflake_blob.componentId", "properties.jobs.snowflake_blob_node_input.componentId", ] - rest_job_dict = pydash.omit(job._to_rest_object().as_dict(), *omit_fields) + rest_job_dict = pydash.omit( + as_attribute_dict(job._to_rest_object()), *omit_fields + ) assert rest_job_dict == { "properties": { @@ -995,7 +1257,11 @@ def test_inline_data_transfer_import_database_node_in_pipeline( }, "outputs": {}, "properties": {}, - "settings": {"_source": "YAML.JOB", "default_compute": "", "default_datastore": ""}, + "settings": { + "_source": "YAML.JOB", + "default_compute": "", + "default_datastore": "", + }, "tags": {}, } } @@ -1014,15 +1280,21 @@ def test_inline_data_transfer_import_stored_database_node_in_pipeline( assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) omit_fields = [ "properties.jobs.snowflake_blob.componentId", ] - rest_job_dict = pydash.omit(job._to_rest_object().as_dict(), *omit_fields) + rest_job_dict = pydash.omit( + as_attribute_dict(job._to_rest_object()), *omit_fields + ) assert rest_job_dict == { "properties": { @@ -1042,7 +1314,11 @@ def test_inline_data_transfer_import_stored_database_node_in_pipeline( "stored_procedure": "SelectEmployeeByJobAndDepartment", "stored_procedure_params": [ {"name": "job", "type": "String", "value": "Engineer"}, - {"name": "department", "type": "String", "value": "Engineering"}, + { + "name": "department", + "type": "String", + "value": "Engineering", + }, ], "type": "database", }, @@ -1052,7 +1328,11 @@ def test_inline_data_transfer_import_stored_database_node_in_pipeline( }, "outputs": {}, "properties": {}, - "settings": {"_source": "YAML.JOB", "default_compute": "", "default_datastore": ""}, + "settings": { + "_source": "YAML.JOB", + "default_compute": "", + "default_datastore": "", + }, "tags": {}, } } @@ -1071,23 +1351,32 @@ def test_inline_data_transfer_import_file_system_node_in_pipeline( assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) omit_fields = [ "properties.jobs.s3_blob.componentId", "properties.jobs.s3_blob_input.componentId", ] - rest_job_dict = pydash.omit(job._to_rest_object().as_dict(), *omit_fields) + rest_job_dict = pydash.omit( + as_attribute_dict(job._to_rest_object()), *omit_fields + ) assert rest_job_dict == { "properties": { "compute_id": "", "description": "pipeline with data transfer components", "inputs": { - "connection_target": {"job_input_type": "literal", "value": "azureml:my-s3-connection"}, + "connection_target": { + "job_input_type": "literal", + "value": "azureml:my-s3-connection", + }, "path_source_s3": {"job_input_type": "literal", "value": "test1/*"}, }, "is_archived": False, @@ -1121,14 +1410,22 @@ def test_inline_data_transfer_import_file_system_node_in_pipeline( "uri": "azureml://datastores/workspaceblobstore/paths/importjob/${{name}}/output_dir/s3//", } }, - "source": {"connection": "azureml:my-s3-connection", "path": "test1/*", "type": "file_system"}, + "source": { + "connection": "azureml:my-s3-connection", + "path": "test1/*", + "type": "file_system", + }, "task": "import_data", "type": "data_transfer", }, }, "outputs": {}, "properties": {}, - "settings": {"_source": "YAML.JOB", "default_compute": "", "default_datastore": ""}, + "settings": { + "_source": "YAML.JOB", + "default_compute": "", + "default_datastore": "", + }, "tags": {}, } } @@ -1147,16 +1444,22 @@ def test_inline_data_transfer_export_database_node_in_pipeline( assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) omit_fields = [ "properties.jobs.blob_azuresql.componentId", "properties.jobs.blob_azuresql_node_input.componentId", ] - rest_job_dict = pydash.omit(job._to_rest_object().as_dict(), *omit_fields) + rest_job_dict = pydash.omit( + as_attribute_dict(job._to_rest_object()), *omit_fields + ) assert rest_job_dict == { "properties": { @@ -1177,7 +1480,10 @@ def test_inline_data_transfer_export_database_node_in_pipeline( "_source": "BUILTIN", "computeId": "", "inputs": { - "source": {"job_input_type": "literal", "value": "${{parent.inputs.cosmos_folder}}"} + "source": { + "job_input_type": "literal", + "value": "${{parent.inputs.cosmos_folder}}", + } }, "name": "blob_azuresql", "sink": { @@ -1191,7 +1497,9 @@ def test_inline_data_transfer_export_database_node_in_pipeline( "blob_azuresql_node_input": { "_source": "BUILTIN", "computeId": "", - "inputs": {"source": {"job_input_type": "uri_file", "uri": "yyy"}}, + "inputs": { + "source": {"job_input_type": "uri_file", "uri": "yyy"} + }, "name": "blob_azuresql_node_input", "sink": { "connection": "azureml:my_export_azuresqldb_connection", @@ -1204,12 +1512,18 @@ def test_inline_data_transfer_export_database_node_in_pipeline( }, "outputs": {}, "properties": {}, - "settings": {"_source": "YAML.JOB", "default_compute": "", "default_datastore": ""}, + "settings": { + "_source": "YAML.JOB", + "default_compute": "", + "default_datastore": "", + }, "tags": {}, } } - def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_data_transfer_multi_node_in_pipeline( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/pipeline_jobs/data_transfer/pipeline_with_mutil_task.yaml" job = load_job(test_path) @@ -1221,12 +1535,16 @@ def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: assert result.passed is True mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) - rest_job_dict = job._to_rest_object().as_dict() + rest_job_dict = as_attribute_dict(job._to_rest_object()) omit_fields = [ "properties.jobs.*.componentId", ] @@ -1240,7 +1558,9 @@ def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: "path_source_s3": {"job_input_type": "literal", "value": "test1/*"}, "query_source_sql": { "job_input_type": "literal", - "value": "select top(10) Name " "from " "SalesLT.ProductCategory", + "value": "select top(10) Name " + "from " + "SalesLT.ProductCategory", }, }, "is_archived": False, @@ -1249,7 +1569,9 @@ def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: "blob_azuresql": { "_source": "BUILTIN", "computeId": "", - "inputs": {"source": {"job_input_type": "uri_file", "uri": "yyy"}}, + "inputs": { + "source": {"job_input_type": "uri_file", "uri": "yyy"} + }, "name": "blob_azuresql", "sink": { "connection": "azureml:my_export_azuresqldb_connection", @@ -1264,14 +1586,22 @@ def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: "computeId": "", "data_copy_mode": "merge_with_overwrite", "inputs": { - "folder1": {"job_input_type": "literal", "value": "${{parent.jobs.s3_blob.outputs.sink}}"}, + "folder1": { + "job_input_type": "literal", + "value": "${{parent.jobs.s3_blob.outputs.sink}}", + }, "folder2": { "job_input_type": "literal", "value": "${{parent.jobs.snowflake_blob.outputs.sink}}", }, }, "name": "merge_files", - "outputs": {"output_folder": {"type": "literal", "value": "${{parent.outputs.merged_blob}}"}}, + "outputs": { + "output_folder": { + "type": "literal", + "value": "${{parent.outputs.merged_blob}}", + } + }, "task": "copy_data", "type": "data_transfer", }, @@ -1304,7 +1634,11 @@ def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: }, "outputs": {"merged_blob": {"job_output_type": "uri_folder"}}, "properties": {}, - "settings": {"_source": "YAML.JOB", "default_compute": "", "default_datastore": ""}, + "settings": { + "_source": "YAML.JOB", + "default_compute": "", + "default_datastore": "", + }, "tags": {}, } } @@ -1318,11 +1652,17 @@ def test_default_user_identity_if_empty_identity_input(self): "jobs.sample_word.properties", "jobs.count_word.properties", ] - actual_job = pydash.omit(job._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = pydash.omit( + as_attribute_dict(job._to_rest_object().properties), *omit_fields + ) assert actual_job == { "description": "submit a shakespear sample and word spark job in pipeline", "inputs": { - "input1": {"job_input_type": "uri_file", "mode": "Direct", "uri": "./dataset/shakespeare.txt"}, + "input1": { + "job_input_type": "uri_file", + "mode": "Direct", + "uri": "./dataset/shakespeare.txt", + }, "sample_rate": {"job_input_type": "literal", "value": "0.01"}, }, "is_archived": False, @@ -1338,13 +1678,22 @@ def test_default_user_identity_if_empty_identity_input(self): "spark.executor.instances": 4, "spark.executor.memory": "2g", }, - "entry": {"file": "wordcount.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "entry": { + "file": "wordcount.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "identity": {"identity_type": "UserIdentity"}, "inputs": { - "input1": {"job_input_type": "literal", "value": "${{parent.jobs.sample_word.outputs.output1}}"} + "input1": { + "job_input_type": "literal", + "value": "${{parent.jobs.sample_word.outputs.output1}}", + } }, "name": "count_word", - "resources": {"instance_type": "standard_e4s_v3", "runtime_version": "3.4.0"}, + "resources": { + "instance_type": "standard_e4s_v3", + "runtime_version": "3.4.0", + }, "type": "spark", }, "sample_word": { @@ -1362,15 +1711,32 @@ def test_default_user_identity_if_empty_identity_input(self): "spark.executor.instances": 1, "spark.executor.memory": "2g", }, - "entry": {"file": "sampleword.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "entry": { + "file": "sampleword.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "identity": {"identity_type": "UserIdentity"}, "inputs": { - "input1": {"job_input_type": "literal", "value": "${{parent.inputs.input1}}"}, - "sample_rate": {"job_input_type": "literal", "value": "${{parent.inputs.sample_rate}}"}, + "input1": { + "job_input_type": "literal", + "value": "${{parent.inputs.input1}}", + }, + "sample_rate": { + "job_input_type": "literal", + "value": "${{parent.inputs.sample_rate}}", + }, }, "name": "sample_word", - "outputs": {"output1": {"type": "literal", "value": "${{parent.outputs.output1}}"}}, - "resources": {"instance_type": "standard_e4s_v3", "runtime_version": "3.4.0"}, + "outputs": { + "output1": { + "type": "literal", + "value": "${{parent.outputs.output1}}", + } + }, + "resources": { + "instance_type": "standard_e4s_v3", + "runtime_version": "3.4.0", + }, "type": "spark", }, }, @@ -1387,7 +1753,8 @@ def test_spark_node_in_pipeline_with_dynamic_allocation_disabled( job: PipelineJob = load_job(test_path) result = job._validate() assert ( - result.error_messages["jobs.hello_world.conf"] == "Should not specify min or max executors when " + result.error_messages["jobs.hello_world.conf"] + == "Should not specify min or max executors when " "dynamic allocation is disabled." ) @@ -1417,9 +1784,13 @@ def test_spark_node_with_remote_component_in_pipeline( assert isinstance(node, Spark) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) result = job._validate() assert result.passed is True @@ -1431,10 +1802,20 @@ def test_spark_node_with_remote_component_in_pipeline( "componentId": "", "computeId": "", "identity": {"identity_type": "Managed"}, - "inputs": {"file_input": {"job_input_type": "literal", "value": "${{parent.inputs.iris_data}}"}}, + "inputs": { + "file_input": { + "job_input_type": "literal", + "value": "${{parent.inputs.iris_data}}", + } + }, "name": "kmeans_cluster", - "outputs": {"output": {"type": "literal", "value": "${{parent.outputs.output}}"}}, - "resources": {"instance_type": "standard_e4s_v3", "runtime_version": "3.4.0"}, + "outputs": { + "output": {"type": "literal", "value": "${{parent.outputs.output}}"} + }, + "resources": { + "instance_type": "standard_e4s_v3", + "runtime_version": "3.4.0", + }, "type": "spark", } assert actual_dict == expected_dict @@ -1476,7 +1857,9 @@ def test_spark_node_with_remote_component_in_pipeline( ), ], ) - def test_spark_node_in_pipeline_with_invalid_input_outputs_mode(self, test_path: str, error_messages: dict): + def test_spark_node_in_pipeline_with_invalid_input_outputs_mode( + self, test_path: str, error_messages: dict + ): job = load_job(test_path) result = job._validate() for key, value in error_messages.items(): @@ -1490,7 +1873,9 @@ def test_infer_pipeline_output_type_as_node_type( source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_with_parallel_job_tabular_input_e2e.yml", ) assert ( - pipeline_job.jobs["hello_world_inline_parallel_tabular_job_1"].outputs["job_output_file"].type + pipeline_job.jobs["hello_world_inline_parallel_tabular_job_1"] + .outputs["job_output_file"] + .type == AssetTypes.URI_FILE ) @@ -1505,7 +1890,10 @@ def test_infer_pipeline_output_type_as_node_type( "_source": "YAML.JOB", "command": 'echo "hello" && echo "world" && echo "train" > world.txt', "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "inputs": {"model_input": {"type": "uri_folder"}, "test_data": {"type": "uri_folder"}}, + "inputs": { + "model_input": {"type": "uri_folder"}, + "test_data": {"type": "uri_folder"}, + }, "is_deterministic": True, "outputs": {"score_output": {"type": "uri_folder"}}, "type": "command", @@ -1521,7 +1909,10 @@ def test_infer_pipeline_output_type_as_node_type( "_source": "YAML.JOB", "command": 'echo "hello" && echo "world" && echo "train" > world.txt', "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "inputs": {"model_input": {"type": "mltable"}, "test_data": {"type": "uri_folder"}}, + "inputs": { + "model_input": {"type": "mltable"}, + "test_data": {"type": "uri_folder"}, + }, "is_deterministic": True, "outputs": {"score_output": {"type": "uri_folder"}}, "type": "command", @@ -1537,7 +1928,10 @@ def test_infer_pipeline_output_type_as_node_type( "_source": "YAML.JOB", "command": 'echo "hello" && echo "world" && echo "train" > world.txt', "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "inputs": {"model_input": {"type": "uri_folder"}, "test_data": {"type": "uri_folder"}}, + "inputs": { + "model_input": {"type": "uri_folder"}, + "test_data": {"type": "uri_folder"}, + }, "is_deterministic": True, "outputs": {"score_output": {"type": "uri_folder"}}, "type": "command", @@ -1559,7 +1953,9 @@ def test_pipeline_job_with_inline_command_job_input_binding_to_registered_compon ) actual_type = pipeline_job.jobs["score_job"].inputs.model_input.type assert actual_type == expected_type - actual_type = pipeline_job.jobs["score_job"].component.inputs["model_input"].type + actual_type = ( + pipeline_job.jobs["score_job"].component.inputs["model_input"].type + ) assert actual_type == expected_type # check component of pipeline job is expected @@ -1569,20 +1965,28 @@ def test_pipeline_job_with_inline_command_job_input_binding_to_registered_compon "name", ] - actual_dict = pydash.omit(actual_dict["properties"]["component_spec"], omit_fields) + actual_dict = pydash.omit( + actual_dict["properties"]["component_spec"], omit_fields + ) assert actual_dict == expected_dict - def test_pipeline_without_setting_binding_node(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_pipeline_without_setting_binding_node( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/dsl_pipeline/pipeline_with_set_binding_output_input/pipeline_without_setting_binding_node.yml" job = load_job(source=test_path) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) - actual_dict = job._to_rest_object().as_dict()["properties"] + actual_dict = as_attribute_dict(job._to_rest_object())["properties"] assert actual_dict == { "properties": {}, @@ -1594,7 +1998,10 @@ def test_pipeline_without_setting_binding_node(self, mock_machinelearning_client "training_input": {"uri": "yyy/", "job_input_type": "uri_folder"}, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_job": { @@ -1603,7 +2010,10 @@ def test_pipeline_without_setting_binding_node(self, mock_machinelearning_client "name": "train_job", "computeId": "xxx", "inputs": { - "training_data": {"job_input_type": "literal", "value": "${{parent.inputs.training_input}}"}, + "training_data": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_input}}", + }, "learning_rate": { "job_input_type": "literal", "value": "${{parent.inputs.training_learning_rate}}", @@ -1612,9 +2022,17 @@ def test_pipeline_without_setting_binding_node(self, mock_machinelearning_client "job_input_type": "literal", "value": "${{parent.inputs.learning_rate_schedule}}", }, - "max_epochs": {"job_input_type": "literal", "value": "${{parent.inputs.training_max_epochs}}"}, + "max_epochs": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_max_epochs}}", + }, + }, + "outputs": { + "model_output": { + "value": "${{parent.outputs.trained_model}}", + "type": "literal", + } }, - "outputs": {"model_output": {"value": "${{parent.outputs.trained_model}}", "type": "literal"}}, "componentId": "xxx", } }, @@ -1629,12 +2047,16 @@ def test_pipeline_with_only_setting_pipeline_level( job = load_job(source=test_path) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) - actual_dict = job._to_rest_object().as_dict()["properties"] + actual_dict = as_attribute_dict(job._to_rest_object())["properties"] assert actual_dict == { "properties": {}, @@ -1643,10 +2065,17 @@ def test_pipeline_with_only_setting_pipeline_level( "compute_id": "xxx", "job_type": "Pipeline", "inputs": { - "training_input": {"uri": "yyy/", "job_input_type": "uri_folder", "mode": "ReadOnlyMount"}, + "training_input": { + "uri": "yyy/", + "job_input_type": "uri_folder", + "mode": "ReadOnlyMount", + }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_job": { @@ -1655,7 +2084,10 @@ def test_pipeline_with_only_setting_pipeline_level( "name": "train_job", "computeId": "xxx", "inputs": { - "training_data": {"job_input_type": "literal", "value": "${{parent.inputs.training_input}}"}, + "training_data": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_input}}", + }, "learning_rate": { "job_input_type": "literal", "value": "${{parent.inputs.training_learning_rate}}", @@ -1664,31 +2096,49 @@ def test_pipeline_with_only_setting_pipeline_level( "job_input_type": "literal", "value": "${{parent.inputs.learning_rate_schedule}}", }, - "max_epochs": {"job_input_type": "literal", "value": "${{parent.inputs.training_max_epochs}}"}, + "max_epochs": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_max_epochs}}", + }, + }, + "outputs": { + "model_output": { + "value": "${{parent.outputs.trained_model}}", + "type": "literal", + } }, - "outputs": {"model_output": {"value": "${{parent.outputs.trained_model}}", "type": "literal"}}, "componentId": "xxx", } }, - "outputs": {"trained_model": {"job_output_type": "uri_folder", "mode": "Upload"}}, + "outputs": { + "trained_model": {"job_output_type": "uri_folder", "mode": "Upload"} + }, "settings": { "_source": "YAML.JOB", }, } - def test_pipeline_with_only_setting_binding_node(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + def test_pipeline_with_only_setting_binding_node( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): test_path = "./tests/test_configs/dsl_pipeline/pipeline_with_set_binding_output_input/pipeline_with_only_setting_binding_node.yml" job = load_job(source=test_path) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) - actual_dict = job._to_rest_object().as_dict()["properties"] + actual_dict = as_attribute_dict(job._to_rest_object())["properties"] - assert pydash.omit(actual_dict, *["properties", "jobs.train_job.properties"]) == { + assert pydash.omit( + actual_dict, *["properties", "jobs.train_job.properties"] + ) == { "tags": {}, "is_archived": False, "compute_id": "xxx", @@ -1700,7 +2150,10 @@ def test_pipeline_with_only_setting_binding_node(self, mock_machinelearning_clie }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_job": { @@ -1722,7 +2175,10 @@ def test_pipeline_with_only_setting_binding_node(self, mock_machinelearning_clie "job_input_type": "literal", "value": "${{parent.inputs.learning_rate_schedule}}", }, - "max_epochs": {"job_input_type": "literal", "value": "${{parent.inputs.training_max_epochs}}"}, + "max_epochs": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_max_epochs}}", + }, }, "outputs": { # add mode in rest if binding output set mode @@ -1746,23 +2202,36 @@ def test_pipeline_with_setting_binding_node_and_pipeline_level( job = load_job(source=test_path) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) - actual_dict = job._to_rest_object().as_dict()["properties"] + actual_dict = as_attribute_dict(job._to_rest_object())["properties"] - assert pydash.omit(actual_dict, *["properties", "jobs.train_job.properties"]) == { + assert pydash.omit( + actual_dict, *["properties", "jobs.train_job.properties"] + ) == { "tags": {}, "is_archived": False, "compute_id": "xxx", "job_type": "Pipeline", "inputs": { - "training_input": {"uri": "yyy/", "job_input_type": "uri_folder", "mode": "Download"}, + "training_input": { + "uri": "yyy/", + "job_input_type": "uri_folder", + "mode": "Download", + }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_job": { @@ -1784,7 +2253,10 @@ def test_pipeline_with_setting_binding_node_and_pipeline_level( "job_input_type": "literal", "value": "${{parent.inputs.learning_rate_schedule}}", }, - "max_epochs": {"job_input_type": "literal", "value": "${{parent.inputs.training_max_epochs}}"}, + "max_epochs": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_max_epochs}}", + }, }, "outputs": { # add mode in rest if binding output set mode @@ -1797,7 +2269,12 @@ def test_pipeline_with_setting_binding_node_and_pipeline_level( "componentId": "xxx", } }, - "outputs": {"trained_model": {"job_output_type": "uri_folder", "mode": "ReadWriteMount"}}, + "outputs": { + "trained_model": { + "job_output_type": "uri_folder", + "mode": "ReadWriteMount", + } + }, "settings": {"_source": "YAML.JOB"}, } @@ -1808,23 +2285,36 @@ def test_pipeline_with_inline_job_setting_binding_node_and_pipeline_level( job = load_job(source=test_path) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) - actual_dict = job._to_rest_object().as_dict()["properties"] + actual_dict = as_attribute_dict(job._to_rest_object())["properties"] - assert pydash.omit(actual_dict, *["properties", "jobs.train_job.properties"]) == { + assert pydash.omit( + actual_dict, *["properties", "jobs.train_job.properties"] + ) == { "tags": {}, "is_archived": False, "compute_id": "xxx", "job_type": "Pipeline", "inputs": { - "training_input": {"uri": "yyy/", "job_input_type": "uri_folder", "mode": "Download"}, + "training_input": { + "uri": "yyy/", + "job_input_type": "uri_folder", + "mode": "Download", + }, "training_max_epochs": {"job_input_type": "literal", "value": "20"}, "training_learning_rate": {"job_input_type": "literal", "value": "1.8"}, - "learning_rate_schedule": {"job_input_type": "literal", "value": "time-based"}, + "learning_rate_schedule": { + "job_input_type": "literal", + "value": "time-based", + }, }, "jobs": { "train_job": { @@ -1846,7 +2336,10 @@ def test_pipeline_with_inline_job_setting_binding_node_and_pipeline_level( "job_input_type": "literal", "value": "${{parent.inputs.learning_rate_schedule}}", }, - "max_epochs": {"job_input_type": "literal", "value": "${{parent.inputs.training_max_epochs}}"}, + "max_epochs": { + "job_input_type": "literal", + "value": "${{parent.inputs.training_max_epochs}}", + }, }, "outputs": { # add mode in rest if binding output set mode @@ -1859,12 +2352,19 @@ def test_pipeline_with_inline_job_setting_binding_node_and_pipeline_level( "componentId": "xxx", } }, - "outputs": {"trained_model": {"job_output_type": "uri_folder", "mode": "ReadWriteMount"}}, + "outputs": { + "trained_model": { + "job_output_type": "uri_folder", + "mode": "ReadWriteMount", + } + }, "settings": {"_source": "YAML.JOB"}, } def test_pipeline_job_with_parameter_group(self): - test_path = "./tests/test_configs/pipeline_jobs/pipeline_job_with_parameter_group.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/pipeline_job_with_parameter_group.yml" + ) job: PipelineJob = load_job(test_path) assert isinstance(job.inputs.group, _GroupAttrDict) job.inputs.group.int_param = 5 @@ -1878,27 +2378,44 @@ def test_pipeline_job_with_parameter_group(self): "group.sub_group.bool_param": 1, } assert job_dict["jobs"]["hello_world_component_1"]["inputs"] == { - "component_in_string": {"path": "${{parent.inputs.group.sub_group.str_param}}"}, - "component_in_ranged_integer": {"path": "${{parent.inputs.group.int_param}}"}, + "component_in_string": { + "path": "${{parent.inputs.group.sub_group.str_param}}" + }, + "component_in_ranged_integer": { + "path": "${{parent.inputs.group.int_param}}" + }, "component_in_enum": {"path": "${{parent.inputs.group.enum_param}}"}, - "component_in_boolean": {"path": "${{parent.inputs.group.sub_group.bool_param}}"}, - "component_in_ranged_number": {"path": "${{parent.inputs.group.number_param}}"}, + "component_in_boolean": { + "path": "${{parent.inputs.group.sub_group.bool_param}}" + }, + "component_in_ranged_number": { + "path": "${{parent.inputs.group.number_param}}" + }, } - rest_job = job._to_rest_object().as_dict()["properties"] + rest_job = as_attribute_dict(job._to_rest_object())["properties"] assert rest_job["inputs"] == { "group.int_param": {"job_input_type": "literal", "value": "5"}, "group.enum_param": {"job_input_type": "literal", "value": "hello"}, "group.number_param": {"job_input_type": "literal", "value": "4.0"}, "group.sub_group.str_param": {"job_input_type": "literal", "value": "str"}, - "group.sub_group.bool_param": {"job_input_type": "literal", "value": "True"}, + "group.sub_group.bool_param": { + "job_input_type": "literal", + "value": "True", + }, } assert rest_job["jobs"]["hello_world_component_1"]["inputs"] == { "component_in_string": { "job_input_type": "literal", "value": "${{parent.inputs.group.sub_group.str_param}}", }, - "component_in_ranged_integer": {"job_input_type": "literal", "value": "${{parent.inputs.group.int_param}}"}, - "component_in_enum": {"job_input_type": "literal", "value": "${{parent.inputs.group.enum_param}}"}, + "component_in_ranged_integer": { + "job_input_type": "literal", + "value": "${{parent.inputs.group.int_param}}", + }, + "component_in_enum": { + "job_input_type": "literal", + "value": "${{parent.inputs.group.enum_param}}", + }, "component_in_boolean": { "job_input_type": "literal", "value": "${{parent.inputs.group.sub_group.bool_param}}", @@ -1910,7 +2427,9 @@ def test_pipeline_job_with_parameter_group(self): } def test_non_string_pipeline_node_input(self): - test_path = "./tests/test_configs/pipeline_jobs/rest_non_string_input_pipeline.json" + test_path = ( + "./tests/test_configs/pipeline_jobs/rest_non_string_input_pipeline.json" + ) with open(test_path, "r") as f: job_dict = yaml.safe_load(f) pipeline = load_pipeline_entity_from_rest_json(job_dict) @@ -1921,10 +2440,15 @@ def test_non_string_pipeline_node_input(self): "max_depth": "3", "min_child_samples": "20", "num_leaves": "31", - "rai_insights_dashboard": {"path": "${{parent.jobs.create_rai_job.outputs.rai_insights_dashboard}}"}, + "rai_insights_dashboard": { + "path": "${{parent.jobs.create_rai_job.outputs.rai_insights_dashboard}}" + }, } rest_pipeline_dict = pipeline._to_rest_object().as_dict() - rest_node_dict = pydash.omit_by(rest_pipeline_dict["properties"]["jobs"]["error_analysis_job"], lambda x: not x) + rest_node_dict = pydash.omit_by( + rest_pipeline_dict["properties"]["jobs"]["error_analysis_job"], + lambda x: not x, + ) # Assert integer value became str assert rest_node_dict == { "_source": "REMOTE.REGISTRY", @@ -1947,7 +2471,9 @@ def test_job_properties(self): ) pipeline_dict = pipeline_job._to_dict() rest_pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] - assert pipeline_dict["properties"] == {"AZURE_ML_PathOnCompute_input_data": "/tmp/test"} + assert pipeline_dict["properties"] == { + "AZURE_ML_PathOnCompute_input_data": "/tmp/test" + } assert rest_pipeline_dict["properties"] == pipeline_dict["properties"] for name, node_dict in pipeline_dict["jobs"].items(): rest_node_dict = rest_pipeline_dict["jobs"][name] @@ -1956,11 +2482,19 @@ def test_job_properties(self): assert node_dict["properties"] == rest_node_dict["properties"] def test_comment_in_pipeline(self) -> None: - pipeline_job = load_job(source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_comment.yml") + pipeline_job = load_job( + source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_comment.yml" + ) pipeline_dict = pipeline_job._to_dict() rest_pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] - assert pipeline_dict["jobs"]["hello_world_component"]["comment"] == "arbitrary string" - assert rest_pipeline_dict["jobs"]["hello_world_component"]["comment"] == "arbitrary string" + assert ( + pipeline_dict["jobs"]["hello_world_component"]["comment"] + == "arbitrary string" + ) + assert ( + rest_pipeline_dict["jobs"]["hello_world_component"]["comment"] + == "arbitrary string" + ) def test_pipeline_node_default_output(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_component_output.yml" @@ -1973,22 +2507,34 @@ def test_pipeline_node_default_output(self): # other node level output tests can be found in # dsl/unittests/test_component_func.py::TestComponentFunc::test_component_outputs # data-binding-expression - with pytest.raises(ValidationException, match=" does not support setting path."): - pipeline.jobs["merge_component_outputs"].outputs["component_out_path_1"].path = "xxx" + with pytest.raises( + ValidationException, match=" does not support setting path." + ): + pipeline.jobs["merge_component_outputs"].outputs[ + "component_out_path_1" + ].path = "xxx" def test_pipeline_node_with_identity(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_identity.yml" pipeline_job: PipelineJob = load_job(source=test_path) omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields) + actual_dict = omit_with_wildcard( + pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields + ) assert actual_dict["jobs"] == { "hello_world_component": { "computeId": "cpu-cluster", "identity": {"identity_type": "UserIdentity"}, "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_number}}"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_number": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_number}}", + }, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "hello_world_component", "type": "command", @@ -2001,7 +2547,10 @@ def test_pipeline_node_with_identity(self): "job_input_type": "literal", "value": "${{parent.inputs.job_in_other_number}}", }, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "hello_world_component_2", "type": "command", @@ -2014,7 +2563,10 @@ def test_pipeline_node_with_identity(self): "job_input_type": "literal", "value": "${{parent.inputs.job_in_other_number}}", }, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.job_in_path}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_in_path}}", + }, }, "name": "hello_world_component_3", "type": "command", @@ -2026,7 +2578,9 @@ def test_pipeline_node_with_identity(self): reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes", ) def test_pipeline_parameter_with_empty_value(self, client: MLClient) -> None: - input_types_func = load_component(source="./tests/test_configs/components/input_types_component.yml") + input_types_func = load_component( + source="./tests/test_configs/components/input_types_component.yml" + ) @group class InputGroup: @@ -2039,7 +2593,12 @@ class InputGroup: description="This is the basic pipeline with empty_value", ) def empty_value_pipeline( - integer: int, boolean: bool, number: float, str_param: str, empty_str: str, input_group: InputGroup + integer: int, + boolean: bool, + number: float, + str_param: str, + empty_str: str, + input_group: InputGroup, ): input_types_func( component_in_string=str_param, @@ -2052,7 +2611,12 @@ def empty_value_pipeline( input_types_func(component_in_string=input_group.group_none_str) pipeline = empty_value_pipeline( - integer=0, boolean=False, number=0, str_param="str_param", empty_str="", input_group=InputGroup() + integer=0, + boolean=False, + number=0, + str_param="str_param", + empty_str="", + input_group=InputGroup(), ) rest_obj = pipeline._to_rest_object() # Currently MFE not support pass empty str or None as pipeline input. @@ -2067,13 +2631,17 @@ def empty_value_pipeline( reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes", ) def test_pipeline_input_as_runsettings_value(self, client: MLClient) -> None: - input_types_func = load_component(source="./tests/test_configs/components/input_types_component.yml") + input_types_func = load_component( + source="./tests/test_configs/components/input_types_component.yml" + ) @dsl.pipeline( default_compute="cpu-cluster", description="Set pipeline input to runsettings", ) - def empty_value_pipeline(integer: int, boolean: bool, number: float, str_param: str, shm_size: str): + def empty_value_pipeline( + integer: int, boolean: bool, number: float, str_param: str, shm_size: str + ): component = input_types_func( component_in_string=str_param, component_in_ranged_integer=integer, @@ -2085,17 +2653,26 @@ def empty_value_pipeline(integer: int, boolean: bool, number: float, str_param: shm_size=shm_size, ) - pipeline = empty_value_pipeline(integer=0, boolean=False, number=0, str_param="str_param", shm_size="20g") + pipeline = empty_value_pipeline( + integer=0, boolean=False, number=0, str_param="str_param", shm_size="20g" + ) rest_obj = pipeline._to_rest_object() - expect_resource = {"instance_count": "${{parent.inputs.integer}}", "shm_size": "${{parent.inputs.shm_size}}"} + expect_resource = { + "instance_count": "${{parent.inputs.integer}}", + "shm_size": "${{parent.inputs.shm_size}}", + } assert rest_obj.properties.jobs["component"]["resources"] == expect_resource def test_pipeline_job_serverless_compute_with_job_tier(self) -> None: yaml_path = "./tests/test_configs/pipeline_jobs/serverless_compute/job_tier/pipeline_with_job_tier.yml" pipeline_job = load_job(yaml_path) rest_obj = pipeline_job._to_rest_object() - assert rest_obj.properties.jobs["spot_job_tier"]["queue_settings"] == {"job_tier": "Spot"} - assert rest_obj.properties.jobs["standard_job_tier"]["queue_settings"] == {"job_tier": "Standard"} + assert rest_obj.properties.jobs["spot_job_tier"]["queue_settings"] == { + "job_tier": "Spot" + } + assert rest_obj.properties.jobs["standard_job_tier"]["queue_settings"] == { + "job_tier": "Standard" + } def test_pipeline_job_sweep_with_job_tier_in_pipeline(self) -> None: yaml_path = "./tests/test_configs/pipeline_jobs/serverless_compute/job_tier/sweep_in_pipeline/pipeline.yml" @@ -2103,14 +2680,18 @@ def test_pipeline_job_sweep_with_job_tier_in_pipeline(self) -> None: # for sweep job, its job_tier value will be lowercase due to its implementation, # and service side shall accept both capital and lowercase, so it is expected for now. rest_obj = pipeline_job._to_rest_object() - assert rest_obj.properties.jobs["node"]["queue_settings"] == {"job_tier": "standard"} + assert rest_obj.properties.jobs["node"]["queue_settings"] == { + "job_tier": "standard" + } def test_pipeline_job_automl_with_job_tier_in_pipeline(self) -> None: yaml_path = "./tests/test_configs/pipeline_jobs/serverless_compute/job_tier/automl_in_pipeline/pipeline.yml" pipeline_job = load_job(yaml_path) # similar to sweep job, automl job job_tier value is also lowercase. rest_obj = pipeline_job._to_rest_object() - assert rest_obj.properties.jobs["text_ner_node"]["queue_settings"] == {"job_tier": "spot"} + assert rest_obj.properties.jobs["text_ner_node"]["queue_settings"] == { + "job_tier": "spot" + } @pytest.mark.skipif( platform.python_implementation() == "PyPy", @@ -2131,7 +2712,9 @@ def pipeline_with_duplicate_output(dataset: Input, str_param: str): "output2": component.outputs.component_out_path, } - pipeline_job = pipeline_with_duplicate_output(str_param=1, dataset=Input(path=component_path)) + pipeline_job = pipeline_with_duplicate_output( + str_param=1, dataset=Input(path=component_path) + ) assert "output1" in pipeline_job.outputs assert "output2" in pipeline_job.outputs @@ -2147,14 +2730,20 @@ def test_pipeline_job_with_flow(self) -> None: test_path = "./tests/test_configs/pipeline_jobs/pipeline_job_with_flow.yml" pipeline: PipelineJob = load_job(source=test_path) - assert isinstance(pipeline.jobs["anonymous_parallel_flow"].component, FlowComponent) - assert pipeline.jobs["anonymous_parallel_flow"].component.additional_includes == [ + assert isinstance( + pipeline.jobs["anonymous_parallel_flow"].component, FlowComponent + ) + assert pipeline.jobs[ + "anonymous_parallel_flow" + ].component.additional_includes == [ "../additional_includes/convert_to_dict.py", "../additional_includes/fetch_text_content_from_url.py", "../additional_includes/summarize_text_content.jinja2", ] - assert isinstance(pipeline.jobs["anonymous_parallel_flow_from_run"].component, FlowComponent) + assert isinstance( + pipeline.jobs["anonymous_parallel_flow_from_run"].component, FlowComponent + ) dummy_component_arm_id = ( "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.MachineLearningServices/" @@ -2178,18 +2767,29 @@ def test_pipeline_job_with_flow(self) -> None: "job_input_type": "literal", "value": "text-davinci-003", }, - "data": {"job_input_type": "literal", "value": "${{parent.inputs.web_classification_input}}"}, + "data": { + "job_input_type": "literal", + "value": "${{parent.inputs.web_classification_input}}", + }, "url": {"job_input_type": "literal", "value": "${data.url}"}, }, "name": "anonymous_parallel_flow", - "outputs": {"flow_outputs": {"type": "literal", "value": "${{parent.outputs.output_data}}"}}, + "outputs": { + "flow_outputs": { + "type": "literal", + "value": "${{parent.outputs.output_data}}", + } + }, "type": "parallel", }, "anonymous_parallel_flow_from_run": { "_source": "YAML.COMPONENT", "componentId": dummy_component_arm_id, "inputs": { - "data": {"job_input_type": "literal", "value": "${{parent.inputs.basic_input}}"}, + "data": { + "job_input_type": "literal", + "value": "${{parent.inputs.basic_input}}", + }, "text": {"job_input_type": "literal", "value": "${data.text}"}, }, "name": "anonymous_parallel_flow_from_run", @@ -2197,13 +2797,17 @@ def test_pipeline_job_with_flow(self) -> None: }, } - def test_pipeline_job_with_data_binding_expression_on_spark_resource(self, mock_machinelearning_client): + def test_pipeline_job_with_data_binding_expression_on_spark_resource( + self, mock_machinelearning_client + ): test_path = "tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline_with_data_binding_expression.yml" pipeline_job: PipelineJob = load_job(source=test_path) assert mock_machinelearning_client.jobs.validate(pipeline_job).passed pipeline_job_rest_object = pipeline_job._to_rest_object() - assert pipeline_job_rest_object.properties.jobs["count_by_row"]["resources"] == { + assert pipeline_job_rest_object.properties.jobs["count_by_row"][ + "resources" + ] == { "instance_type": "${{parent.inputs.instance_type}}", "runtime_version": "3.4.0", } diff --git a/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py b/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py index 993b855d574b..c85f83f60dc4 100644 --- a/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py +++ b/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py @@ -3,6 +3,7 @@ # --------------------------------------------------------- import copy +import json import os import shutil import signal @@ -27,7 +28,9 @@ from azure.ai.ml.operations._job_ops_helper import _wait_before_polling from azure.ai.ml.operations._run_history_constants import JobStatus, RunHistoryConstants -_PYTEST_TIMEOUT_METHOD = "signal" if hasattr(signal, "SIGALRM") else "thread" # use signal when os support SIGALRM +_PYTEST_TIMEOUT_METHOD = ( + "signal" if hasattr(signal, "SIGALRM") else "thread" +) # use signal when os support SIGALRM DEFAULT_TASK_TIMEOUT = 30 * 60 # 30mins THREAD_WAIT_TIME_BEFORE_POLL = 60 # 1min @@ -41,7 +44,9 @@ def write_script(script_path: str, content: str) -> str: return script_path -def get_arm_id(ws_scope: OperationScope, entity_name: str, entity_version: str, entity_type) -> str: +def get_arm_id( + ws_scope: OperationScope, entity_name: str, entity_version: str, entity_type +) -> str: arm_id = ( "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{" "}/{}/{}/versions/{}".format( @@ -83,7 +88,11 @@ def omit_with_wildcard(obj, *properties: str): def prepare_dsl_curated( - pipeline: PipelineJob, job_yaml, omit_fields=None, enable_default_omit_fields=True, in_rest=False + pipeline: PipelineJob, + job_yaml, + omit_fields=None, + enable_default_omit_fields=True, + in_rest=False, ): """ Prepare the dsl pipeline for curated test. @@ -93,8 +102,19 @@ def prepare_dsl_curated( omit_fields = [] pipeline_from_yaml = load_job(source=job_yaml) if in_rest: - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() # pylint: disable=protected-access - pipeline_job_dict = pipeline_from_yaml._to_rest_object().as_dict() # pylint: disable=protected-access + # ``as_dict`` produces the wire dict for the arm_ml_service hybrid rest model; the ``json`` + # round-trip with ``default=str`` stringifies any residual data-binding expression objects + # (as the legacy msrest ``serialize`` did) so the two dicts compare cleanly. + dsl_pipeline_job_dict = json.loads( + json.dumps( + pipeline._to_rest_object().as_dict(), default=str + ) # pylint: disable=protected-access + ) + pipeline_job_dict = json.loads( + json.dumps( + pipeline_from_yaml._to_rest_object().as_dict(), default=str + ) # pylint: disable=protected-access + ) if enable_default_omit_fields: omit_fields.extend( @@ -108,13 +128,25 @@ def prepare_dsl_curated( "properties.jobs.*.trial.properties.componentSpec.schema", "properties.jobs.*.trial.properties.isAnonymous", "properties.jobs.*.trial.properties.componentSpec._source", + # The arm_ml_service hybrid ``as_dict`` renders the nested sweep trial with snake_case + # keys (``component_spec``/``is_anonymous``) rather than the legacy msrest camelCase; + # omit both spellings so DSL-vs-YAML equivalence still holds after the client swap. + "properties.jobs.*.trial.name", + "properties.jobs.*.trial.properties.is_anonymous", + "properties.jobs.*.trial.properties.component_spec.name", + "properties.jobs.*.trial.properties.component_spec.version", + "properties.jobs.*.trial.properties.component_spec.$schema", + "properties.jobs.*.trial.properties.component_spec.schema", + "properties.jobs.*.trial.properties.component_spec._source", "properties.settings", "properties.jobs.*.trial.properties.properties.client_component_hash", ] ) else: dsl_pipeline_job_dict = pipeline._to_dict() # pylint: disable=protected-access - pipeline_job_dict = pipeline_from_yaml._to_dict() # pylint: disable=protected-access + pipeline_job_dict = ( + pipeline_from_yaml._to_dict() + ) # pylint: disable=protected-access if enable_default_omit_fields: omit_fields.extend( [ @@ -132,7 +164,9 @@ def prepare_dsl_curated( return dsl_pipeline_job_dict, pipeline_job_dict -def submit_and_wait(ml_client, pipeline_job: PipelineJob, expected_state: str = "Completed") -> PipelineJob: +def submit_and_wait( + ml_client, pipeline_job: PipelineJob, expected_state: str = "Completed" +) -> PipelineJob: created_job = ml_client.jobs.create_or_update(pipeline_job) terminal_states = ["Completed", "Failed", "Canceled", "NotResponding"] assert created_job is not None @@ -152,12 +186,18 @@ def submit_and_wait(ml_client, pipeline_job: PipelineJob, expected_state: str = def assert_final_job_status( - job, client: MLClient, job_type: Job, expected_terminal_status: str, deadline: int = DEFAULT_TASK_TIMEOUT + job, + client: MLClient, + job_type: Job, + expected_terminal_status: str, + deadline: int = DEFAULT_TASK_TIMEOUT, ) -> None: assert isinstance(job, job_type) poll_start_time = time.time() - while job.status not in RunHistoryConstants.TERMINAL_STATUSES and time.time() < (poll_start_time + deadline): + while job.status not in RunHistoryConstants.TERMINAL_STATUSES and time.time() < ( + poll_start_time + deadline + ): sleep_if_live(THREAD_WAIT_TIME_BEFORE_POLL) job = client.jobs.get(job.name) @@ -166,7 +206,9 @@ def assert_final_job_status( assert isinstance(cancel_poller, LROPoller) assert cancel_poller.result() is None - assert job.status == expected_terminal_status, f"Job status mismatch. Job created: {job}" + assert ( + job.status == expected_terminal_status + ), f"Job status mismatch. Job created: {job}" def get_automl_job_properties() -> Dict: @@ -215,7 +257,9 @@ def verify_entity_load_and_dump( with StringIO() as stream: stream.write(file_contents) stream.seek(0) - stream_entity = load_function(source=stream, relative_origin=test_load_file_path, **load_kwargs) + stream_entity = load_function( + source=stream, relative_origin=test_load_file_path, **load_kwargs + ) assert file_entity is not None assert stream_entity is not None @@ -302,12 +346,15 @@ def assert_job_cancel( cancel_job(client, created_job) elif wait_for_completion is True: assert wait_until_done(client, created_job) == JobStatus.COMPLETED, ( - "Job failed. Please check it on studio for more details: %s" % created_job.studio_url + "Job failed. Please check it on studio for more details: %s" + % created_job.studio_url ) return created_job -def submit_and_cancel_new_dsl_pipeline(pipeline_func, client, default_compute="cpu-cluster", **kwargs): +def submit_and_cancel_new_dsl_pipeline( + pipeline_func, client, default_compute="cpu-cluster", **kwargs +): pipeline_job: PipelineJob = pipeline_func(**kwargs) pipeline_job.settings.default_compute = default_compute return assert_job_cancel(pipeline_job, client) @@ -420,7 +467,9 @@ def reload_schema_for_nodes_in_pipeline_job(*, revert_after_yield: bool = True): # Update the node types in pipeline jobs to include the private preview node types from azure.ai.ml._schema.pipeline import pipeline_job - declared_fields = pipeline_job.PipelineJobSchema._declared_fields # pylint: disable=protected-access, no-member + declared_fields = ( + pipeline_job.PipelineJobSchema._declared_fields + ) # pylint: disable=protected-access, no-member original_jobs = declared_fields["jobs"] declared_fields["jobs"] = pipeline_job.PipelineJobsField() @@ -446,5 +495,8 @@ def mock_get_artifacts(**kwargs): (artifact / f"file_{version}").touch(exist_ok=True) return str(artifact) - with patch("azure.ai.ml._utils._artifact_utils.ArtifactCache.get", side_effect=mock_get_artifacts): + with patch( + "azure.ai.ml._utils._artifact_utils.ArtifactCache.get", + side_effect=mock_get_artifacts, + ): yield temp_dir From e082467702004cf006eb97439348a90e79e67faf Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 18:06:43 +0530 Subject: [PATCH 019/146] migrate(jobs): _input_output_helpers JobInput/JobOutput to arm_ml_service Flip the shared job input/output conversion helpers off v2023_04_01_preview onto the arm_ml_service hybrid models. This is the central job-boundary bottleneck imported by nearly every job entity, so the flip turns all the existing to_hybrid_rest_model boundary wraps (command/spark/sweep/automl/ import/finetuning/pipeline) into no-ops while keeping the wire identical. - _input_output_helpers.py: all Rest input/output model imports + enums (JobInputType/JobOutputType/InputDeliveryMode/OutputDeliveryMode) -> arm. The arm JobOutput ctor dropped assetVersion/pathOnCompute; assetVersion is preserved via a wire-key (output["assetVersion"]) to match the legacy wire, pathOnCompute is dropped (msrest dropped it on serialize too). Literal inputs keep mode/pathOnCompute as plain non-serialized attributes (the node serializer reads val.mode back). Read path (from_rest_data_outputs) is dual-compatible: reads assetVersion/pathOnCompute via mapping .get() for arm hybrids (still-msrest operations-layer objects use attribute access). - pipeline/_io/mixin.py: _rest_io_to_snake_dict helper uses as_attribute_dict for arm hybrids (arm as_dict() is camelCase; msrest as_dict() was snake) and merges the dropped assetVersion wire key back, so the node serializer keeps the snake_case dict shape it expects. - monitoring/signals.py: custom signal inputs serialize via arm as_dict(). - Test: 3 internal pipeline assertions read the arm rest object via as_attribute_dict to keep snake_case field names. Validated: full smoke_serialization (146/146, byte-identical wire) + 863 passed across pipeline/dsl/internal/command/sweep/spark, plus automl/ finetuning/monitoring/schedule/component/feature_set/batch/online/data_import /dataset families (all green). Retires the v2023_04 JobInput/JobOutput consumer that gated the rest of the job families. --- .../ml/entities/_job/_input_output_helpers.py | 131 ++++++--- .../ai/ml/entities/_job/pipeline/_io/mixin.py | 135 +++++++-- .../ai/ml/entities/_monitoring/signals.py | 269 +++++++++++++----- .../internal/unittests/test_pipeline_job.py | 177 +++++++++--- 4 files changed, 536 insertions(+), 176 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py index 98a6fbf23ca8..f4973338cbb6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py @@ -6,46 +6,46 @@ import re from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( CustomModelJobInput as RestCustomModelJobInput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( CustomModelJobOutput as RestCustomModelJobOutput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import InputDeliveryMode -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInputType -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutputType, LiteralJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import InputDeliveryMode +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import JobInputType +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import JobOutputType, LiteralJobInput +from azure.ai.ml._restclient.arm_ml_service.models import ( MLFlowModelJobInput as RestMLFlowModelJobInput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( MLFlowModelJobOutput as RestMLFlowModelJobOutput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( MLTableJobInput as RestMLTableJobInput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( MLTableJobOutput as RestMLTableJobOutput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import OutputDeliveryMode -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import OutputDeliveryMode +from azure.ai.ml._restclient.arm_ml_service.models import ( TritonModelJobInput as RestTritonModelJobInput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( TritonModelJobOutput as RestTritonModelJobOutput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( UriFileJobInput as RestUriFileJobInput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( UriFileJobOutput as RestUriFileJobOutput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( UriFolderJobInput as RestUriFolderJobInput, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( UriFolderJobOutput as RestUriFolderJobOutput, ) from azure.ai.ml._utils.utils import is_data_binding_expression @@ -86,14 +86,18 @@ def to_hybrid_rest_model(value: Any, arm_base_cls: Any) -> Any: if value is None: return None if isinstance(value, dict): - return {key: to_hybrid_rest_model(item, arm_base_cls) for key, item in value.items()} + return { + key: to_hybrid_rest_model(item, arm_base_cls) for key, item in value.items() + } if isinstance(value, list): return [to_hybrid_rest_model(item, arm_base_cls) for item in value] # Already an arm_ml_service hybrid model (e.g. a partially-migrated child): leave as-is. if hasattr(value, "_is_model"): return value # msrest model -> camelCase wire dict -> discriminated arm hybrid model. - return arm_base_cls._deserialize(value.serialize(), []) # pylint: disable=protected-access + return arm_base_cls._deserialize( + value.serialize(), [] + ) # pylint: disable=protected-access INPUT_MOUNT_MAPPING_FROM_REST = { @@ -196,13 +200,24 @@ def build_input_output( return item -def _validate_inputs_for(input_consumer_name: str, input_consumer: str, inputs: Optional[Dict]) -> None: +def _validate_inputs_for( + input_consumer_name: str, input_consumer: str, inputs: Optional[Dict] +) -> None: implicit_inputs = re.findall(r"\${{inputs\.([\w\.-]+)}}", input_consumer) # optional inputs no need to validate whether they're in inputs - optional_inputs = re.findall(r"\[[\w\.\s-]*\${{inputs\.([\w\.-]+)}}]", input_consumer) + optional_inputs = re.findall( + r"\[[\w\.\s-]*\${{inputs\.([\w\.-]+)}}]", input_consumer + ) for key in implicit_inputs: - if inputs is not None and inputs.get(key, None) is None and key not in optional_inputs: - msg = "Inputs to job does not contain '{}' referenced in " + input_consumer_name + if ( + inputs is not None + and inputs.get(key, None) is None + and key not in optional_inputs + ): + msg = ( + "Inputs to job does not contain '{}' referenced in " + + input_consumer_name + ) raise ValidationException( message=msg.format(key), no_personal_data_message=msg.format("[key]"), @@ -238,9 +253,7 @@ def validate_pipeline_input_key_characters(key: str) -> None: # Note: ([a-zA-Z_]+[a-zA-Z0-9_]*) is a valid single key, # so a valid pipeline key is: ^{single_key}([.]{single_key})*$ if re.match(IOConstants.VALID_KEY_PATTERN, key) is None: - msg = ( - "Pipeline input key name {} must be composed letters, numbers, and underscores with optional split by dots." - ) + msg = "Pipeline input key name {} must be composed letters, numbers, and underscores with optional split by dots." raise ValidationException( message=msg.format(key), no_personal_data_message=msg.format("[key]"), @@ -281,7 +294,10 @@ def to_rest_dataset_literal_inputs( and is_data_binding_expression(input_value.path) ): input_data = LiteralJobInput(value=input_value.path) - # set mode attribute manually for binding job input + # ``mode``/``pathOnCompute`` are not part of the LiteralJobInput wire body (the legacy + # msrest model dropped them from ``serialize()`` too), but the pipeline node serializer + # reads ``val.mode`` back off the object, so keep them as plain (non-serialized) + # attributes on the arm_ml_service hybrid to preserve that behavior. if input_value.mode: input_data.mode = INPUT_MOUNT_MAPPING_TO_REST[input_value.mode] if getattr(input_value, "path_on_compute", None) is not None: @@ -293,7 +309,11 @@ def to_rest_dataset_literal_inputs( if input_value.type in target_cls_dict: input_data = target_cls_dict[input_value.type]( uri=input_value.path, - mode=(INPUT_MOUNT_MAPPING_TO_REST[input_value.mode.lower()] if input_value.mode else None), + mode=( + INPUT_MOUNT_MAPPING_TO_REST[input_value.mode.lower()] + if input_value.mode + else None + ), ) else: msg = f"Job input type {input_value.type} is not supported as job input." @@ -311,7 +331,8 @@ def to_rest_dataset_literal_inputs( # otherwise, the input is a literal input if isinstance(input_value, dict): input_data = LiteralJobInput(value=str(input_value["value"])) - # set mode attribute manually for binding job input + # ``mode`` is not part of the literal wire body but the pipeline node serializer reads + # it back off the object, so keep it as a plain (non-serialized) attribute. if "mode" in input_value: input_data.mode = input_value["mode"] else: @@ -355,7 +376,11 @@ def from_rest_inputs_to_dataset_literal(inputs: Dict[str, RestJobInput]) -> Dict input_data = Input( type=type_transfer_dict[input_value.job_input_type], path=path, - mode=(INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] if input_value.mode else None), + mode=( + INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] + if input_value.mode + else None + ), path_on_compute=sourcePathOnCompute, ) elif input_value.job_input_type in (JobInputType.LITERAL, JobInputType.LITERAL): @@ -371,7 +396,9 @@ def from_rest_inputs_to_dataset_literal(inputs: Dict[str, RestJobInput]) -> Dict error_type=ValidationErrorType.INVALID_VALUE, ) - from_rest_inputs[input_name] = input_data # pylint: disable=possibly-used-before-assignment + from_rest_inputs[input_name] = ( + input_data # pylint: disable=possibly-used-before-assignment + ) return from_rest_inputs @@ -394,16 +421,25 @@ def to_rest_data_outputs(outputs: Optional[Dict]) -> Dict[str, RestJobOutput]: else: target_cls_dict = get_output_rest_cls_dict() - output_value_type = output_value.type if output_value.type else AssetTypes.URI_FOLDER + output_value_type = ( + output_value.type if output_value.type else AssetTypes.URI_FOLDER + ) if output_value_type in target_cls_dict: output = target_cls_dict[output_value_type]( asset_name=output_value.name, - asset_version=output_value.version, uri=output_value.path, - mode=(OUTPUT_MOUNT_MAPPING_TO_REST[output_value.mode.lower()] if output_value.mode else None), - pathOnCompute=getattr(output_value, "path_on_compute", None), + mode=( + OUTPUT_MOUNT_MAPPING_TO_REST[output_value.mode.lower()] + if output_value.mode + else None + ), description=output_value.description, ) + # The shared arm_ml_service JobOutput models dropped ``assetVersion``/``pathOnCompute`` + # from their constructor; the legacy msrest wire carried ``assetVersion`` (but not + # ``pathOnCompute``), so preserve it as an unknown wire key when present. + if output_value.version is not None: + output["assetVersion"] = output_value.version else: msg = "unsupported JobOutput type: {}".format(output_value.type) raise ValidationException( @@ -435,19 +471,32 @@ def from_rest_data_outputs(outputs: Dict[str, RestJobOutput]) -> Dict[str, Outpu # deal with invalid output type submitted by feb api # todo: backend help convert node level input/output type normalize_job_input_output_type(output_value) - if getattr(output_value, "pathOnCompute", None) is not None: - sourcePathOnCompute = output_value.pathOnCompute + # ``pathOnCompute``/``assetVersion`` live as attributes on the legacy msrest models (still returned + # by the operations layer) but as unknown wire keys on the shared arm_ml_service hybrid models + # (a MutableMapping) produced by an entity round-trip; read whichever spelling is present. + if getattr(output_value, "_is_model", False) is True: + sourcePathOnCompute = output_value.get("pathOnCompute") + asset_version = output_value.get("assetVersion") else: - sourcePathOnCompute = None + sourcePathOnCompute = getattr(output_value, "pathOnCompute", None) + asset_version = ( + output_value.asset_version + if hasattr(output_value, "asset_version") + else None + ) if output_value.job_output_type in output_type_mapping: from_rest_outputs[output_name] = Output( type=output_type_mapping[output_value.job_output_type], path=output_value.uri, - mode=(OUTPUT_MOUNT_MAPPING_FROM_REST[output_value.mode] if output_value.mode else None), + mode=( + OUTPUT_MOUNT_MAPPING_FROM_REST[output_value.mode] + if output_value.mode + else None + ), path_on_compute=sourcePathOnCompute, description=output_value.description, name=output_value.asset_name, - version=(output_value.asset_version if hasattr(output_value, "asset_version") else None), + version=asset_version, ) else: msg = "unsupported JobOutput type: {}".format(output_value.job_output_type) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 6c3d9357dd9b..50ae5d77a62e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -6,11 +6,36 @@ from typing import Any, Dict, List, Optional, Tuple, Type, Union from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + JobOutput as RestJobOutput, +) from azure.ai.ml.constants._component import ComponentJobConstants from azure.ai.ml.entities._inputs_outputs import GroupInput, Input, Output from azure.ai.ml.entities._util import copy_output_setting from azure.ai.ml.exceptions import ErrorTarget, ValidationErrorType, ValidationException +from azure.core.serialization import as_attribute_dict + + +def _rest_io_to_snake_dict(rest_io: Any) -> Dict: + """Convert a rest input/output model to the snake_case dict the node serializer expects. + + The legacy msrest models produced snake_case from ``as_dict()``; the shared arm_ml_service hybrid + models produce camelCase from ``as_dict()`` (and drop ``assetVersion``/``pathOnCompute`` to unknown + wire keys), so use ``as_attribute_dict`` for the snake_case field view and merge any dropped wire + keys back so downstream name/version handling still finds them. + + :param rest_io: A msrest or arm_ml_service rest input/output model. + :return: The snake_case dict view. + :rtype: Dict + """ + if getattr(rest_io, "_is_model", False) is True: + result = as_attribute_dict(rest_io) + asset_version = rest_io.get("assetVersion") + if asset_version is not None: + result["asset_version"] = asset_version + return result + return rest_io.as_dict() + from ..._input_output_helpers import ( from_rest_data_outputs, @@ -36,7 +61,9 @@ def _get_supported_outputs_types(cls) -> Optional[Any]: return None @classmethod - def _validate_io(cls, value: Any, allowed_types: Optional[tuple], *, key: Optional[str] = None) -> None: + def _validate_io( + cls, value: Any, allowed_types: Optional[tuple], *, key: Optional[str] = None + ) -> None: if allowed_types is None: return @@ -46,7 +73,9 @@ def _validate_io(cls, value: Any, allowed_types: Optional[tuple], *, key: Option msg = "Expecting {} for input/output {}, got {} instead." raise ValidationException( message=msg.format(allowed_types, key, type(value)), - no_personal_data_message=msg.format(allowed_types, "[key]", type(value)), + no_personal_data_message=msg.format( + allowed_types, "[key]", type(value) + ), target=ErrorTarget.PIPELINE, error_type=ValidationErrorType.INVALID_VALUE, ) @@ -55,7 +84,9 @@ def _build_input( self, name: str, meta: Optional[Input], - data: Optional[Union[dict, int, bool, float, str, Output, "PipelineInput", Input]], + data: Optional[ + Union[dict, int, bool, float, str, Output, "PipelineInput", Input] + ], ) -> NodeInput: # output mode of last node should not affect input mode of next node if isinstance(data, NodeOutput): @@ -75,7 +106,9 @@ def _build_input( self._validate_io(data, self._get_supported_inputs_types(), key=name) return NodeInput(port_name=name, meta=meta, data=data, owner=self) - def _build_output(self, name: str, meta: Optional[Output], data: Optional[Union[Output, str]]) -> NodeOutput: + def _build_output( + self, name: str, meta: Optional[Output], data: Optional[Union[Output, str]] + ) -> NodeOutput: if isinstance(data, dict): data = Output(**data) @@ -113,16 +146,25 @@ def _build_inputs_dict( # If input is set through component functions' kwargs, create an input object with real value. data = inputs[key] else: - data = self._get_default_input_val(val) # pylint: disable=assignment-from-none + data = self._get_default_input_val( + val + ) # pylint: disable=assignment-from-none val = self._build_input(name=key, meta=val, data=data) input_dict[key] = val else: - input_dict = {key: self._build_input(name=key, meta=None, data=val) for key, val in inputs.items()} + input_dict = { + key: self._build_input(name=key, meta=None, data=val) + for key, val in inputs.items() + } return InputsAttrDict(input_dict) def _build_outputs_dict( - self, outputs: Dict, *, output_definition_dict: Optional[dict] = None, none_data: bool = False + self, + outputs: Dict, + *, + output_definition_dict: Optional[dict] = None, + none_data: bool = False, ) -> OutputsAttrDict: """Build an output attribute dict so user can get/set outputs by accessing attribute, eg: node1.outputs.xxx. @@ -150,7 +192,9 @@ def _build_outputs_dict( else: output_dict = {} for key, val in outputs.items(): - output_val = self._build_output(name=key, meta=None, data=val if not none_data else None) + output_val = self._build_output( + name=key, meta=None, data=val if not none_data else None + ) output_dict[key] = output_val return OutputsAttrDict(output_dict) @@ -215,7 +259,9 @@ def _to_rest_inputs(self) -> Dict[str, Dict]: return self._input_entity_to_rest_inputs(input_entity=built_inputs) @classmethod - def _input_entity_to_rest_inputs(cls, input_entity: Dict[str, Input]) -> Dict[str, Dict]: + def _input_entity_to_rest_inputs( + cls, input_entity: Dict[str, Input] + ) -> Dict[str, Dict]: # Convert io entity to rest io objects input_bindings, dataset_literal_inputs = process_sdk_component_job_io( input_entity, [ComponentJobConstants.INPUT_PATTERN] @@ -231,7 +277,7 @@ def _input_entity_to_rest_inputs(cls, input_entity: Dict[str, Input]) -> Dict[st # convert rest io to dict rest_dataset_literal_inputs = {} for name, val in rest_inputs.items(): - rest_dataset_literal_inputs[name] = val.as_dict() + rest_dataset_literal_inputs[name] = _rest_io_to_snake_dict(val) if hasattr(val, "mode") and val.mode: rest_dataset_literal_inputs[name].update({"mode": val.mode.value}) return rest_dataset_literal_inputs @@ -273,13 +319,18 @@ def _rename_name_and_version(output_dict: Dict) -> Dict: output_dict["version"] = output_dict.pop("asset_version") return output_dict - rest_data_outputs = {name: _rename_name_and_version(val.as_dict()) for name, val in rest_data_outputs.items()} + rest_data_outputs = { + name: _rename_name_and_version(_rest_io_to_snake_dict(val)) + for name, val in rest_data_outputs.items() + } self._update_output_types(rest_data_outputs) rest_data_outputs.update(rest_output_bindings) return rest_data_outputs @classmethod - def _from_rest_inputs(cls, inputs: Dict) -> Dict[str, Union[Input, str, bool, int, float]]: + def _from_rest_inputs( + cls, inputs: Dict + ) -> Dict[str, Union[Input, str, bool, int, float]]: """Load inputs from rest inputs. :param inputs: The REST inputs @@ -289,7 +340,9 @@ def _from_rest_inputs(cls, inputs: Dict) -> Dict[str, Union[Input, str, bool, in """ # JObject -> RestJobInput/RestJobOutput - input_bindings, rest_inputs = from_dict_to_rest_io(inputs, RestJobInput, [ComponentJobConstants.INPUT_PATTERN]) + input_bindings, rest_inputs = from_dict_to_rest_io( + inputs, RestJobInput, [ComponentJobConstants.INPUT_PATTERN] + ) # RestJobInput/RestJobOutput -> Input/Output dataset_literal_inputs = from_rest_inputs_to_dataset_literal(rest_inputs) @@ -385,23 +438,32 @@ def _validate_group_input_type( """ # Note: We put and extra validation here instead of doing it in pipeline._validate() # due to group input will be discarded silently if assign it to a non-group parameter. - group_msg = "'%s' is defined as a parameter group but got input '%s' with type '%s'." - non_group_msg = "'%s' is defined as a parameter but got a parameter group as input." + group_msg = ( + "'%s' is defined as a parameter group but got input '%s' with type '%s'." + ) + non_group_msg = ( + "'%s' is defined as a parameter but got a parameter group as input." + ) for key, val in inputs.items(): definition = input_definition_dict.get(key) val = GroupInput.custom_class_value_to_attr_dict(val) if val is None: continue # 1. inputs.group = 'a string' - if isinstance(definition, GroupInput) and not isinstance(val, (_GroupAttrDict, dict)): + if isinstance(definition, GroupInput) and not isinstance( + val, (_GroupAttrDict, dict) + ): raise ValidationException( message=group_msg % (key, val, type(val)), - no_personal_data_message=group_msg % ("[key]", "[val]", "[type(val)]"), + no_personal_data_message=group_msg + % ("[key]", "[val]", "[type(val)]"), target=ErrorTarget.PIPELINE, type=ValidationErrorType.INVALID_VALUE, ) # 2. inputs.str_param = group - if not isinstance(definition, GroupInput) and isinstance(val, _GroupAttrDict): + if not isinstance(definition, GroupInput) and isinstance( + val, _GroupAttrDict + ): raise ValidationException( message=non_group_msg % key, no_personal_data_message=non_group_msg % "[key]", @@ -461,8 +523,14 @@ def _flatten_inputs_and_definition( :return: The flattened inputs and definition :rtype: Tuple[Dict, Dict] """ - group_input_names = [key for key, val in input_definition_dict.items() if isinstance(val, GroupInput)] - flattened_inputs = flatten_dict(inputs, _GroupAttrDict, allow_dict_fields=group_input_names) + group_input_names = [ + key + for key, val in input_definition_dict.items() + if isinstance(val, GroupInput) + ] + flattened_inputs = flatten_dict( + inputs, _GroupAttrDict, allow_dict_fields=group_input_names + ) flattened_definition_dict = flatten_dict(input_definition_dict, GroupInput) return flattened_inputs, flattened_definition_dict @@ -489,11 +557,13 @@ def _build_inputs_dict( self._validate_group_input_type(input_definition_dict, inputs) # Flatten inputs and definition - flattened_inputs, flattened_definition_dict = self._flatten_inputs_and_definition( - inputs, input_definition_dict + flattened_inputs, flattened_definition_dict = ( + self._flatten_inputs_and_definition(inputs, input_definition_dict) ) # Build: zip all flattened parameter with definition - inputs = super()._build_inputs_dict(flattened_inputs, input_definition_dict=flattened_definition_dict) + inputs = super()._build_inputs_dict( + flattened_inputs, input_definition_dict=flattened_definition_dict + ) return InputsAttrDict(GroupInput.restore_flattened_inputs(inputs)) return super()._build_inputs_dict(inputs) @@ -502,11 +572,16 @@ class PipelineJobIOMixin(NodeWithGroupInputMixin): """Provides ability to wrap pipeline job inputs/outputs and build data bindings dynamically.""" - def _build_input(self, name: str, meta: Optional[Input], data: Any) -> "PipelineInput": + def _build_input( + self, name: str, meta: Optional[Input], data: Any + ) -> "PipelineInput": return PipelineInput(name=name, meta=meta, data=data, owner=self) def _build_output( - self, name: str, meta: Optional[Union[Input, Output]], data: Optional[Union[Output, str]] + self, + name: str, + meta: Optional[Union[Input, Output]], + data: Optional[Union[Output, str]], ) -> "PipelineOutput": # TODO: settings data to None for un-configured outputs so we won't passing extra fields(eg: default mode) result = PipelineOutput(port_name=name, meta=meta, data=data, owner=self) @@ -527,14 +602,18 @@ def _build_inputs_dict( :return: Built input attribute dict. :rtype: InputsAttrDict """ - input_dict = super()._build_inputs_dict(inputs, input_definition_dict=input_definition_dict) + input_dict = super()._build_inputs_dict( + inputs, input_definition_dict=input_definition_dict + ) # TODO: should we do this when input_definition_dict is not None? # TODO: should we put this in super()._build_inputs_dict? if input_definition_dict is None: return InputsAttrDict(GroupInput.restore_flattened_inputs(input_dict)) return input_dict - def _build_output_for_pipeline(self, name: str, data: Optional[Union[Output, NodeOutput]]) -> "PipelineOutput": + def _build_output_for_pipeline( + self, name: str, data: Optional[Union[Output, NodeOutput]] + ) -> "PipelineOutput": """Build an output object for pipeline and copy settings from source output. :param name: Output name. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py index 763faabb6430..4dabbc8ebcdc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py @@ -11,7 +11,9 @@ from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.arm_ml_service.models import AllFeatures as RestAllFeatures -from azure.ai.ml._restclient.arm_ml_service.models import CustomMonitoringSignal as RestCustomMonitoringSignal +from azure.ai.ml._restclient.arm_ml_service.models import ( + CustomMonitoringSignal as RestCustomMonitoringSignal, +) from azure.ai.ml._restclient.arm_ml_service.models import ( DataDriftMonitoringSignal as RestMonitoringDataDriftSignal, ) @@ -21,12 +23,18 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( FeatureAttributionDriftMonitoringSignal as RestFeatureAttributionDriftMonitoringSignal, ) -from azure.ai.ml._restclient.arm_ml_service.models import FeatureSubset as RestFeatureSubset +from azure.ai.ml._restclient.arm_ml_service.models import ( + FeatureSubset as RestFeatureSubset, +) from azure.ai.ml._restclient.arm_ml_service.models import ( MonitoringFeatureFilterBase as RestMonitoringFeatureFilterBase, ) -from azure.ai.ml._restclient.arm_ml_service.models import MonitoringInputDataBase as RestMonitoringInputData -from azure.ai.ml._restclient.arm_ml_service.models import MonitoringSignalBase as RestMonitoringSignalBase +from azure.ai.ml._restclient.arm_ml_service.models import ( + MonitoringInputDataBase as RestMonitoringInputData, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + MonitoringSignalBase as RestMonitoringSignalBase, +) from azure.ai.ml._restclient.arm_ml_service.models import ( PredictionDriftMonitoringSignal as RestPredictionDriftMonitoringSignal, ) @@ -46,7 +54,11 @@ to_rest_dataset_literal_inputs, ) from azure.ai.ml.entities._mixins import RestTranslatableMixin -from azure.ai.ml.entities._monitoring.input_data import FixedInputData, StaticInputData, TrailingInputData +from azure.ai.ml.entities._monitoring.input_data import ( + FixedInputData, + StaticInputData, + TrailingInputData, +) from azure.ai.ml.entities._monitoring.thresholds import ( CustomMonitoringMetricThreshold, DataDriftMetricThreshold, @@ -58,7 +70,12 @@ ModelPerformanceMetricThreshold, PredictionDriftMetricThreshold, ) -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationErrorType, + ValidationException, +) class DataSegment(RestTranslatableMixin): @@ -113,7 +130,9 @@ def _to_rest_object(self) -> RestTopNFeaturesByAttribution: ) @classmethod - def _from_rest_object(cls, obj: RestTopNFeaturesByAttribution) -> "MonitorFeatureFilter": + def _from_rest_object( + cls, obj: RestTopNFeaturesByAttribution + ) -> "MonitorFeatureFilter": return cls(top_n_feature_importance=obj.top) @@ -174,7 +193,8 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: default_data_window_size = kwargs.get("default_data_window_size") if self.data_window is None: self.data_window = BaselineDataRange( - lookback_window_size=default_data_window_size, lookback_window_offset="P0D" + lookback_window_size=default_data_window_size, + lookback_window_offset="P0D", ) if self.data_window.lookback_window_size in ["default", None]: self.data_window.lookback_window_size = default_data_window_size @@ -282,7 +302,10 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: else "P0D" ), )._to_rest_object() - if self.data_window.window_start is not None and self.data_window.window_end is not None: + if ( + self.data_window.window_start is not None + and self.data_window.window_end is not None + ): return StaticInputData( data_context=self.data_context, target_columns=self.data_column_names, @@ -324,7 +347,11 @@ def _from_rest_object(cls, obj: RestMonitoringInputData) -> "ReferenceData": type=obj["jobInputType"], ), data_context=obj["dataContext"], - pre_processing_component=(obj.get("preprocessingComponentId") if input_data_type != "Fixed" else None), + pre_processing_component=( + obj.get("preprocessingComponentId") + if input_data_type != "Fixed" + else None + ), data_window=data_window, data_column_names=obj.get("columns"), ) @@ -375,7 +402,9 @@ def __init__( self.properties = properties @classmethod - def _from_rest_object(cls, obj: RestMonitoringSignalBase) -> Optional[ # pylint: disable=too-many-return-statements + def _from_rest_object( + cls, obj: RestMonitoringSignalBase + ) -> Optional[ # pylint: disable=too-many-return-statements Union[ "DataDriftSignal", "DataQualitySignal", @@ -439,8 +468,12 @@ def __init__( *, production_data: Optional[ProductionData] = None, reference_data: Optional[ReferenceData] = None, - features: Optional[Union[List[str], MonitorFeatureFilter, Literal["all_features"]]] = None, - feature_type_override: Optional[Dict[str, Union[str, MonitorFeatureDataType]]] = None, + features: Optional[ + Union[List[str], MonitorFeatureFilter, Literal["all_features"]] + ] = None, + feature_type_override: Optional[ + Dict[str, Union[str, MonitorFeatureDataType]] + ] = None, metric_thresholds: Optional[Union[MetricThreshold, List[MetricThreshold]]], alert_enabled: bool = False, properties: Optional[Dict[str, str]] = None, @@ -484,9 +517,15 @@ def __init__( *, production_data: Optional[ProductionData] = None, reference_data: Optional[ReferenceData] = None, - features: Optional[Union[List[str], MonitorFeatureFilter, Literal["all_features"]]] = None, - feature_type_override: Optional[Dict[str, Union[str, MonitorFeatureDataType]]] = None, - metric_thresholds: Optional[Union[DataDriftMetricThreshold, List[MetricThreshold]]] = None, + features: Optional[ + Union[List[str], MonitorFeatureFilter, Literal["all_features"]] + ] = None, + feature_type_override: Optional[ + Dict[str, Union[str, MonitorFeatureDataType]] + ] = None, + metric_thresholds: Optional[ + Union[DataDriftMetricThreshold, List[MetricThreshold]] + ] = None, alert_enabled: bool = False, data_segment: Optional[DataSegment] = None, properties: Optional[Dict[str, str]] = None, @@ -506,18 +545,26 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataDriftSignal: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - if self.production_data is not None and self.production_data.data_window is None: - self.production_data.data_window = BaselineDataRange(lookback_window_size=default_data_window_size) + if ( + self.production_data is not None + and self.production_data.data_window is None + ): + self.production_data.data_window = BaselineDataRange( + lookback_window_size=default_data_window_size + ) rest_features = _to_rest_features(self.features) if self.features else None rest_signal = RestMonitoringDataDriftSignal( production_data=( - self.production_data._to_rest_object(default_data_window_size=default_data_window_size) + self.production_data._to_rest_object( + default_data_window_size=default_data_window_size + ) if self.production_data is not None else None ), reference_data=( self.reference_data._to_rest_object( - default_data_window=default_data_window_size, ref_data_window_size=ref_data_window_size + default_data_window=default_data_window_size, + ref_data_window_size=ref_data_window_size, ) if self.reference_data is not None else None @@ -546,9 +593,13 @@ def _from_rest_object(cls, obj: RestMonitoringDataDriftSignal) -> "DataDriftSign reference_data=ReferenceData._from_rest_object(obj.reference_data), features=_from_rest_features(obj.features), feature_type_override=obj.feature_data_type_override, - metric_thresholds=DataDriftMetricThreshold._from_rest_object(obj.metric_thresholds), + metric_thresholds=DataDriftMetricThreshold._from_rest_object( + obj.metric_thresholds + ), alert_enabled=bool(obj.get("mode") == "Enabled"), - data_segment=DataSegment._from_rest_object(data_segment) if data_segment else None, + data_segment=( + DataSegment._from_rest_object(data_segment) if data_segment else None + ), properties=obj.get("properties"), ) @@ -598,17 +649,25 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestPredictionDriftMonitoringSignal: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - if self.production_data is not None and self.production_data.data_window is None: - self.production_data.data_window = BaselineDataRange(lookback_window_size=default_data_window_size) + if ( + self.production_data is not None + and self.production_data.data_window is None + ): + self.production_data.data_window = BaselineDataRange( + lookback_window_size=default_data_window_size + ) rest_signal = RestPredictionDriftMonitoringSignal( production_data=( - self.production_data._to_rest_object(default_data_window_size=default_data_window_size) + self.production_data._to_rest_object( + default_data_window_size=default_data_window_size + ) if self.production_data is not None else None ), reference_data=( self.reference_data._to_rest_object( - default_data_window=default_data_window_size, ref_data_window_size=ref_data_window_size + default_data_window=default_data_window_size, + ref_data_window_size=ref_data_window_size, ) if self.reference_data is not None else None @@ -627,11 +686,15 @@ def _to_rest_object(self, **kwargs: Any) -> RestPredictionDriftMonitoringSignal: return rest_signal @classmethod - def _from_rest_object(cls, obj: RestPredictionDriftMonitoringSignal) -> "PredictionDriftSignal": + def _from_rest_object( + cls, obj: RestPredictionDriftMonitoringSignal + ) -> "PredictionDriftSignal": return cls( production_data=ProductionData._from_rest_object(obj.production_data), reference_data=ReferenceData._from_rest_object(obj.reference_data), - metric_thresholds=PredictionDriftMetricThreshold._from_rest_object(obj.metric_thresholds), + metric_thresholds=PredictionDriftMetricThreshold._from_rest_object( + obj.metric_thresholds + ), alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), ) @@ -669,9 +732,15 @@ def __init__( *, production_data: Optional[ProductionData] = None, reference_data: Optional[ReferenceData] = None, - features: Optional[Union[List[str], MonitorFeatureFilter, Literal["all_features"]]] = None, - feature_type_override: Optional[Dict[str, Union[str, MonitorFeatureDataType]]] = None, - metric_thresholds: Optional[Union[MetricThreshold, List[MetricThreshold]]] = None, + features: Optional[ + Union[List[str], MonitorFeatureFilter, Literal["all_features"]] + ] = None, + feature_type_override: Optional[ + Dict[str, Union[str, MonitorFeatureDataType]] + ] = None, + metric_thresholds: Optional[ + Union[MetricThreshold, List[MetricThreshold]] + ] = None, alert_enabled: bool = False, properties: Optional[Dict[str, str]] = None, ): @@ -689,7 +758,10 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - if self.production_data is not None and self.production_data.data_window is None: + if ( + self.production_data is not None + and self.production_data.data_window is None + ): self.production_data.data_window = BaselineDataRange( lookback_window_size=default_data_window_size, ) @@ -704,13 +776,16 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: ) rest_signal = RestMonitoringDataQualitySignal( production_data=( - self.production_data._to_rest_object(default_data_window_size=default_data_window_size) + self.production_data._to_rest_object( + default_data_window_size=default_data_window_size + ) if self.production_data is not None else None ), reference_data=( self.reference_data._to_rest_object( - default_data_window=default_data_window_size, ref_data_window_size=ref_data_window_size + default_data_window=default_data_window_size, + ref_data_window_size=ref_data_window_size, ) if self.reference_data is not None else None @@ -726,13 +801,17 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: return rest_signal @classmethod - def _from_rest_object(cls, obj: RestMonitoringDataQualitySignal) -> "DataQualitySignal": + def _from_rest_object( + cls, obj: RestMonitoringDataQualitySignal + ) -> "DataQualitySignal": return cls( production_data=ProductionData._from_rest_object(obj.production_data), reference_data=ReferenceData._from_rest_object(obj.reference_data), features=_from_rest_features(obj.features), feature_type_override=obj.feature_data_type_override, - metric_thresholds=DataQualityMetricThreshold._from_rest_object(obj.metric_thresholds), + metric_thresholds=DataQualityMetricThreshold._from_rest_object( + obj.metric_thresholds + ), alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), ) @@ -784,7 +863,8 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: default_data_window_size = kwargs.get("default") if self.data_window is None: self.data_window = BaselineDataRange( - lookback_window_size=default_data_window_size, lookback_window_offset="P0D" + lookback_window_size=default_data_window_size, + lookback_window_offset="P0D", ) if self.data_window.lookback_window_size == "default": self.data_window.lookback_window_size = default_data_window_size @@ -857,17 +937,23 @@ def __init__( self.properties = properties self.type = MonitorSignalType.FEATURE_ATTRIBUTION_DRIFT - def _to_rest_object(self, **kwargs: Any) -> RestFeatureAttributionDriftMonitoringSignal: + def _to_rest_object( + self, **kwargs: Any + ) -> RestFeatureAttributionDriftMonitoringSignal: default_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") rest_signal = RestFeatureAttributionDriftMonitoringSignal( production_data=( - [data._to_rest_object(default=default_window_size) for data in self.production_data] + [ + data._to_rest_object(default=default_window_size) + for data in self.production_data + ] if self.production_data is not None else None ), reference_data=self.reference_data._to_rest_object( - default_data_window=default_window_size, ref_data_window_size=ref_data_window_size + default_data_window=default_window_size, + ref_data_window_size=ref_data_window_size, ), metric_threshold=self.metric_thresholds._to_rest_object(), ) @@ -878,11 +964,18 @@ def _to_rest_object(self, **kwargs: Any) -> RestFeatureAttributionDriftMonitorin return rest_signal @classmethod - def _from_rest_object(cls, obj: RestFeatureAttributionDriftMonitoringSignal) -> "FeatureAttributionDriftSignal": + def _from_rest_object( + cls, obj: RestFeatureAttributionDriftMonitoringSignal + ) -> "FeatureAttributionDriftSignal": return cls( - production_data=[FADProductionData._from_rest_object(data) for data in obj.production_data], + production_data=[ + FADProductionData._from_rest_object(data) + for data in obj.production_data + ], reference_data=ReferenceData._from_rest_object(obj.reference_data), - metric_thresholds=FeatureAttributionDriftMetricThreshold._from_rest_object(obj.metric_threshold), + metric_thresholds=FeatureAttributionDriftMetricThreshold._from_rest_object( + obj.metric_threshold + ), alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), ) @@ -928,7 +1021,9 @@ def _to_rest_object(self, **kwargs: Any) -> dict: ref_data_window_size = kwargs.get("ref_data_window_size") if self.properties is None: self.properties = {} - self.properties["azureml.modelmonitor.model_performance_thresholds"] = self.metric_thresholds._to_str_object() + self.properties["azureml.modelmonitor.model_performance_thresholds"] = ( + self.metric_thresholds._to_str_object() + ) if self.production_data.data_window is None: self.production_data.data_window = BaselineDataRange( lookback_window_size=default_data_window_size, @@ -936,12 +1031,19 @@ def _to_rest_object(self, **kwargs: Any) -> dict: # ``ModelPerformanceSignal`` is not in arm_ml_service; emit the wire dict directly. rest_obj = { "signalType": "ModelPerformance", - "productionData": [self.production_data._to_rest_object(default_data_window_size=default_data_window_size)], + "productionData": [ + self.production_data._to_rest_object( + default_data_window_size=default_data_window_size + ) + ], "referenceData": self.reference_data._to_rest_object( - default_data_window_size=default_data_window_size, ref_data_window_size=ref_data_window_size + default_data_window_size=default_data_window_size, + ref_data_window_size=ref_data_window_size, ), "metricThreshold": self.metric_thresholds._to_rest_object(), - "dataSegment": self.data_segment._to_rest_object() if self.data_segment else None, + "dataSegment": ( + self.data_segment._to_rest_object() if self.data_segment else None + ), "mode": "Enabled" if self.alert_enabled else "Disabled", "properties": self.properties, } @@ -953,8 +1055,12 @@ def _from_rest_object(cls, obj) -> "ModelPerformanceSignal": return cls( production_data=ProductionData._from_rest_object(obj["productionData"][0]), reference_data=ReferenceData._from_rest_object(obj["referenceData"]), - metric_thresholds=ModelPerformanceMetricThreshold._from_rest_object(obj["metricThreshold"]), - data_segment=DataSegment._from_rest_object(data_segment) if data_segment else None, + metric_thresholds=ModelPerformanceMetricThreshold._from_rest_object( + obj["metricThreshold"] + ), + data_segment=( + DataSegment._from_rest_object(data_segment) if data_segment else None + ), alert_enabled=bool(obj.get("mode") == "Enabled"), ) @@ -1040,20 +1146,32 @@ def __init__( self.properties = properties self.connection = connection - def _to_rest_object(self, **kwargs: Any) -> RestCustomMonitoringSignal: # pylint:disable=unused-argument + def _to_rest_object( + self, **kwargs: Any + ) -> RestCustomMonitoringSignal: # pylint:disable=unused-argument if self.connection is None: self.connection = Connection() - # ``inputs`` come from the shared v2023_04 msrest dataset-literal helper; serialize them to plain - # wire dicts so they fit inside the arm_ml_service signal envelope without changing the wire body. - rest_inputs = to_rest_dataset_literal_inputs(self.inputs, job_type=None) if self.inputs else None + # ``inputs`` come from the shared arm_ml_service dataset-literal helper; emit their camelCase wire + # dicts (``as_dict`` on the hybrid model) so they fit inside the arm_ml_service signal envelope + # without changing the wire body. + rest_inputs = ( + to_rest_dataset_literal_inputs(self.inputs, job_type=None) + if self.inputs + else None + ) if rest_inputs is not None: - rest_inputs = {name: value.serialize() for name, value in rest_inputs.items()} + rest_inputs = {name: value.as_dict() for name, value in rest_inputs.items()} rest_signal = RestCustomMonitoringSignal( component_id=self.component_id, - metric_thresholds=[threshold._to_rest_object() for threshold in self.metric_thresholds], + metric_thresholds=[ + threshold._to_rest_object() for threshold in self.metric_thresholds + ], inputs=rest_inputs, input_assets=( - {asset_name: asset_value._to_rest_object() for asset_name, asset_value in self.input_data.items()} + { + asset_name: asset_value._to_rest_object() + for asset_name, asset_value in self.input_data.items() + } if self.input_data else None ), @@ -1066,18 +1184,30 @@ def _to_rest_object(self, **kwargs: Any) -> RestCustomMonitoringSignal: # pylin return rest_signal @classmethod - def _from_rest_object(cls, obj: RestCustomMonitoringSignal) -> "CustomMonitoringSignal": + def _from_rest_object( + cls, obj: RestCustomMonitoringSignal + ) -> "CustomMonitoringSignal": workspace_connection = obj.get("workspaceConnection") return cls( - inputs=from_rest_inputs_to_dataset_literal(obj.inputs) if obj.inputs else None, - input_data={key: ReferenceData._from_rest_object(data) for key, data in obj.input_assets.items()}, + inputs=( + from_rest_inputs_to_dataset_literal(obj.inputs) if obj.inputs else None + ), + input_data={ + key: ReferenceData._from_rest_object(data) + for key, data in obj.input_assets.items() + }, metric_thresholds=[ - CustomMonitoringMetricThreshold._from_rest_object(metric) for metric in obj.metric_thresholds + CustomMonitoringMetricThreshold._from_rest_object(metric) + for metric in obj.metric_thresholds ], component_id=obj.component_id, alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), - connection=Connection._from_rest_object(workspace_connection) if workspace_connection else None, + connection=( + Connection._from_rest_object(workspace_connection) + if workspace_connection + else None + ), ) @@ -1184,7 +1314,10 @@ def _to_rest_object(self, **kwargs: Any) -> dict: rest_obj = { "signalType": "GenerationSafetyQuality", "productionData": ( - [data._to_rest_object(default=data_window_size) for data in self.production_data] + [ + data._to_rest_object(default=data_window_size) + for data in self.production_data + ] if self.production_data is not None else None ), @@ -1199,7 +1332,9 @@ def _to_rest_object(self, **kwargs: Any) -> dict: @classmethod def _from_rest_object(cls, obj) -> "GenerationSafetyQualitySignal": return cls( - production_data=[LlmData._from_rest_object(data) for data in obj["productionData"]], + production_data=[ + LlmData._from_rest_object(data) for data in obj["productionData"] + ], connection_id=obj.get("workspaceConnectionId"), metric_thresholds=GenerationSafetyQualityMonitoringMetricThreshold._from_rest_object( obj["metricThresholds"] @@ -1242,7 +1377,9 @@ def __init__( self, *, production_data: Optional[LlmData] = None, - metric_thresholds: Optional[GenerationTokenStatisticsMonitorMetricThreshold] = None, + metric_thresholds: Optional[ + GenerationTokenStatisticsMonitorMetricThreshold + ] = None, alert_enabled: bool = False, properties: Optional[Dict[str, str]] = None, sampling_rate: Optional[float] = None, @@ -1334,7 +1471,9 @@ def _to_rest_num_cat_metrics(numerical_metrics: Any, categorical_metrics: Any) - return metrics -def _to_rest_data_quality_metrics(numerical_metrics: Any, categorical_metrics: Any) -> List: +def _to_rest_data_quality_metrics( + numerical_metrics: Any, categorical_metrics: Any +) -> List: metric_thresholds: List = [] if numerical_metrics is not None: metric_thresholds = metric_thresholds + numerical_metrics._to_rest_object() diff --git a/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py b/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py index 3da4fa165915..803b8582ca8f 100644 --- a/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py +++ b/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py @@ -44,6 +44,8 @@ ) from test_utilities.utils import parse_local_path +from azure.core.serialization import as_attribute_dict + from .._utils import ( DATA_VERSION, PARAMETERS_TO_TEST, @@ -54,7 +56,9 @@ ) -@pytest.mark.usefixtures("enable_internal_components", "enable_pipeline_private_preview_features") +@pytest.mark.usefixtures( + "enable_internal_components", "enable_pipeline_private_preview_features" +) @pytest.mark.unittest @pytest.mark.pipeline_test class TestPipelineJob: @@ -103,14 +107,19 @@ def pipeline_func(): # check if node's runsettings are set correctly node_rest_dict = dsl_pipeline._to_rest_object().properties.jobs["node"] - del node_rest_dict["componentId"] # delete component spec to make it a pure dict + del node_rest_dict[ + "componentId" + ] # delete component spec to make it a pure dict mismatched_runsettings = {} for dot_key, expected_value in get_expected_runsettings_items(runsettings_dict): value = pydash.get(node_rest_dict, dot_key) if value != expected_value: mismatched_runsettings[dot_key] = (value, expected_value) - assert not mismatched_runsettings, "Current value:\n{}\nMismatched fields:\n{}".format( - json.dumps(node_rest_dict, indent=2), json.dumps(mismatched_runsettings, indent=2) + assert ( + not mismatched_runsettings + ), "Current value:\n{}\nMismatched fields:\n{}".format( + json.dumps(node_rest_dict, indent=2), + json.dumps(mismatched_runsettings, indent=2), ) pipeline_dict = dsl_pipeline._to_dict() @@ -121,7 +130,9 @@ def pipeline_func(): "yaml_path,inputs,runsettings_dict,pipeline_runsettings_dict", PARAMETERS_TO_TEST, ) - def test_data_as_node_inputs(self, yaml_path, inputs, runsettings_dict, pipeline_runsettings_dict): + def test_data_as_node_inputs( + self, yaml_path, inputs, runsettings_dict, pipeline_runsettings_dict + ): node_func: InternalComponent = load_component(yaml_path) input_data_names = {} @@ -131,7 +142,9 @@ def test_data_as_node_inputs(self, yaml_path, inputs, runsettings_dict, pipeline if "spark" in yaml_path: input_data_names[input_name] = input_obj else: - inputs[input_name] = Data(name=data_name, version=DATA_VERSION, type=AssetTypes.MLTABLE) + inputs[input_name] = Data( + name=data_name, version=DATA_VERSION, type=AssetTypes.MLTABLE + ) input_data_names[input_name] = data_name if len(input_data_names) == 0: return @@ -149,7 +162,11 @@ def pipeline_func(): node_rest_dict = dsl_pipeline._to_rest_object().properties.jobs["node"] for input_name, dataset_name in input_data_names.items(): if "spark" in yaml_path: - expected_rest_obj = {"job_input_type": AssetTypes.MLTABLE, "uri": dataset_name.path, "mode": "Direct"} + expected_rest_obj = { + "job_input_type": AssetTypes.MLTABLE, + "uri": dataset_name.path, + "mode": "Direct", + } else: expected_rest_obj = { "job_input_type": AssetTypes.MLTABLE, @@ -162,11 +179,14 @@ def pipeline_func(): [ "test:" + DATA_VERSION, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/" - "Microsoft.MachineLearningServices/workspaces/ws/datasets/test/versions/" + DATA_VERSION, + "Microsoft.MachineLearningServices/workspaces/ws/datasets/test/versions/" + + DATA_VERSION, ], ) def test_data_as_pipeline_inputs(self, input_path): - yaml_path = "./tests/test_configs/internal/distribution-component/component_spec.yaml" + yaml_path = ( + "./tests/test_configs/internal/distribution-component/component_spec.yaml" + ) node_func: InternalComponent = load_component(yaml_path) @pipeline() @@ -174,10 +194,14 @@ def pipeline_func(pipeline_input): node = node_func(input_path=pipeline_input) node.compute = "cpu-cluster" - dsl_pipeline: PipelineJob = pipeline_func(pipeline_input=Input(path=input_path, type=AssetTypes.MLTABLE)) + dsl_pipeline: PipelineJob = pipeline_func( + pipeline_input=Input(path=input_path, type=AssetTypes.MLTABLE) + ) if input_path.startswith("test:"): dsl_pipeline_with_data_input: PipelineJob = pipeline_func( - pipeline_input=Data(name="test", version=DATA_VERSION, type=AssetTypes.MLTABLE) + pipeline_input=Data( + name="test", version=DATA_VERSION, type=AssetTypes.MLTABLE + ) ) else: dsl_pipeline_with_data_input: PipelineJob = pipeline_func( @@ -197,13 +221,18 @@ def pipeline_func(pipeline_input): "job_input_type": AssetTypes.MLTABLE, "uri": input_path, } - assert pipeline_rest_dict.inputs["pipeline_input"].as_dict() == expected_rest_obj + assert ( + as_attribute_dict(pipeline_rest_dict.inputs["pipeline_input"]) + == expected_rest_obj + ) expected_rest_obj = { "job_input_type": "literal", "value": "${{parent.inputs.pipeline_input}}", } - assert pipeline_rest_dict.jobs["node"]["inputs"]["input_path"] == expected_rest_obj + assert ( + pipeline_rest_dict.jobs["node"]["inputs"]["input_path"] == expected_rest_obj + ) def test_internal_component_node_output_type(self): from azure.ai.ml._utils.utils import try_enable_internal_components @@ -220,7 +249,7 @@ def pipeline_func(): node.outputs.data_any_file.mode = "mount" pipeline_job = pipeline_func() - rest_pipeline_job_dict = pipeline_job._to_rest_object().as_dict() + rest_pipeline_job_dict = as_attribute_dict(pipeline_job._to_rest_object()) assert rest_pipeline_job_dict["properties"]["jobs"]["node"]["outputs"] == { "data_any_file": {"mode": "ReadWriteMount", "job_output_type": "uri_file"} } @@ -256,7 +285,9 @@ def pipeline_func(): assert dsl_pipeline._validate().passed dsl_pipeline._to_rest_object() pipeline_component = dsl_pipeline.jobs["sub_pipeline_func"].component - assert pipeline_component._to_rest_object().properties.component_spec["outputs"] == { + assert pipeline_component._to_rest_object().properties.component_spec[ + "outputs" + ] == { "data_any_directory": {"type": "uri_folder"}, "data_any_file": {"type": "uri_file"}, # AnyFile => uri_file "data_azureml_dataset": {"type": "uri_folder"}, @@ -293,7 +324,9 @@ def test_gjd_internal_component_in_pipeline(self): ts = TargetSelector( compute_type="AMLK8s", # runsettings.target_selector.compute_type - instance_types=["STANDARD_D2_V2"], # runsettings.target_selector.instance_types + instance_types=[ + "STANDARD_D2_V2" + ], # runsettings.target_selector.instance_types regions=["eastus2euap"], # runsettings.target_selector.regions my_resource_only=True, # runsettings.target_selector.my_resource_only allow_spot_vm=True, # runsettings.target_selector.allow_spot_vm @@ -397,7 +430,9 @@ def test_singularity_component_in_pipeline(self): user_alias="user_alias", ) # what if key is not in lower case? - node.resources.properties[JobComputePropertyFields.SINGULARITY.lower()] = configuration + node.resources.properties[JobComputePropertyFields.SINGULARITY.lower()] = ( + configuration + ) properties_rest_dict = node._to_rest_object()["resources"]["properties"] assert properties_rest_dict == { JobComputePropertyFields.AISUPERCOMPUTER: { @@ -429,18 +464,26 @@ def test_singularity_component_in_pipeline(self): } def test_load_pipeline_job_with_internal_components_as_node(self): - yaml_path = Path("./tests/test_configs/internal/helloworld/helloworld_component_scope.yml") + yaml_path = Path( + "./tests/test_configs/internal/helloworld/helloworld_component_scope.yml" + ) scope_internal_func = load_component(source=yaml_path) with open(yaml_path, encoding="utf-8") as yaml_file: yaml_dict = yaml.safe_load(yaml_file) - yaml_dict["code"] = parse_local_path(yaml_dict["code"], scope_internal_func.base_path) + yaml_dict["code"] = parse_local_path( + yaml_dict["code"], scope_internal_func.base_path + ) - command_func = load_component("./tests/test_configs/components/helloworld_component.yml") + command_func = load_component( + "./tests/test_configs/components/helloworld_component.yml" + ) @pipeline() def pipeline_func(): - node = command_func(component_in_path=Input(path="./tests/test_configs/data")) + node = command_func( + component_in_path=Input(path="./tests/test_configs/data") + ) node.compute = "cpu-cluster" node_internal: Scope = scope_internal_func( @@ -482,7 +525,10 @@ def pipeline_func(): "custom_job_name_suffix": "component_sdk_test", "scope_param": "-tokens 50", "inputs": { - "ExtractionClause": {"job_input_type": "literal", "value": "column1:string, column2:int"}, + "ExtractionClause": { + "job_input_type": "literal", + "value": "column1:string, column2:int", + }, "TextData": {"job_input_type": "mltable", "uri": "azureml:scope_tsv:1"}, }, "type": "ScopeComponent", @@ -494,7 +540,10 @@ def pipeline_func(): assert pydash.omit(dsl_pipeline._to_dict(), *omit_fields) == pydash.omit( { "display_name": "pipeline_func", - "jobs": {"node": dsl_pipeline.jobs["node"]._to_dict(), "node_internal": scope_node._to_dict()}, + "jobs": { + "node": dsl_pipeline.jobs["node"]._to_dict(), + "node_internal": scope_node._to_dict(), + }, "type": "pipeline", }, *omit_fields, @@ -509,12 +558,18 @@ def pipeline_func(): } def test_components_in_registry(self): - command_func = load_component("./tests/test_configs/components/helloworld_component.yml") - registry_code_id = "azureml://feeds/testFeed/codes/hello_component/versions/0.0.1" + command_func = load_component( + "./tests/test_configs/components/helloworld_component.yml" + ) + registry_code_id = ( + "azureml://feeds/testFeed/codes/hello_component/versions/0.0.1" + ) @pipeline() def pipeline_func(): - node = command_func(component_in_path=Input(path="./tests/test_configs/data")) + node = command_func( + component_in_path=Input(path="./tests/test_configs/data") + ) # can't create a component from azureml-components in ci workspace # so just use a local test @@ -523,7 +578,9 @@ def pipeline_func(): dsl_pipeline: PipelineJob = pipeline_func() assert dsl_pipeline._validate().passed - regenerated_pipeline_job = PipelineJob._from_rest_object(dsl_pipeline._to_rest_object()) + regenerated_pipeline_job = PipelineJob._from_rest_object( + dsl_pipeline._to_rest_object() + ) assert dsl_pipeline._to_dict() == regenerated_pipeline_job._to_dict() def test_components_input_output(self): @@ -580,16 +637,22 @@ def pipeline_func(): } for key in inputs: if key.startswith("data_"): - expected_inputs[key] = {"job_input_type": "mltable", "uri": "azureml:scope_tsv:1"} + expected_inputs[key] = { + "job_input_type": "mltable", + "uri": "azureml:scope_tsv:1", + } assert rest_obj.properties.jobs["node"]["inputs"] == expected_inputs def test_data_binding_on_node_runsettings(self): - test_path = "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" + test_path = ( + "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" + ) component: InternalComponent = load_component(test_path) @pipeline() def pipeline_func( - compute_name: str = "cpu-cluster", environment_name: str = "AzureML-ACPT-pytorch-1.12-py39-cuda11.6-gpu:8" + compute_name: str = "cpu-cluster", + environment_name: str = "AzureML-ACPT-pytorch-1.12-py39-cuda11.6-gpu:8", ): node = component( training_data=Input(path="./tests/test_configs/data"), @@ -605,7 +668,12 @@ def pipeline_func( assert str(rest_object["environment"]) == "${{parent.inputs.environment_name}}" def test_pipeline_with_setting_node_output_directly(self) -> None: - component_dir = Path(__file__).parent.parent.parent / "test_configs" / "internal" / "command-component" + component_dir = ( + Path(__file__).parent.parent.parent + / "test_configs" + / "internal" + / "command-component" + ) copy_func = load_component(component_dir / "command-linux/copy/component.yaml") copy_file = copy_func( @@ -623,7 +691,9 @@ def test_job_properties(self): ) pipeline_dict = pipeline_job._to_dict() rest_pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] - assert pipeline_dict["properties"] == {"AZURE_ML_PathOnCompute_input_data": "/tmp/test"} + assert pipeline_dict["properties"] == { + "AZURE_ML_PathOnCompute_input_data": "/tmp/test" + } assert rest_pipeline_dict["properties"] == pipeline_dict["properties"] for name, node_dict in pipeline_dict["jobs"].items(): rest_node_dict = rest_pipeline_dict["jobs"][name] @@ -637,7 +707,9 @@ def test_job_properties(self): pytest.param( "./tests/test_configs/internal/command-component-ls/ls_command_component.yaml", { - "resources.instance_count": JobResourceConfiguration(instance_count=1), + "resources.instance_count": JobResourceConfiguration( + instance_count=1 + ), "limits.timeout": CommandJobLimits(timeout=100), }, {}, @@ -646,30 +718,49 @@ def test_job_properties(self): pytest.param( "./tests/test_configs/internal/batch_inference/batch_score.yaml", { - "resources.instance_count": JobResourceConfiguration(instance_count=1), + "resources.instance_count": JobResourceConfiguration( + instance_count=1 + ), "limits.timeout": CommandJobLimits(timeout=100), }, { - "model_path": Input(type=AssetTypes.MLTABLE, path="mltable_mnist_model@latest"), - "images_to_score": Input(type=AssetTypes.MLTABLE, path="mltable_mnist@latest"), + "model_path": Input( + type=AssetTypes.MLTABLE, path="mltable_mnist_model@latest" + ), + "images_to_score": Input( + type=AssetTypes.MLTABLE, path="mltable_mnist@latest" + ), }, id="parallel.resources", ), pytest.param( "tests/test_configs/internal/spark-component/spec.yaml", { - "resources.runtime_version": SparkResourceConfiguration(runtime_version="2.4"), + "resources.runtime_version": SparkResourceConfiguration( + runtime_version="2.4" + ), }, { - "file_input1": Input(type=AssetTypes.MLTABLE, path="mltable_mnist@latest", mode="direct"), - "file_input2": Input(type=AssetTypes.MLTABLE, path="mltable_mnist@latest", mode="direct"), + "file_input1": Input( + type=AssetTypes.MLTABLE, + path="mltable_mnist@latest", + mode="direct", + ), + "file_input2": Input( + type=AssetTypes.MLTABLE, + path="mltable_mnist@latest", + mode="direct", + ), }, id="spark", ), ], ) def test_data_binding_expression_on_node_runsettings( - self, component_path: str, fields_to_test: Dict[str, Any], fake_inputs: Dict[str, Input] + self, + component_path: str, + fields_to_test: Dict[str, Any], + fake_inputs: Dict[str, Input], ): component = load_component(component_path) @@ -699,7 +790,9 @@ def pipeline_func(param: str = "2"): pipeline_job.component._get_anonymous_hash() def test_node_output_type_promotion(self): - test_path = "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" + test_path = ( + "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" + ) component: InternalComponent = load_component(test_path) @pipeline() @@ -712,7 +805,7 @@ def pipeline_func(): return node.outputs pipeline_job = pipeline_func() - pipeline_dict = pipeline_job._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(pipeline_job._to_rest_object()) # type will be preserved & mode will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["model_output"] == { "job_output_type": "uri_folder", From 020cb979d8fff18543a1300a44e1de3da6e31ea6 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 20:02:33 +0530 Subject: [PATCH 020/146] migrate(sweep): early_termination_policy to arm_ml_service Flip Bandit/Median/Truncation early-termination policies off v2023_04_01_preview onto arm_ml_service (identical fields). The DSL sweep builder uses as_attribute_dict for the snake_case early_termination node dict (the arm hybrid as_dict emits camelCase, which the round-trip reader and schema don't expect). Validated: sweep wire smoke + sweep UTs + full dsl (372 passed, 2 skipped). --- .../azure/ai/ml/entities/_builders/sweep.py | 120 ++++++++++++++---- .../_job/sweep/early_termination_policy.py | 51 ++++++-- 2 files changed, 135 insertions(+), 36 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py index 67b620ee6f9c..5deb18d6dddc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py @@ -21,7 +21,9 @@ ) from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job.job_limits import SweepJobLimits -from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration +from azure.ai.ml.entities._job.job_resource_configuration import ( + JobResourceConfiguration, +) from azure.ai.ml.entities._job.pipeline._io import NodeInput from azure.ai.ml.entities._job.queue_settings import QueueSettings from azure.ai.ml.entities._job.sweep.early_termination_policy import ( @@ -46,12 +48,20 @@ SweepDistribution, Uniform, ) -from azure.ai.ml.exceptions import ErrorTarget, UserErrorException, ValidationErrorType, ValidationException +from azure.ai.ml.exceptions import ( + ErrorTarget, + UserErrorException, + ValidationErrorType, + ValidationException, +) from azure.ai.ml.sweep import SweepJob +from azure.core.serialization import as_attribute_dict from ..._restclient.arm_ml_service.models import ComponentVersion from ..._schema import PathAwareSchema -from ..._schema._utils.data_binding_expression import support_data_binding_expression_for_fields +from ..._schema._utils.data_binding_expression import ( + support_data_binding_expression_for_fields, +) from ..._utils.utils import camel_to_snake from .base_node import BaseNode @@ -138,20 +148,40 @@ def __init__( sampling_algorithm: Optional[Union[str, SamplingAlgorithm]] = None, objective: Optional[Objective] = None, early_termination: Optional[ - Union[BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy, EarlyTerminationPolicy, str] + Union[ + BanditPolicy, + MedianStoppingPolicy, + TruncationSelectionPolicy, + EarlyTerminationPolicy, + str, + ] ] = None, search_space: Optional[ Dict[ str, Union[ - Choice, LogNormal, LogUniform, Normal, QLogNormal, QLogUniform, QNormal, QUniform, Randint, Uniform + Choice, + LogNormal, + LogUniform, + Normal, + QLogNormal, + QLogUniform, + QNormal, + QUniform, + Randint, + Uniform, ], ] ] = None, inputs: Optional[Dict[str, Union[Input, str, bool, int, float]]] = None, outputs: Optional[Dict[str, Union[str, Output]]] = None, identity: Optional[ - Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] + Union[ + Dict, + ManagedIdentityConfiguration, + AmlTokenConfiguration, + UserIdentityConfiguration, + ] ] = None, queue_settings: Optional[QueueSettings] = None, resources: Optional[Union[dict, JobResourceConfiguration]] = None, @@ -201,7 +231,18 @@ def search_space( ) -> Optional[ Dict[ str, - Union[Choice, LogNormal, LogUniform, Normal, QLogNormal, QLogUniform, QNormal, QUniform, Randint, Uniform], + Union[ + Choice, + LogNormal, + LogUniform, + Normal, + QLogNormal, + QLogUniform, + QNormal, + QUniform, + Randint, + Uniform, + ], ] ]: """Dictionary of the hyperparameter search space. @@ -216,7 +257,9 @@ def search_space( return self._search_space @search_space.setter - def search_space(self, values: Optional[Dict[str, Dict[str, Union[str, int, float, dict]]]]) -> None: + def search_space( + self, values: Optional[Dict[str, Dict[str, Union[str, int, float, dict]]]] + ) -> None: """Sets the search space for the sweep job. :param values: The search space to set. @@ -228,7 +271,11 @@ def search_space(self, values: Optional[Dict[str, Dict[str, Union[str, int, floa search_space: Dict = {} for name, value in values.items(): # If value is a SearchSpace object, directly pass it to job.search_space[name] - search_space[name] = self._value_type_to_class(value) if isinstance(value, dict) else value + search_space[name] = ( + self._value_type_to_class(value) + if isinstance(value, dict) + else value + ) self._search_space = search_space @classmethod @@ -259,7 +306,9 @@ def _get_supported_inputs_types(cls) -> Tuple: ) @classmethod - def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Sweep": + def _load_from_dict( + cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any + ) -> "Sweep": raise NotImplementedError("Sweep._load_from_dict is not supported") @classmethod @@ -285,7 +334,12 @@ def _to_rest_object(self, **kwargs: Any) -> dict: # the change if "early_termination" in rest_obj: _early_termination: EarlyTerminationPolicy = self.early_termination # type: ignore - rest_obj["early_termination"] = _early_termination._to_rest_object().as_dict() + # ``as_attribute_dict`` yields the snake_case field view (``policy_type``/``delay_evaluation``) + # that the round-trip reader and schema expect; the arm_ml_service hybrid ``as_dict`` would emit + # camelCase and break the node dict. + rest_obj["early_termination"] = as_attribute_dict( + _early_termination._to_rest_object() + ) rest_obj.update( { @@ -303,13 +357,19 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: # the change if "early_termination" in obj and "policy_type" in obj["early_termination"]: # can't use _from_rest_object here, because obj is a dict instead of an EarlyTerminationPolicy rest object - obj["early_termination"]["type"] = camel_to_snake(obj["early_termination"].pop("policy_type")) + obj["early_termination"]["type"] = camel_to_snake( + obj["early_termination"].pop("policy_type") + ) # TODO: use cls._get_schema() to load from rest object - from azure.ai.ml._schema._sweep.parameterized_sweep import ParameterizedSweepSchema + from azure.ai.ml._schema._sweep.parameterized_sweep import ( + ParameterizedSweepSchema, + ) schema = ParameterizedSweepSchema(context={BASE_PATH_CONTEXT_KEY: "./"}) - support_data_binding_expression_for_fields(schema, ["type", "component", "trial"]) + support_data_binding_expression_for_fields( + schema, ["type", "component", "trial"] + ) base_sweep = schema.load(obj, unknown=EXCLUDE, partial=True) for key, value in base_sweep.items(): @@ -330,7 +390,9 @@ def _get_trial_component_rest_obj(self) -> Union[Dict, ComponentVersion, None]: return {"componentId": trial_component_id} if isinstance(trial_component_id, CommandComponent): return trial_component_id._to_rest_object() - raise UserErrorException(f"invalid trial in sweep node {self.name}: {str(self.trial)}") + raise UserErrorException( + f"invalid trial in sweep node {self.name}: {str(self.trial)}" + ) def _to_job(self) -> SweepJob: command = self.trial.command @@ -338,7 +400,9 @@ def _to_job(self) -> SweepJob: for key, _ in self.search_space.items(): if command is not None: # Double curly brackets to escape - command = command.replace(f"${{{{inputs.{key}}}}}", f"${{{{search_space.{key}}}}}") + command = command.replace( + f"${{{{inputs.{key}}}}}", f"${{{{search_space.{key}}}}}" + ) # TODO: raise exception when the trial is a pre-registered component if command != self.trial.command and isinstance(self.trial, CommandComponent): @@ -380,13 +444,17 @@ def _build_inputs(self) -> Dict: return built_inputs @classmethod - def _create_schema_for_validation(cls, context: Any) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context: Any + ) -> Union[PathAwareSchema, Schema]: from azure.ai.ml._schema.pipeline.component_job import SweepSchema return SweepSchema(context=context) @classmethod - def _get_origin_inputs_and_search_space(cls, built_inputs: Optional[Dict[str, NodeInput]]) -> Tuple: + def _get_origin_inputs_and_search_space( + cls, built_inputs: Optional[Dict[str, NodeInput]] + ) -> Tuple: """Separate mixed true inputs & search space definition from inputs of this node and return them. @@ -413,7 +481,9 @@ def _get_origin_inputs_and_search_space(cls, built_inputs: Optional[Dict[str, No msg = "unsupported built input type: {}: {}" raise ValidationException( message=msg.format(input_name, type(input_obj)), - no_personal_data_message=msg.format("[input_name]", type(input_obj)), + no_personal_data_message=msg.format( + "[input_name]", type(input_obj) + ), target=ErrorTarget.SWEEP_JOB, error_type=ValidationErrorType.INVALID_VALUE, ) @@ -426,7 +496,9 @@ def _is_input_set(self, input_name: str) -> bool: def __setattr__(self, key: Any, value: Any) -> None: super(Sweep, self).__setattr__(key, value) - if key == "early_termination" and isinstance(self.early_termination, BanditPolicy): + if key == "early_termination" and isinstance( + self.early_termination, BanditPolicy + ): # only one of slack_amount and slack_factor can be specified but default value is 0.0. # Need to keep track of which one is null. if self.early_termination.slack_amount == 0.0: @@ -444,7 +516,9 @@ def early_termination(self) -> Optional[Union[str, EarlyTerminationPolicy]]: return self._early_termination @early_termination.setter - def early_termination(self, value: Optional[Union[str, EarlyTerminationPolicy]]) -> None: + def early_termination( + self, value: Optional[Union[str, EarlyTerminationPolicy]] + ) -> None: """Sets the early termination policy for the sweep job. :param value: The early termination policy for the sweep job. @@ -453,5 +527,7 @@ def early_termination(self, value: Optional[Union[str, EarlyTerminationPolicy]]) """ if isinstance(value, dict): early_termination_schema = EarlyTerminationField() - value = early_termination_schema._deserialize(value=value, attr=None, data=None) + value = early_termination_schema._deserialize( + value=value, attr=None, data=None + ) self._early_termination = value # type: ignore[assignment] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py index b1b928fcc4a4..8e933453680b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py @@ -4,11 +4,17 @@ from abc import ABC from typing import Any, Optional, cast -from azure.ai.ml._restclient.v2023_04_01_preview.models import BanditPolicy as RestBanditPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicy as RestEarlyTerminationPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import EarlyTerminationPolicyType -from azure.ai.ml._restclient.v2023_04_01_preview.models import MedianStoppingPolicy as RestMedianStoppingPolicy -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( + BanditPolicy as RestBanditPolicy, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + EarlyTerminationPolicy as RestEarlyTerminationPolicy, +) +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicyType +from azure.ai.ml._restclient.arm_ml_service.models import ( + MedianStoppingPolicy as RestMedianStoppingPolicy, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( TruncationSelectionPolicy as RestTruncationSelectionPolicy, ) from azure.ai.ml._utils.utils import camel_to_snake @@ -27,19 +33,27 @@ def __init__( self.evaluation_interval = evaluation_interval @classmethod - def _from_rest_object(cls, obj: RestEarlyTerminationPolicy) -> Optional["EarlyTerminationPolicy"]: + def _from_rest_object( + cls, obj: RestEarlyTerminationPolicy + ) -> Optional["EarlyTerminationPolicy"]: if not obj: return None policy: Any = None if obj.policy_type == EarlyTerminationPolicyType.BANDIT: - policy = BanditPolicy._from_rest_object(obj) # pylint: disable=protected-access + policy = BanditPolicy._from_rest_object( + obj + ) # pylint: disable=protected-access if obj.policy_type == EarlyTerminationPolicyType.MEDIAN_STOPPING: - policy = MedianStoppingPolicy._from_rest_object(obj) # pylint: disable=protected-access + policy = MedianStoppingPolicy._from_rest_object( + obj + ) # pylint: disable=protected-access if obj.policy_type == EarlyTerminationPolicyType.TRUNCATION_SELECTION: - policy = TruncationSelectionPolicy._from_rest_object(obj) # pylint: disable=protected-access + policy = TruncationSelectionPolicy._from_rest_object( + obj + ) # pylint: disable=protected-access return cast(Optional["EarlyTerminationPolicy"], policy) @@ -80,7 +94,9 @@ def __init__( slack_amount: float = 0, slack_factor: float = 0, ) -> None: - super().__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval) + super().__init__( + delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval + ) self.type = EarlyTerminationPolicyType.BANDIT.lower() self.slack_factor = slack_factor self.slack_amount = slack_amount @@ -127,12 +143,15 @@ def __init__( delay_evaluation: int = 0, evaluation_interval: int = 1, ) -> None: - super().__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval) + super().__init__( + delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval + ) self.type = camel_to_snake(EarlyTerminationPolicyType.MEDIAN_STOPPING) def _to_rest_object(self) -> RestMedianStoppingPolicy: return RestMedianStoppingPolicy( - delay_evaluation=self.delay_evaluation, evaluation_interval=self.evaluation_interval + delay_evaluation=self.delay_evaluation, + evaluation_interval=self.evaluation_interval, ) @classmethod @@ -171,7 +190,9 @@ def __init__( evaluation_interval: int = 0, truncation_percentage: int = 0, ) -> None: - super().__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval) + super().__init__( + delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval + ) self.type = camel_to_snake(EarlyTerminationPolicyType.TRUNCATION_SELECTION) self.truncation_percentage = truncation_percentage @@ -183,7 +204,9 @@ def _to_rest_object(self) -> RestTruncationSelectionPolicy: ) @classmethod - def _from_rest_object(cls, obj: RestTruncationSelectionPolicy) -> "TruncationSelectionPolicy": + def _from_rest_object( + cls, obj: RestTruncationSelectionPolicy + ) -> "TruncationSelectionPolicy": return cls( delay_evaluation=obj.delay_evaluation, evaluation_interval=obj.evaluation_interval, From 2d9387d35e43a7e195400a7a5bf312206406048a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 20:25:31 +0530 Subject: [PATCH 021/146] migrate(spark): spark_job_entry + spark_resource_configuration to arm_ml_service Flip SparkJobEntry (Python/Scala) and SparkResourceConfiguration off v2023_04_01_preview onto arm_ml_service (identical fields). The SparkJobEntry read path now handles the snake_case node-serializer dict directly (spark_job_entry_type/file/class_name) instead of round-tripping through the arm hybrid _deserialize (which expects camelCase wire keys). Validated: spark wire smoke + spark UTs + full dsl + pipeline_job (524 passed, 3 skipped). --- .../ai/ml/entities/_job/spark_job_entry.py | 38 +++++++++++++++---- .../_job/spark_resource_configuration.py | 26 ++++++++++--- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py index ed8d3ca797a7..a94f6f21b664 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py @@ -5,8 +5,10 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobEntry as RestSparkJobEntry -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobPythonEntry, SparkJobScalaEntry +from azure.ai.ml._restclient.arm_ml_service.models import ( + SparkJobPythonEntry, + SparkJobScalaEntry, +) from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -36,22 +38,44 @@ class SparkJobEntry(RestTranslatableMixin): :caption: Creating SparkComponent. """ - def __init__(self, *, entry: str, type: str = SparkJobEntryType.SPARK_JOB_FILE_ENTRY) -> None: + def __init__( + self, *, entry: str, type: str = SparkJobEntryType.SPARK_JOB_FILE_ENTRY + ) -> None: self.entry_type = type self.entry = entry @classmethod - def _from_rest_object(cls, obj: Union[SparkJobPythonEntry, SparkJobScalaEntry]) -> Optional["SparkJobEntry"]: + def _from_rest_object( + cls, obj: Union[SparkJobPythonEntry, SparkJobScalaEntry] + ) -> Optional["SparkJobEntry"]: if obj is None: return None if isinstance(obj, dict): - obj = RestSparkJobEntry.from_dict(obj) + # The node serializer emits a snake_case dict (``spark_job_entry_type``/``file``/``class_name``); + # read the discriminator and payload directly rather than round-tripping through the arm hybrid + # (whose ``_deserialize`` expects the camelCase wire keys). + entry_type = obj.get("spark_job_entry_type") or obj.get("sparkJobEntryType") + if entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: + return SparkJobEntry( + entry=obj.get("file", None), + type=SparkJobEntryType.SPARK_JOB_FILE_ENTRY, + ) + return SparkJobEntry( + entry=obj.get("class_name", None), + type=SparkJobEntryType.SPARK_JOB_CLASS_ENTRY, + ) if obj.spark_job_entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: return SparkJobEntry( - entry=obj.__dict__.get("file", None), + entry=( + obj.get("file", None) + if hasattr(obj, "get") + else obj.__dict__.get("file", None) + ), type=SparkJobEntryType.SPARK_JOB_FILE_ENTRY, ) - return SparkJobEntry(entry=obj.class_name, type=SparkJobEntryType.SPARK_JOB_CLASS_ENTRY) + return SparkJobEntry( + entry=obj.class_name, type=SparkJobEntryType.SPARK_JOB_CLASS_ENTRY + ) def _to_rest_object(self) -> Union[SparkJobPythonEntry, SparkJobScalaEntry]: if self.entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py index 138fc7ed7f16..b5a1a1c5a9aa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py @@ -4,7 +4,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( SparkResourceConfiguration as RestSparkResourceConfiguration, ) from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin @@ -37,12 +37,19 @@ class SparkResourceConfiguration(RestTranslatableMixin, DictMixin): "standard_e64s_v3", ] - def __init__(self, *, instance_type: Optional[str] = None, runtime_version: Optional[str] = None) -> None: + def __init__( + self, + *, + instance_type: Optional[str] = None, + runtime_version: Optional[str] = None + ) -> None: self.instance_type = instance_type self.runtime_version = runtime_version def _to_rest_object(self) -> RestSparkResourceConfiguration: - return RestSparkResourceConfiguration(instance_type=self.instance_type, runtime_version=self.runtime_version) + return RestSparkResourceConfiguration( + instance_type=self.instance_type, runtime_version=self.runtime_version + ) @classmethod def _from_rest_object( @@ -52,7 +59,9 @@ def _from_rest_object( return None if isinstance(obj, dict): return SparkResourceConfiguration(**obj) - return SparkResourceConfiguration(instance_type=obj.instance_type, runtime_version=obj.runtime_version) + return SparkResourceConfiguration( + instance_type=obj.instance_type, runtime_version=obj.runtime_version + ) def _validate(self) -> None: # TODO: below logic is duplicated to SparkResourceConfigurationSchema, maybe make SparkJob schema validatable @@ -65,7 +74,9 @@ def _validate(self) -> None: error_category=ErrorCategory.USER_ERROR, ) if self.instance_type.lower() not in self.instance_type_list: - msg = "Instance type must be specified for the list of {}".format(",".join(self.instance_type_list)) + msg = "Instance type must be specified for the list of {}".format( + ",".join(self.instance_type_list) + ) raise ValidationException( message=msg, no_personal_data_message=msg, @@ -76,7 +87,10 @@ def _validate(self) -> None: def __eq__(self, other: object) -> bool: if not isinstance(other, SparkResourceConfiguration): return NotImplemented - return self.instance_type == other.instance_type and self.runtime_version == other.runtime_version + return ( + self.instance_type == other.instance_type + and self.runtime_version == other.runtime_version + ) def __ne__(self, other: object) -> bool: if not isinstance(other, SparkResourceConfiguration): From 804ece3fb4aa99f80ffa32341fbf200e87ab85cc Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 20:50:20 +0530 Subject: [PATCH 022/146] migrate(jobs): queue_settings to arm_ml_service Flip QueueSettings off v2023_04_01_preview onto arm_ml_service. The shared arm model dropped `priority` from its constructor; the legacy msrest model carried it as an int on the wire, so preserve it as an unknown wire key in _to_rest_object and read it via mapping access (dual-compat with msrest) in _from_rest_object. Read path uses arm _deserialize instead of msrest from_dict. Validated: full smoke_serialization + command/sweep/finetuning UTs + dsl + pipeline_job (776 passed, 2 skipped). --- .../ai/ml/entities/_job/queue_settings.py | 59 +++++++++++++++---- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py index 45210b2d7298..c9c248a8da7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py @@ -5,12 +5,17 @@ import logging from typing import Any, Dict, Optional, Union -from ..._restclient.v2023_04_01_preview.models import QueueSettings as RestQueueSettings +from ..._restclient.arm_ml_service.models import QueueSettings as RestQueueSettings from ..._utils._experimental import experimental from ..._utils.utils import is_data_binding_expression from ...constants._job.job import JobPriorityValues, JobTierNames from ...entities._mixins import DictMixin, RestTranslatableMixin -from ...exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException +from ...exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationErrorType, + ValidationException, +) module_logger = logging.getLogger(__name__) @@ -43,23 +48,57 @@ def __init__( def _to_rest_object(self) -> RestQueueSettings: self._validate() - job_tier = JobTierNames.ENTITY_TO_REST.get(self.job_tier.lower(), None) if self.job_tier else None - priority = JobPriorityValues.ENTITY_TO_REST.get(self.priority.lower(), None) if self.priority else None - return RestQueueSettings(job_tier=job_tier, priority=priority) + job_tier = ( + JobTierNames.ENTITY_TO_REST.get(self.job_tier.lower(), None) + if self.job_tier + else None + ) + priority = ( + JobPriorityValues.ENTITY_TO_REST.get(self.priority.lower(), None) + if self.priority + else None + ) + rest_obj = RestQueueSettings(job_tier=job_tier) + # The shared arm_ml_service QueueSettings model dropped ``priority`` from its constructor; the legacy + # msrest model carried it (as an int) on the wire, so preserve it as an unknown wire key. + if priority is not None: + rest_obj["priority"] = priority + return rest_obj @classmethod - def _from_rest_object(cls, obj: Union[Dict[str, Any], RestQueueSettings, None]) -> Optional["QueueSettings"]: + def _from_rest_object( + cls, obj: Union[Dict[str, Any], RestQueueSettings, None] + ) -> Optional["QueueSettings"]: if obj is None: return None if isinstance(obj, dict): - queue_settings = RestQueueSettings.from_dict(obj) + queue_settings = RestQueueSettings._deserialize( + obj, [] + ) # pylint: disable=protected-access return cls._from_rest_object(queue_settings) - job_tier = JobTierNames.REST_TO_ENTITY.get(obj.job_tier, None) if obj.job_tier else None - priority = JobPriorityValues.REST_TO_ENTITY.get(obj.priority, None) if hasattr(obj, "priority") else None + job_tier = ( + JobTierNames.REST_TO_ENTITY.get(obj.job_tier, None) + if obj.job_tier + else None + ) + # ``priority`` is an unknown wire key on the arm hybrid (a MutableMapping); read it via mapping + # access when present, else fall back to attribute access for legacy msrest objects. + if getattr(obj, "_is_model", False) is True: + rest_priority = obj.get("priority") + else: + rest_priority = obj.priority if hasattr(obj, "priority") else None + priority = ( + JobPriorityValues.REST_TO_ENTITY.get(rest_priority, None) + if rest_priority + else None + ) return cls(job_tier=job_tier, priority=priority) def _validate(self) -> None: - for key, enum_class in [("job_tier", JobTierNames), ("priority", JobPriorityValues)]: + for key, enum_class in [ + ("job_tier", JobTierNames), + ("priority", JobPriorityValues), + ]: value = getattr(self, key) if is_data_binding_expression(value): msg = ( From f51c536f533d0065ce2633099264345f06ab15ee Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 21:45:00 +0530 Subject: [PATCH 023/146] Migrate distribution configs (Mpi/PyTorch/TensorFlow) to arm_ml_service Flip DistributionConfiguration, Mpi, PyTorch, TensorFlow imports in entities/_job/distribution.py to the shared arm_ml_service hybrid client. Ray and DistributionType stay on v2023_04 (arm has no Ray subtype and its DistributionType enum lacks Ray). Read path already normalizes keys to snake via camel_to_snake, so it is arm-safe. Fix test-side casing in test_pipeline_job_schema.py: the distribution assertion used .as_dict() (now camelCase for arm) against the snake-case node dict; swap to as_attribute_dict(...) which yields snake matching the prior msrest output. Wire bytes verified identical; smoke suite 146/146; pipeline/dsl/smoke 636 passed. --- .../azure/ai/ml/entities/_job/distribution.py | 34 +- .../unittests/test_pipeline_job_schema.py | 592 +++++++++++++----- 2 files changed, 477 insertions(+), 149 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py index 3289f4439a77..245cb014e18d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py @@ -6,14 +6,19 @@ from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( DistributionConfiguration as RestDistributionConfiguration, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import DistributionType as RestDistributionType -from azure.ai.ml._restclient.v2023_04_01_preview.models import Mpi as RestMpi -from azure.ai.ml._restclient.v2023_04_01_preview.models import PyTorch as RestPyTorch +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + DistributionType as RestDistributionType, +) +from azure.ai.ml._restclient.arm_ml_service.models import Mpi as RestMpi +from azure.ai.ml._restclient.arm_ml_service.models import PyTorch as RestPyTorch + +# ``Ray`` distribution is not modeled on the shared arm_ml_service client yet, so keep the legacy msrest +# model for that subtype; the ``to_hybrid_rest_model`` boundary converts it when embedded in an arm envelope. from azure.ai.ml._restclient.v2023_04_01_preview.models import Ray as RestRay -from azure.ai.ml._restclient.v2023_04_01_preview.models import TensorFlow as RestTensorFlow +from azure.ai.ml._restclient.arm_ml_service.models import TensorFlow as RestTensorFlow from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.constants import DistributionType @@ -102,7 +107,9 @@ class MpiDistribution(DistributionConfiguration): :caption: Configuring a CommandComponent with an MpiDistribution. """ - def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any) -> None: + def __init__( + self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any + ) -> None: super().__init__(**kwargs) self.type = DistributionType.MPI self.process_count_per_instance = process_count_per_instance @@ -129,7 +136,9 @@ class PyTorchDistribution(DistributionConfiguration): :caption: Configuring a CommandComponent with a PyTorchDistribution. """ - def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any) -> None: + def __init__( + self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any + ) -> None: super().__init__(**kwargs) self.type = DistributionType.PYTORCH self.process_count_per_instance = process_count_per_instance @@ -164,7 +173,11 @@ class TensorFlowDistribution(DistributionConfiguration): """ def __init__( - self, *, parameter_server_count: Optional[int] = 0, worker_count: Optional[int] = None, **kwargs: Any + self, + *, + parameter_server_count: Optional[int] = 0, + worker_count: Optional[int] = None, + **kwargs: Any ) -> None: super().__init__(**kwargs) self.type = DistributionType.TENSORFLOW @@ -172,7 +185,10 @@ def __init__( self.worker_count = worker_count def _to_rest_object(self) -> RestTensorFlow: - return RestTensorFlow(parameter_server_count=self.parameter_server_count, worker_count=self.worker_count) + return RestTensorFlow( + parameter_server_count=self.parameter_server_count, + worker_count=self.worker_count, + ) @experimental diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py index 4e924a4e99ef..c59fac1800b0 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py @@ -12,19 +12,35 @@ from pytest_mock import MockFixture from azure.ai.ml import MLClient, load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + JobOutput as RestJobOutput, +) +from azure.core.serialization import as_attribute_dict from azure.ai.ml._restclient.v2023_04_01_preview.models import MLTableJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import PipelineJob as RestPipelineJob +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + PipelineJob as RestPipelineJob, +) from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFolderJobInput from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( LearningRateScheduler, StochasticOptimizer, ) -from azure.ai.ml._utils.utils import camel_to_snake, dump_yaml_to_file, is_data_binding_expression, load_yaml +from azure.ai.ml._utils.utils import ( + camel_to_snake, + dump_yaml_to_file, + is_data_binding_expression, + load_yaml, +) from azure.ai.ml.constants._common import ARM_ID_PREFIX, AssetTypes, InputOutputModes from azure.ai.ml.constants._component import ComponentJobConstants from azure.ai.ml.constants._job.pipeline import PipelineConstants -from azure.ai.ml.entities import CommandComponent, Component, Job, PipelineJob, SparkComponent +from azure.ai.ml.entities import ( + CommandComponent, + Component, + Job, + PipelineJob, + SparkComponent, +) from azure.ai.ml.entities._assets import Code from azure.ai.ml.entities._component.datatransfer_component import DataTransferComponent from azure.ai.ml.entities._component.parallel_component import ParallelComponent @@ -34,7 +50,9 @@ INPUT_MOUNT_MAPPING_FROM_REST, validate_pipeline_input_key_characters, ) -from azure.ai.ml.entities._job.automl.search_space_utils import _convert_sweep_dist_dict_to_str_dict +from azure.ai.ml.entities._job.automl.search_space_utils import ( + _convert_sweep_dist_dict_to_str_dict, +) from azure.ai.ml.entities._job.job_service import ( JobService, JupyterLabJobService, @@ -77,7 +95,9 @@ def validator(key, assert_valid=True): validator("a.b.c0") def test_simple_deserialize(self): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + ) yaml_obj = load_yaml(test_path) job: PipelineJob = load_job(test_path) # Expected REST overrides and settings are in a JSON file "settings_overrides.json" @@ -93,14 +113,19 @@ def test_simple_deserialize(self): } assert job._build_inputs() == expected_inputs settings = job.settings._to_dict() - settings = {k: v for k, v in settings.items() if v is not None and k != "force_rerun"} + settings = { + k: v for k, v in settings.items() if v is not None and k != "force_rerun" + } assert settings == yaml_obj["settings"] # check that components were loaded correctly hello_world_component = job.jobs["hello_world_component"] rest_hello_world_component = hello_world_component._to_rest_object() hello_world_component_yaml = yaml_obj["jobs"]["hello_world_component"] assert hello_world_component_yaml["type"] == hello_world_component.type - assert hello_world_component_yaml["component"][len(ARM_ID_PREFIX) :] == hello_world_component.component + assert ( + hello_world_component_yaml["component"][len(ARM_ID_PREFIX) :] + == hello_world_component.component + ) assert rest_hello_world_component["inputs"] == { "component_in_number": { "job_input_type": "literal", @@ -111,16 +136,19 @@ def test_simple_deserialize(self): rest_hello_world_component_2 = hello_world_component_2._to_rest_object() hello_world_component_2_yaml = yaml_obj["jobs"]["hello_world_component_2"] assert hello_world_component_2_yaml["type"] == hello_world_component_2.type - assert hello_world_component_2_yaml["component"][len(ARM_ID_PREFIX) :] == hello_world_component_2.component + assert ( + hello_world_component_2_yaml["component"][len(ARM_ID_PREFIX) :] + == hello_world_component_2.component + ) assert rest_hello_world_component_2["inputs"] == { "component_in_number": { "job_input_type": "literal", "value": "${{parent.inputs.job_in_other_number}}", } } - assert expected_rest_settings_overrides["expected_rest_overrides"]["distribution"] == ( - hello_world_component_2.distribution._to_rest_object().as_dict() - ) + assert expected_rest_settings_overrides["expected_rest_overrides"][ + "distribution" + ] == (as_attribute_dict(hello_world_component_2.distribution._to_rest_object())) assert {"FOO": "bar"} == hello_world_component_2.environment_variables assert {"nested_override": 5} == hello_world_component_2.additional_override @@ -141,13 +169,21 @@ def test_simple_deserialize(self): assert input_name in rest_pipeline_properties.inputs if isinstance(input_value, dict): input_value = input_value.get("value", None) - if not isinstance(rest_pipeline_properties.inputs[input_name], (MLTableJobInput, UriFolderJobInput)): - assert str(input_value) == rest_pipeline_properties.inputs[input_name].value + if not isinstance( + rest_pipeline_properties.inputs[input_name], + (MLTableJobInput, UriFolderJobInput), + ): + assert ( + str(input_value) + == rest_pipeline_properties.inputs[input_name].value + ) # Check settings assert ( rest_pipeline_properties.settings["continue_on_step_failure"] - == expected_rest_settings_overrides["expected_rest_settings"]["continue_on_step_failure"] + == expected_rest_settings_overrides["expected_rest_settings"][ + "continue_on_step_failure" + ] ) # Check that components were properly serialized: @@ -157,7 +193,10 @@ def test_simple_deserialize(self): assert job_name in rest_pipeline_properties.jobs rest_component_job = rest_pipeline_properties.jobs[job_name] if "component" in rest_pipeline_properties.jobs[job_name]: - assert component_job["component"][len(ARM_ID_PREFIX) :] == rest_component_job["componentId"] + assert ( + component_job["component"][len(ARM_ID_PREFIX) :] + == rest_component_job["componentId"] + ) # Check the inputs are properly placed rest_component_job_inputs = rest_component_job["inputs"] for input_name, input_value in component_job["inputs"].items(): @@ -166,18 +205,30 @@ def test_simple_deserialize(self): # If given input is a literal assert input_name in rest_component_job_inputs # If the given input is a literal value - assert rest_component_job_inputs[input_name].data.value == str(input_value) + assert rest_component_job_inputs[input_name].data.value == str( + input_value + ) overrides = component_job.get("overrides", None) if overrides: assert rest_component_job["overrides"] - assert expected_rest_settings_overrides["expected_rest_overrides"] == rest_component_job["overrides"] + assert ( + expected_rest_settings_overrides["expected_rest_overrides"] + == rest_component_job["overrides"] + ) # Check that the compute is properly serialized if "component" in rest_component_job: assert rest_component_job["computeId"] - assert rest_component_job["computeId"] == component_job["compute"][len(ARM_ID_PREFIX) :] + assert ( + rest_component_job["computeId"] + == component_job["compute"][len(ARM_ID_PREFIX) :] + ) - def test_pipeline_job_settings_compute_dump(self, mock_machinelearning_client: MLClient): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + def test_pipeline_job_settings_compute_dump( + self, mock_machinelearning_client: MLClient + ): + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + ) job = load_job(test_path) job.settings.default_compute = "cpu-cluster" dump_str = StringIO() @@ -210,16 +261,22 @@ def test_sweep_node(self): ), ]: loaded_value = pydash.get(pipeline_dict, key, None) - assert loaded_value == expected_value, f"{key} isn't as expected: {loaded_value} != {expected_value}" + assert ( + loaded_value == expected_value + ), f"{key} isn't as expected: {loaded_value} != {expected_value}" def test_literal_inputs_fidelity_in_yaml_dump(self): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + ) job = load_job(test_path) reconstructed_yaml = job._to_dict() assert reconstructed_yaml["inputs"] == job._build_inputs() - def test_pipeline_job_with_inputs(self, mock_machinelearning_client: MLClient, mocker: MockFixture) -> None: + def test_pipeline_job_with_inputs( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ) -> None: test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_data_options_no_outputs.yml" yaml_obj = load_yaml(test_path) job = load_job(test_path) @@ -271,9 +328,14 @@ def test_pipeline_job_with_inputs(self, mock_machinelearning_client: MLClient, m if from_rest_input.mode is None: assert input_value.mode is None else: - assert from_rest_input.mode == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] + assert ( + from_rest_input.mode + == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] + ) - def test_pipeline_job_with_inputs_dataset(self, mock_machinelearning_client: MLClient, mocker: MockFixture) -> None: + def test_pipeline_job_with_inputs_dataset( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ) -> None: test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_dataset_options_no_outputs.yml" yaml_obj = load_yaml(test_path) job = load_job(test_path) # type: PipelineJob @@ -283,7 +345,9 @@ def test_pipeline_job_with_inputs_dataset(self, mock_machinelearning_client: MLC job_obj_input = job.inputs.get(input_name, None) assert job_obj_input is not None assert isinstance(job_obj_input, PipelineInput) - assert isinstance(job_obj_input._data, Input) or isinstance(job_obj_input._data, Input) + assert isinstance(job_obj_input._data, Input) or isinstance( + job_obj_input._data, Input + ) # "Upload" the depedencies so that the dataset serialization behavior can be verified mocker.patch( @@ -302,7 +366,10 @@ def test_pipeline_job_with_inputs_dataset(self, mock_machinelearning_client: MLC # TODO: https://msdata.visualstudio.com/Vienna/_workitems/edit/1318153/ For now, check that mode is present until new delivery types are supported. # yaml_input_mode = input_value.get("mode", InputDataDeliveryMode.READ_WRITE_MOUNT) if rest_input.mode: - assert INPUT_MOUNT_MAPPING_FROM_REST[rest_input.mode] == job.inputs[input_name]._data.mode + assert ( + INPUT_MOUNT_MAPPING_FROM_REST[rest_input.mode] + == job.inputs[input_name]._data.mode + ) else: assert job.inputs[input_name]._data.mode is None @@ -323,7 +390,10 @@ def test_pipeline_job_with_inputs_dataset(self, mock_machinelearning_client: MLC if from_rest_input.mode is None: assert input_value.mode is None else: - assert from_rest_input.mode == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] + assert ( + from_rest_input.mode + == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] + ) def test_pipeline_job_components_with_inputs( self, mock_machinelearning_client: MLClient, mocker: MockFixture @@ -339,7 +409,9 @@ def test_pipeline_job_components_with_inputs( for input_name, input_value in job_value["inputs"].items(): job_input = job_obj.inputs[input_name]._to_job_input() if isinstance(input_value, str): - if isinstance(job_input, Input) and is_data_binding_expression(job_input.path): + if isinstance(job_input, Input) and is_data_binding_expression( + job_input.path + ): job_input = job_input.path assert isinstance(job_input, str) else: @@ -360,7 +432,10 @@ def test_pipeline_job_components_with_inputs( "value": "${{parent.inputs.inputvalue}}", } } - assert rest_job.properties.jobs["multiple_data_component"]["inputs"] == expected_inputs + assert ( + rest_job.properties.jobs["multiple_data_component"]["inputs"] + == expected_inputs + ) # Test that translating from REST preserves the inputs for each job. In this case, they are all bindings from_rest_job = PipelineJob._from_rest_object(rest_job) @@ -379,7 +454,9 @@ def test_pipeline_job_components_with_inline_dataset( for input_name, input_value in job_value["inputs"].items(): job_input = job_obj.inputs[input_name]._to_job_input() if isinstance(input_value, str): - if isinstance(job_input, Input) and is_data_binding_expression(job_input.path): + if isinstance(job_input, Input) and is_data_binding_expression( + job_input.path + ): job_input = job_input.path assert isinstance(job_input, str) else: @@ -535,8 +612,13 @@ def test_pipeline_component_job_with_outputs( "value": "${{parent.inputs.job_in_data_uri}}", }, } - assert rest_component_jobs["multiple_data_component"]["outputs"] == expected_outputs - assert rest_component_jobs["multiple_data_component"]["inputs"] == expected_inputs + assert ( + rest_component_jobs["multiple_data_component"]["outputs"] + == expected_outputs + ) + assert ( + rest_component_jobs["multiple_data_component"]["inputs"] == expected_inputs + ) # Check the from REST behavior from_rest_job = PipelineJob._from_rest_object(rest_job) @@ -550,14 +632,18 @@ def test_pipeline_component_job_with_outputs( assert isinstance(from_rest_output, Output) # Check that outputs were properly converted from REST format to SDK format for each ComponentJob - from_rest_component_job = from_rest_job.jobs.get("multiple_data_component", None) + from_rest_component_job = from_rest_job.jobs.get( + "multiple_data_component", None + ) assert from_rest_component_job is not None from_rest_component_job = from_rest_component_job._to_rest_object() assert from_rest_component_job["outputs"] == expected_outputs assert from_rest_component_job["inputs"] == expected_inputs - def _check_data_output_rest_formatting(self, rest_output: RestJobOutput, yaml_output: Dict[str, Any]) -> None: + def _check_data_output_rest_formatting( + self, rest_output: RestJobOutput, yaml_output: Dict[str, Any] + ) -> None: rest_output_data = rest_output.data assert rest_output_data yaml_output_data = yaml_output["data"] @@ -576,7 +662,9 @@ def _check_data_output_rest_formatting(self, rest_output: RestJobOutput, yaml_ou if mode: assert rest_output_data.mode.lower() == mode.lower() - def _check_data_output_from_rest_formatting(self, rest_output_data: RestJobOutput, from_rest_output: Input) -> None: + def _check_data_output_from_rest_formatting( + self, rest_output_data: RestJobOutput, from_rest_output: Input + ) -> None: from_rest_output_data = from_rest_output.data assert from_rest_output_data assert from_rest_output_data.path == rest_output_data.datapath @@ -594,20 +682,32 @@ def _check_data_output_from_rest_formatting(self, rest_output_data: RestJobOutpu def assert_inline_component(self, component_job, component_dict): assert isinstance( - component_job.component, (CommandComponent, ParallelComponent, SparkComponent, DataTransferComponent) + component_job.component, + ( + CommandComponent, + ParallelComponent, + SparkComponent, + DataTransferComponent, + ), ) component = component_job.component or component_job.trial assert component._is_anonymous # hash will be generated before create_or_update, so can't check it in unit tests - assert list(component.inputs.keys()) == list(component_dict.get("inputs", {}).keys()) - assert list(component.outputs.keys()) == list(component_dict.get("outputs", {}).keys()) + assert list(component.inputs.keys()) == list( + component_dict.get("inputs", {}).keys() + ) + assert list(component.outputs.keys()) == list( + component_dict.get("outputs", {}).keys() + ) def test_pipeline_job_inline_component(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_inline_comps.yml" job = load_job(test_path) # make sure inline component is parsed into component entity hello_world_component = job.jobs["hello_world_component_inline"] - component_dict = load_yaml(test_path)["jobs"]["hello_world_component_inline"]["component"] + component_dict = load_yaml(test_path)["jobs"]["hello_world_component_inline"][ + "component" + ] self.assert_inline_component(hello_world_component, component_dict) def test_pipeline_job_inline_component_file(self): @@ -615,10 +715,14 @@ def test_pipeline_job_inline_component_file(self): job = load_job(test_path) # make sure inline component is parsed into component entity hello_world_component = job.jobs["hello_world_component_inline_file"] - component_dict = load_yaml("./tests/test_configs/components/helloworld_component.yml") + component_dict = load_yaml( + "./tests/test_configs/components/helloworld_component.yml" + ) self.assert_inline_component(hello_world_component, component_dict) - test_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" + test_path = ( + "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" + ) job = load_job(test_path) # make sure inline component is parsed into component entity spark_component = job.jobs["add_greeting_column"] @@ -627,18 +731,24 @@ def test_pipeline_job_inline_component_file(self): ) self.assert_inline_component(spark_component, component_dict) - test_path = "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" + test_path = ( + "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" + ) job = load_job(test_path) # make sure inline component is parsed into component entity spark_component = job.jobs["merge_files_job"] - component_dict = load_yaml("./tests/test_configs/components/data_transfer/merge_files.yaml") + component_dict = load_yaml( + "./tests/test_configs/components/data_transfer/merge_files.yaml" + ) self.assert_inline_component(spark_component, component_dict) test_path = "./tests/test_configs/pipeline_jobs/data_transfer/copy_files.yaml" job = load_job(test_path) # make sure inline component is parsed into component entity spark_component = job.jobs["copy_files"] - component_dict = load_yaml("./tests/test_configs/components/data_transfer/copy_files.yaml") + component_dict = load_yaml( + "./tests/test_configs/components/data_transfer/copy_files.yaml" + ) self.assert_inline_component(spark_component, component_dict) def test_pipeline_job_inline_component_file_with_complex_path(self): @@ -647,13 +757,18 @@ def test_pipeline_job_inline_component_file_with_complex_path(self): job = load_job(test_path) # make sure inline component is parsed into component entity hello_world_component = job.jobs["hello_world_inline_paralleljob"] - component_dict = load_yaml("./tests/test_configs/dsl_pipeline/parallel_component_with_file_input/score.yml") + component_dict = load_yaml( + "./tests/test_configs/dsl_pipeline/parallel_component_with_file_input/score.yml" + ) self.assert_inline_component(hello_world_component, component_dict) def test_pipeline_job_inline_component_file_parallel_with_user_identity(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_inline_file_parallel.yml" job = load_job(test_path) - assert isinstance(job.jobs["hello_world_inline_paralleljob"].identity, UserIdentityConfiguration) + assert isinstance( + job.jobs["hello_world_inline_paralleljob"].identity, + UserIdentityConfiguration, + ) @classmethod def assert_settings_field( @@ -678,7 +793,9 @@ def mock_get_asset_arm_id(*args, **kwargs): "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", side_effect=mock_get_asset_arm_id, ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline_job) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( + pipeline_job + ) # Check that if compute was specified, it was resolved # Otherwise, it should be left unset since the backend will apply the default @@ -695,7 +812,9 @@ def mock_get_asset_arm_id(*args, **kwargs): def assert_setting(rest_job, key, value): assert rest_job.properties.settings.get(key, None) == value - assert_setting(rest_job, PipelineConstants.DEFAULT_DATASTORE, "workspacefilestore") + assert_setting( + rest_job, PipelineConstants.DEFAULT_DATASTORE, "workspacefilestore" + ) assert_setting(rest_job, PipelineConstants.DEFAULT_COMPUTE, "cpu-cluster-1") assert_setting(rest_job, PipelineConstants.CONTINUE_ON_STEP_FAILURE, True) @@ -706,8 +825,12 @@ def assert_setting(rest_job, key, value): assert from_rest_job.settings.default_compute == "cpu-cluster-1" assert from_rest_job.settings.continue_on_step_failure is True - def test_pipeline_job_settings_field(self, mock_machinelearning_client: MLClient, mocker: MockFixture): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" + def test_pipeline_job_settings_field( + self, mock_machinelearning_client: MLClient, mocker: MockFixture + ): + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" + ) job = load_job(test_path) self.assert_settings_field(job, mock_machinelearning_client, mocker) @@ -717,7 +840,9 @@ def test_pipeline_job_settings_field(self, mock_machinelearning_client: MLClient assert rest_job.properties.compute_id == job.compute def test_set_unknown_pipeline_job_settings(self): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" + ) job: PipelineJob = load_job( test_path, @@ -769,7 +894,9 @@ def mock_get_asset_arm_id(*args, **kwargs): "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", side_effect=mock_get_asset_arm_id, ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline_job) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( + pipeline_job + ) # Check that if compute was specified, it was resolved # Otherwise, it should be left unset since the backend will apply the default @@ -796,7 +923,10 @@ def mock_get_asset_arm_id(*args, **kwargs): "job_input_type": "literal", "value": "${{parent.jobs.hello_world.outputs.job_output}}", }, - "test2": {"job_input_type": "literal", "value": "${{parent.inputs.job_data_path}}"}, + "test2": { + "job_input_type": "literal", + "value": "${{parent.inputs.job_data_path}}", + }, }, }, id="pipeline_job_with_sweep_job_with_input_bindings", @@ -874,14 +1004,22 @@ def test_pipeline_job_with_input_bindings( with pytest.raises(Exception) as e: load_job( test_path, - params_override=[{"jobs.hello_world.inputs.test1": "${{parent.inputs.not_found}}"}], + params_override=[ + { + "jobs.hello_world.inputs.test1": "${{parent.inputs.not_found}}" + } + ], ) - assert "Failed to find top level definition for input binding" in str(e.value) + assert "Failed to find top level definition for input binding" in str( + e.value + ) # Check that all inputs are present and are of type Input or are literals for input_name, input_yaml in yaml_obj["inputs"].items(): job_obj_input = job.inputs.get(input_name, None) - assert job_obj_input is not None, f"Input {input_name} not found in loaded job" + assert ( + job_obj_input is not None + ), f"Input {input_name} not found in loaded job" assert isinstance(job_obj_input, PipelineInput) job_obj_input = job_obj_input._to_job_input() if isinstance(input_yaml, dict): @@ -1112,7 +1250,10 @@ def test_pipeline_job_command_job_with_input_outputs( for job_name, job_value in yaml_obj["jobs"].items(): for io_type in ["inputs", "outputs"]: - if job_name not in expected_input_outputs or io_type not in expected_input_outputs[job_name]: + if ( + job_name not in expected_input_outputs + or io_type not in expected_input_outputs[job_name] + ): continue expected_values = expected_input_outputs[job_name][io_type] @@ -1127,9 +1268,7 @@ def test_pipeline_job_command_job_with_input_outputs( assert expected_values == rest_component[io_type] def test_pipeline_job_str(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" pipeline_entity = load_job(source=test_path) pipeline_str = str(pipeline_entity) assert pipeline_entity.name in pipeline_str @@ -1140,8 +1279,13 @@ def test_pipeline_job_with_environment_variables(self) -> None: ) pipeline_job_dict = pipeline_job._to_rest_object().as_dict() - assert "environment_variables" in pipeline_job_dict["properties"]["jobs"]["world_job"] - assert pipeline_job_dict["properties"]["jobs"]["world_job"]["environment_variables"] == { + assert ( + "environment_variables" + in pipeline_job_dict["properties"]["jobs"]["world_job"] + ) + assert pipeline_job_dict["properties"]["jobs"]["world_job"][ + "environment_variables" + ] == { "AZUREML_COMPUTE_USE_COMMON_RUNTIME": "false", "abc": "def", } @@ -1149,7 +1293,10 @@ def test_pipeline_job_with_environment_variables(self) -> None: def test_dump_distribution(self): # pipeline level test is in test_pipeline_job_create_with_distribution_component from azure.ai.ml import TensorFlowDistribution - from azure.ai.ml._schema.job.distribution import PyTorchDistributionSchema, TensorFlowDistributionSchema + from azure.ai.ml._schema.job.distribution import ( + PyTorchDistributionSchema, + TensorFlowDistributionSchema, + ) distribution_dict = { "type": "tensorflow", @@ -1161,19 +1308,29 @@ def test_dump_distribution(self): distribution_obj = TensorFlowDistribution(**distribution_dict) with pytest.raises( - ValidationError, match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema" + ValidationError, + match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema", ): - _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump(distribution_dict) + _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump( + distribution_dict + ) with pytest.raises( - ValidationError, match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema" + ValidationError, + match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema", ): - _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump(distribution_obj) + _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump( + distribution_obj + ) - after_dump_correct = TensorFlowDistributionSchema(context={"base_path": "./"}).dump(distribution_obj) + after_dump_correct = TensorFlowDistributionSchema( + context={"base_path": "./"} + ).dump(distribution_obj) assert after_dump_correct == distribution_dict def test_job_defaults(self, mocker: MockFixture): - pipeline_job = load_job(source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_e2e.yml") + pipeline_job = load_job( + source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_e2e.yml" + ) mocker.patch( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx", @@ -1286,20 +1443,22 @@ def test_command_job_in_pipeline_to_component(self, test_path, expected_componen pipeline_entity = load_job(source=test_path) # check component of pipeline job is expected for name, expected_dict in expected_components.items(): - actual_dict = pipeline_entity.jobs[name].component._to_rest_object().as_dict() + actual_dict = ( + pipeline_entity.jobs[name].component._to_rest_object().as_dict() + ) omit_fields = [ "name", # dumped code will be an absolute path, tested in other tests "code", ] - actual_dict = pydash.omit(actual_dict["properties"]["component_spec"], omit_fields) + actual_dict = pydash.omit( + actual_dict["properties"]["component_spec"], omit_fields + ) assert actual_dict == expected_dict def test_command_job_in_pipeline_deep_reference(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" pipeline_entity = load_job(source=test_path) expected_components = { "hello_world_inline_commandjob_1": { @@ -1345,19 +1504,25 @@ def test_command_job_in_pipeline_deep_reference(self): }, } for name, expected_dict in expected_components.items(): - actual_dict = pipeline_entity.jobs[name].component._to_rest_object().as_dict() + actual_dict = ( + pipeline_entity.jobs[name].component._to_rest_object().as_dict() + ) omit_fields = [ "name", ] - actual_dict = pydash.omit(actual_dict["properties"]["component_spec"], omit_fields) + actual_dict = pydash.omit( + actual_dict["properties"]["component_spec"], omit_fields + ) assert actual_dict == expected_dict def test_command_job_referenced_component_no_meta(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" - ) - params_override = [{"jobs.hello_world_component_before.component": "azureml:fake_component_arm_id:1"}] + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" + params_override = [ + { + "jobs.hello_world_component_before.component": "azureml:fake_component_arm_id:1" + } + ] # when component is provided as arm id, won't able to get referenced component input/output type with pytest.raises(Exception) as e: load_job(source=test_path, params_override=params_override) @@ -1417,7 +1582,11 @@ def test_command_job_referenced_component_no_meta(self): ], ) def test_automl_node_in_pipeline_load_dump( - self, test_path, job_key, mock_machinelearning_client: MLClient, mocker: MockFixture + self, + test_path, + job_key, + mock_machinelearning_client: MLClient, + mocker: MockFixture, ): pipeline: PipelineJob = load_job(source=test_path) @@ -1425,21 +1594,35 @@ def test_automl_node_in_pipeline_load_dump( original_dict = yaml.safe_load(f) mocker.patch( - "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx" + "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", + return_value="xxx", + ) + mocker.patch( + "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", + return_value="yyy", ) - mocker.patch("azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy") # Prevent token refresh check which fails on Windows with Mock credentials mocker.patch( "azure.mgmt.core.policies._authentication.ARMChallengeAuthenticationPolicy._need_new_token", return_value=False, ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( + pipeline + ) automl_job = pipeline.jobs[job_key] automl_job_dict = automl_job._to_dict(inside_pipeline=True) pipeline_job_dict = json.loads(json.dumps(automl_job_dict)) original_job_dict = json.loads(json.dumps(original_dict["jobs"][job_key])) - omit_fields = ["display_name", "experiment_name", "log_verbosity", "name", "outputs", "properties", "tags"] + omit_fields = [ + "display_name", + "experiment_name", + "log_verbosity", + "name", + "outputs", + "properties", + "tags", + ] pipeline_job_dict = pydash.omit(pipeline_job_dict, omit_fields) original_job_dict = pydash.omit(original_job_dict, omit_fields) if job_key == "automl_text_ner": @@ -1450,14 +1633,22 @@ def test_automl_node_in_pipeline_load_dump( pipeline_job_dict = pydash.omit(pipeline_job_dict, ["sweep"]) original_job_dict = pydash.omit(original_job_dict, ["sweep"]) - for i, search_space_item in enumerate(original_job_dict.get("search_space", [])): - original_job_dict["search_space"][i] = _convert_sweep_dist_dict_to_str_dict(search_space_item) + for i, search_space_item in enumerate( + original_job_dict.get("search_space", []) + ): + original_job_dict["search_space"][i] = ( + _convert_sweep_dist_dict_to_str_dict(search_space_item) + ) assert pipeline_job_dict == original_job_dict - def _raise_error_on_wrong_schema(self, test_path, original_dict, job_key, mock_machinelearning_client, mocker): + def _raise_error_on_wrong_schema( + self, test_path, original_dict, job_key, mock_machinelearning_client, mocker + ): dump_yaml_to_file(test_path, original_dict) with pytest.raises(ValidationError): - self.test_automl_node_in_pipeline_load_dump(test_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_path, job_key, mock_machinelearning_client, mocker + ) @pytest.mark.parametrize( "test_path, job_key", @@ -1482,7 +1673,12 @@ def _raise_error_on_wrong_schema(self, test_path, original_dict, job_key, mock_m ], ) def test_automl_image_node_in_pipeline_load_dump( - self, test_path, job_key, mock_machinelearning_client: MLClient, mocker: MockFixture, tmp_path: Path + self, + test_path, + job_key, + mock_machinelearning_client: MLClient, + mocker: MockFixture, + tmp_path: Path, ): with open(test_path) as f: original_dict = yaml.safe_load(f) @@ -1496,7 +1692,11 @@ def test_automl_image_node_in_pipeline_load_dump( } self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) # # Test AMS Gradient @@ -1506,35 +1706,56 @@ def test_automl_image_node_in_pipeline_load_dump( "values": [1.2, 2.5], } self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) original_dict_copy["jobs"][job_key]["search_space"][0]["ams_gradient"] = True dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) # test LRSChedular Enum original_dict_copy = deepcopy(original_dict) - original_dict_copy["jobs"][job_key]["search_space"][0]["learning_rate_scheduler"] = { + original_dict_copy["jobs"][job_key]["search_space"][0][ + "learning_rate_scheduler" + ] = { "type": "choice", "values": ["random_lr_scheduler1", "random_lr_scheduler2"], } self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) - original_dict_copy["jobs"][job_key]["search_space"][0]["learning_rate_scheduler"] = camel_to_snake( - LearningRateScheduler.WARMUP_COSINE - ) + original_dict_copy["jobs"][job_key]["search_space"][0][ + "learning_rate_scheduler" + ] = camel_to_snake(LearningRateScheduler.WARMUP_COSINE) dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) - original_dict_copy["jobs"][job_key]["search_space"][0]["learning_rate_scheduler"] = { + original_dict_copy["jobs"][job_key]["search_space"][0][ + "learning_rate_scheduler" + ] = { "type": "choice", - "values": [camel_to_snake(LearningRateScheduler.WARMUP_COSINE), camel_to_snake(LearningRateScheduler.STEP)], + "values": [ + camel_to_snake(LearningRateScheduler.WARMUP_COSINE), + camel_to_snake(LearningRateScheduler.STEP), + ], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) # test Optimizer original_dict_copy = deepcopy(original_dict) @@ -1543,35 +1764,60 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["random1", "random2"], } self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) - original_dict_copy["jobs"][job_key]["search_space"][0]["optimizer"] = camel_to_snake(StochasticOptimizer.ADAM) + original_dict_copy["jobs"][job_key]["search_space"][0]["optimizer"] = ( + camel_to_snake(StochasticOptimizer.ADAM) + ) dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) original_dict_copy["jobs"][job_key]["search_space"][0]["optimizer"] = { "type": "choice", - "values": [camel_to_snake(StochasticOptimizer.SGD), camel_to_snake(StochasticOptimizer.ADAM)], + "values": [ + camel_to_snake(StochasticOptimizer.SGD), + camel_to_snake(StochasticOptimizer.ADAM), + ], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) # Test Model Name original_dict_copy = deepcopy(original_dict) original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = 1 self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = 100.5 self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = True self._raise_error_on_wrong_schema( - test_yaml_path, original_dict_copy, job_key, mock_machinelearning_client, mocker + test_yaml_path, + original_dict_copy, + job_key, + mock_machinelearning_client, + mocker, ) if "image_" in job_key and "classification" in job_key: @@ -1580,11 +1826,17 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["vitb16r224"], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) - original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = "vitb16r224" + original_dict_copy["jobs"][job_key]["search_space"][0][ + "model_name" + ] = "vitb16r224" dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) elif "object_detection" in job_key: original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = { @@ -1592,11 +1844,17 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["yolov5", "fasterrcnn_resnet50_fpn"], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) - original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = "fasterrcnn_resnet50_fpn" + original_dict_copy["jobs"][job_key]["search_space"][0][ + "model_name" + ] = "fasterrcnn_resnet50_fpn" dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) elif "instance_segmentation" in job_key: original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = { @@ -1604,33 +1862,53 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["maskrcnn_resnet152_fpn", "maskrcnn_resnet18_fpn"], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) - original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = "maskrcnn_resnet18_fpn" + original_dict_copy["jobs"][job_key]["search_space"][0][ + "model_name" + ] = "maskrcnn_resnet18_fpn" dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) + self.test_automl_node_in_pipeline_load_dump( + test_yaml_path, job_key, mock_machinelearning_client, mocker + ) @pytest.mark.parametrize( "params_override, error_field, expecting_field", [ ( - [{"jobs.train_job.inputs.training_data": "${{inputs.pipeline_job_training_input}}"}], + [ + { + "jobs.train_job.inputs.training_data": "${{inputs.pipeline_job_training_input}}" + } + ], "${{inputs.pipeline_job_training_input}}", "${{parent.inputs.pipeline_job_training_input}}", ), ( - [{"jobs.score_job.inputs.model_input": "${{jobs.train_job.outputs.model_output}}"}], + [ + { + "jobs.score_job.inputs.model_input": "${{jobs.train_job.outputs.model_output}}" + } + ], "${{jobs.train_job.outputs.model_output}}", "${{parent.jobs.train_job.outputs.model_output}}", ), ], ) - def test_legacy_data_binding_error_msg(self, params_override, error_field, expecting_field): - test_path = "./tests/test_configs/dsl_pipeline/e2e_local_components/pipeline.yml" + def test_legacy_data_binding_error_msg( + self, params_override, error_field, expecting_field + ): + test_path = ( + "./tests/test_configs/dsl_pipeline/e2e_local_components/pipeline.yml" + ) job: PipelineJob = load_job(source=test_path, params_override=params_override) with pytest.raises(ValidationException) as e: job._to_rest_object() - err_msg = "{} has changed to {}, please change to use new format.".format(error_field, expecting_field) + err_msg = "{} has changed to {}, please change to use new format.".format( + error_field, expecting_field + ) assert err_msg in str(e.value) @pytest.mark.parametrize( @@ -1639,13 +1917,20 @@ def test_legacy_data_binding_error_msg(self, params_override, error_field, expec "./tests/test_configs/pipeline_jobs/pipeline_job_with_parallel_job_with_input_bindings.yml", ], ) - def test_parallel_pipeline_not_private_preview_features(self, test_path, mocker: MockFixture): - mocker.patch("azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", return_value=False) + def test_parallel_pipeline_not_private_preview_features( + self, test_path, mocker: MockFixture + ): + mocker.patch( + "azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", + return_value=False, + ) job: PipelineJob = load_job(source=test_path) try: job._to_rest_object() except UserErrorException as e: - assert False, f"parallel in pipeline is public preview feature, but raised exception {e.value}" + assert ( + False + ), f"parallel in pipeline is public preview feature, but raised exception {e.value}" def test_pipeline_yaml_job_node_source(self, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job.yml" @@ -1669,7 +1954,9 @@ def test_command_job_node_services_in_pipeline_with_properties(self): assert isinstance(node_services.get("my_vscode"), VsCodeJobService) job_rest_obj = job._to_rest_object() - rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] + rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"][ + "services" + ] # rest object of node in pipeline should be pure dict assert rest_services == { "my_ssh": { @@ -1702,7 +1989,9 @@ def test_command_job_node_services_in_pipeline(self): assert node_services.get("my_tensorboard").log_dir == "~/tblog" job_rest_obj = job._to_rest_object() - rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] + rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"][ + "services" + ] # rest object of node in pipeline should be pure dict assert rest_services == { "my_ssh": { @@ -1734,7 +2023,9 @@ def test_command_job_node_services_in_pipeline_with_no_component(self): job_rest_obj = job._to_rest_object() # rest object of node in pipeline should be pure dict - assert job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] == { + assert job_rest_obj.properties.jobs["hello_world_component_inline"][ + "services" + ] == { "my_ssh": { "job_service_type": "SSH", "properties": {"sshPublicKeys": "xyz123"}, @@ -1751,7 +2042,9 @@ def test_command_job_node_services_in_pipeline_with_no_component(self): }, } - def test_command_job_node_services_in_pipeline_with_no_component_with_properties(self): + def test_command_job_node_services_in_pipeline_with_no_component_with_properties( + self, + ): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_node_services_inline_job_with_properties.yml" job: PipelineJob = load_job(source=test_path) node_services = job.jobs["hello_world_component_inline"].services @@ -1764,7 +2057,9 @@ def test_command_job_node_services_in_pipeline_with_no_component_with_properties job_rest_obj = job._to_rest_object() # rest object of node in pipeline should be pure dict - assert job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] == { + assert job_rest_obj.properties.jobs["hello_world_component_inline"][ + "services" + ] == { "my_ssh": { "job_service_type": "SSH", "properties": {"sshPublicKeys": "xyz123"}, @@ -1819,7 +2114,9 @@ def test_pipeline_job_with_pipeline_component(self): assert nodes["node3"]["inputs"] == expected_node3_input_dict def test_pipeline_component_job(self): - test_path = "./tests/test_configs/pipeline_jobs/remote_pipeline_component_job.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/remote_pipeline_component_job.yml" + ) job: PipelineJob = load_job(source=test_path) assert job._validate().passed expected_job_dict = { @@ -1851,8 +2148,14 @@ def test_pipeline_component_job(self): assert job._validate().passed job_dict = job._to_dict() assert job_dict["outputs"] == { - "not_exists": {"path": "azureml://datastores/mock/paths/not_exists.txt", "type": "uri_file"}, - "output_path": {"path": "azureml://datastores/mock/paths/my_output_file.txt", "type": "uri_file"}, + "not_exists": { + "path": "azureml://datastores/mock/paths/not_exists.txt", + "type": "uri_file", + }, + "output_path": { + "path": "azureml://datastores/mock/paths/my_output_file.txt", + "type": "uri_file", + }, } # Assert the output_path:None not override original component output value @@ -1861,7 +2164,10 @@ def test_pipeline_component_job(self): assert job._validate().passed job_dict = job._to_dict() assert job_dict["outputs"] == { - "not_exists": {"path": "azureml://datastores/mock/paths/not_exists.txt", "type": "uri_file"}, + "not_exists": { + "path": "azureml://datastores/mock/paths/not_exists.txt", + "type": "uri_file", + }, "output_path": {"type": "uri_folder"}, # uri_folder from component output } @@ -1869,14 +2175,20 @@ def test_invalid_pipeline_component_job(self): test_path = "./tests/test_configs/pipeline_jobs/invalid/invalid_pipeline_component_job.yml" with pytest.raises(Exception) as e: load_job(source=test_path) - assert "'jobs' and 'component' are mutually exclusive fields in pipeline job" in str(e.value) + assert ( + "'jobs' and 'component' are mutually exclusive fields in pipeline job" + in str(e.value) + ) @pytest.mark.parametrize( "pipeline_job_path, expected_error", DATABINDING_EXPRESSION_TEST_CASES, ) def test_pipeline_job_with_data_binding_expression( - self, client: MLClient, pipeline_job_path: str, expected_error: Optional[Exception] + self, + client: MLClient, + pipeline_job_path: str, + expected_error: Optional[Exception], ): pipeline: PipelineJob = load_job(source=pipeline_job_path) pipeline._to_rest_object() From 6b40a79252e96e9011bb6902bc93d92259dd0dde Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 6 Jul 2026 22:12:49 +0530 Subject: [PATCH 024/146] Migrate base ResourceConfiguration to arm_ml_service Flip the ResourceConfiguration import in entities/_job/resource_configuration.py to the shared arm_ml_service hybrid client. arm's ResourceConfiguration has identical fields (instance_count, instance_type, properties). The base class' _to_rest_object/_from_rest_object are not exercised in production wire paths; its only real consumer (distillation) reads .instance_type only, and the online/batch deployment entity reads instance_count/instance_type attributes. Validated: distillation + smoke 162 passed, deployment entity 63 passed. --- .../ml/entities/_job/resource_configuration.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py index a10d4a66035c..121e908df7a3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py @@ -6,7 +6,9 @@ import logging from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2023_04_01_preview.models import ResourceConfiguration as RestResourceConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import ( + ResourceConfiguration as RestResourceConfiguration, +) from azure.ai.ml.constants._job.job import JobComputePropertyFields from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin @@ -40,7 +42,9 @@ def __init__( if properties is not None: for key, value in properties.items(): if key == JobComputePropertyFields.AISUPERCOMPUTER: - self.properties[JobComputePropertyFields.SINGULARITY.lower()] = value + self.properties[JobComputePropertyFields.SINGULARITY.lower()] = ( + value + ) else: self.properties[key] = value @@ -51,7 +55,8 @@ def _to_rest_object(self) -> RestResourceConfiguration: try: if ( key.lower() == JobComputePropertyFields.SINGULARITY.lower() - or key.lower() == JobComputePropertyFields.AISUPERCOMPUTER.lower() + or key.lower() + == JobComputePropertyFields.AISUPERCOMPUTER.lower() ): # Map Singularity -> AISupercomputer in SDK until MFE does mapping key = JobComputePropertyFields.AISUPERCOMPUTER @@ -81,7 +86,10 @@ def _from_rest_object( # pylint: disable=arguments-renamed def __eq__(self, other: object) -> bool: if not isinstance(other, ResourceConfiguration): return NotImplemented - return self.instance_count == other.instance_count and self.instance_type == other.instance_type + return ( + self.instance_count == other.instance_count + and self.instance_type == other.instance_type + ) def __ne__(self, other: object) -> bool: if not isinstance(other, ResourceConfiguration): From 0327f21f0afabcfef62e2d655306bad8e9a09417 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 09:54:42 +0530 Subject: [PATCH 025/146] Migrate job_service to arm_ml_service JobService/AllNodes Flip the JobService and AllNodes imports in entities/_job/job_service.py to the shared arm_ml_service hybrid client. command_job.py and pipeline_job.py already wrap services through the arm boundary helper (to_hybrid_rest_model), so building arm JobService objects directly makes that conversion a no-op. status is intentionally not set on the wire object: on the v2023_04 msrest model it was a readonly field that serialize() silently dropped, so the submitted body never carried it. arm exposes status as writable, so omitting it keeps the wire payload byte-identical. Verified arm as_dict()==msrest serialize() on the write path and arm as_attribute_dict()==msrest as_dict() on the DSL node path. Validated: smoke+command+pipeline+dsl+sweep 738 passed, job_common 25 passed. --- .../azure/ai/ml/entities/_job/job_service.py | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py index 09d7ed06c275..fb73c03ac371 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py @@ -9,11 +9,16 @@ from typing_extensions import Literal -from azure.ai.ml._restclient.v2023_04_01_preview.models import AllNodes -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobService as RestJobService +from azure.ai.ml._restclient.arm_ml_service.models import AllNodes +from azure.ai.ml._restclient.arm_ml_service.models import JobService as RestJobService from azure.ai.ml.constants._job.job import JobServiceTypeNames from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationErrorType, + ValidationException, +) module_logger = logging.getLogger(__name__) @@ -73,7 +78,8 @@ def _validate_nodes(self) -> None: def _validate_type_name(self) -> None: if self.type and not self.type in JobServiceTypeNames.ENTITY_TO_REST: msg = ( - f"type should be one of " f"{JobServiceTypeNames.NAMES_ALLOWED_FOR_PUBLIC}, but received '{self.type}'." + f"type should be one of " + f"{JobServiceTypeNames.NAMES_ALLOWED_FOR_PUBLIC}, but received '{self.type}'." ) raise ValidationException( message=msg, @@ -83,12 +89,21 @@ def _validate_type_name(self) -> None: error_type=ValidationErrorType.INVALID_VALUE, ) - def _to_rest_job_service(self, updated_properties: Optional[Dict[str, str]] = None) -> RestJobService: + def _to_rest_job_service( + self, updated_properties: Optional[Dict[str, str]] = None + ) -> RestJobService: + # ``status`` is intentionally NOT set on the wire object. On the v2023_04 msrest model it was a + # readonly attribute that ``serialize()`` silently dropped, so the submitted body never carried it. + # The shared arm_ml_service model exposes ``status`` as a writable field, so omitting it here keeps + # the wire payload byte-identical to the previous behavior. return RestJobService( endpoint=self.endpoint, - job_service_type=JobServiceTypeNames.ENTITY_TO_REST.get(self.type, None) if self.type else None, + job_service_type=( + JobServiceTypeNames.ENTITY_TO_REST.get(self.type, None) + if self.type + else None + ), nodes=AllNodes() if self.nodes else None, - status=self.status, port=self.port, properties=updated_properties if updated_properties else self.properties, ) @@ -224,7 +239,9 @@ def _from_rest_object(cls, obj: RestJobService) -> "SshJobService": return ssh_job_service def _to_rest_object(self) -> RestJobService: - updated_properties = _append_or_update_properties(self.properties, "sshPublicKeys", self.ssh_public_keys) + updated_properties = _append_or_update_properties( + self.properties, "sshPublicKeys", self.ssh_public_keys + ) return self._to_rest_job_service(updated_properties) @@ -280,12 +297,16 @@ def __init__( @classmethod def _from_rest_object(cls, obj: RestJobService) -> "TensorBoardJobService": - tensorboard_job_Service = cast(TensorBoardJobService, cls._from_rest_job_service_object(obj)) + tensorboard_job_Service = cast( + TensorBoardJobService, cls._from_rest_job_service_object(obj) + ) tensorboard_job_Service.log_dir = _get_property(obj.properties, "logDir") return tensorboard_job_Service def _to_rest_object(self) -> RestJobService: - updated_properties = _append_or_update_properties(self.properties, "logDir", self.log_dir) + updated_properties = _append_or_update_properties( + self.properties, "logDir", self.log_dir + ) return self._to_rest_job_service(updated_properties) From 5df0520492cb7345f9bbcfcfaad2c8510a197008 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 10:03:42 +0530 Subject: [PATCH 026/146] Add CHANGELOG entry for arm_ml_service client migration --- sdk/ml/azure-ai-ml/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index 37b4a407f10d..c266ca6210e0 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -8,6 +8,8 @@ ### Other Changes +- Migrated SDK entities and their consumers off the per-version msrest REST clients onto the shared `arm_ml_service` hybrid client. This is an internal change; the on-the-wire request/response contract is unchanged. + ## 1.34.0 (2026-06-11) ### Features Added From 5ca4776f6526aa825603584bfec134ae0cab92eb Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 10:11:17 +0530 Subject: [PATCH 027/146] Migrate job identity models in _credentials.py to arm_ml_service Flip AmlToken, IdentityConfiguration, IdentityConfigurationType, ManagedIdentity (job) and UserIdentity imports to the shared arm_ml_service hybrid client. These are the job-envelope identity models; command_job/pipeline_job/spark/parallel already wrap identity through the arm boundary helper (to_hybrid_rest_model), so building arm objects directly makes that conversion a no-op. Wire output verified byte-identical (arm as_dict == msrest serialize) for all three job identity types. Registry ManagedServiceIdentity and WorkspaceConnectionAccessKey stay on v2023_04 (separate registry/connection paths, out of scope here). The dict-read branch in _BaseJobIdentityConfiguration._from_rest_object used RestJobIdentityConfiguration.from_dict, which the arm hybrid model does not provide. Since the node-level rest object is a snake_case attribute dict, wrap it in from_rest_dict_to_dummy_rest_object so the identity_type discriminator lookup and subclass _from_job_rest_object attribute access keep working. Validated: smoke+command+spark+sweep 278 passed, pipeline+dsl 490 passed. --- .../azure/ai/ml/entities/_credentials.py | 217 ++++++++++++++---- 1 file changed, 166 insertions(+), 51 deletions(-) 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 4f21d291fb6a..8bd1996e40c7 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 @@ -10,7 +10,9 @@ from typing_extensions import TypeAlias from azure.ai.ml._azure_environments import _get_active_directory_url_from_metadata -from azure.ai.ml._restclient.arm_ml_service.models import ManagedServiceIdentity as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import ( + ManagedServiceIdentity as RestIdentityConfiguration, +) from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionManagedIdentity as RestWorkspaceConnectionManagedIdentity, ) @@ -23,7 +25,9 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionSharedAccessSignature as RestWorkspaceConnectionSharedAccessSignature, ) -from azure.ai.ml._restclient.arm_ml_service.models import UserAssignedIdentity as RestUserAssignedIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( + UserAssignedIdentity as RestUserAssignedIdentity, +) from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionUsernamePassword as RestWorkspaceConnectionUsernamePassword, ) @@ -33,25 +37,42 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( AccountKeyDatastoreSecrets as RestAccountKeyDatastoreSecrets, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import AmlToken as RestAmlToken +from azure.ai.ml._restclient.arm_ml_service.models import AmlToken as RestAmlToken from azure.ai.ml._restclient.arm_ml_service.models import ( CertificateDatastoreCredentials as RestCertificateDatastoreCredentials, ) -from azure.ai.ml._restclient.arm_ml_service.models import CertificateDatastoreSecrets, CredentialsType -from azure.ai.ml._restclient.v2023_04_01_preview.models import IdentityConfiguration as RestJobIdentityConfiguration -from azure.ai.ml._restclient.v2023_04_01_preview.models import IdentityConfigurationType -from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedIdentity as RestJobManagedIdentity -from azure.ai.ml._restclient.v2023_04_01_preview.models import ManagedServiceIdentity as RestRegistryManagedIdentity -from azure.ai.ml._restclient.arm_ml_service.models import NoneDatastoreCredentials as RestNoneDatastoreCredentials -from azure.ai.ml._restclient.arm_ml_service.models import SasDatastoreCredentials as RestSasDatastoreCredentials -from azure.ai.ml._restclient.arm_ml_service.models import SasDatastoreSecrets as RestSasDatastoreSecrets +from azure.ai.ml._restclient.arm_ml_service.models import ( + CertificateDatastoreSecrets, + CredentialsType, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + IdentityConfiguration as RestJobIdentityConfiguration, +) +from azure.ai.ml._restclient.arm_ml_service.models import IdentityConfigurationType +from azure.ai.ml._restclient.arm_ml_service.models import ( + ManagedIdentity as RestJobManagedIdentity, +) +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + ManagedServiceIdentity as RestRegistryManagedIdentity, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + NoneDatastoreCredentials as RestNoneDatastoreCredentials, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + SasDatastoreCredentials as RestSasDatastoreCredentials, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + SasDatastoreSecrets as RestSasDatastoreSecrets, +) from azure.ai.ml._restclient.arm_ml_service.models import ( ServicePrincipalDatastoreCredentials as RestServicePrincipalDatastoreCredentials, ) from azure.ai.ml._restclient.arm_ml_service.models import ( ServicePrincipalDatastoreSecrets as RestServicePrincipalDatastoreSecrets, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import UserIdentity as RestUserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( + UserIdentity as RestUserIdentity, +) from azure.ai.ml._restclient.v2023_04_01_preview.models import ( WorkspaceConnectionAccessKey as RestWorkspaceConnectionAccessKey, ) @@ -78,8 +99,18 @@ from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils.utils import _snake_to_camel, camel_to_snake, snake_to_pascal from azure.ai.ml.constants._common import CommonYamlFields, IdentityType -from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin, YamlTranslatableMixin -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, JobException, ValidationErrorType, ValidationException +from azure.ai.ml.entities._mixins import ( + DictMixin, + RestTranslatableMixin, + YamlTranslatableMixin, +) +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + JobException, + ValidationErrorType, + ValidationException, +) # arm_ml_service unifies these into single models; keep legacy alias names for usage sites. Annotate as # ``TypeAlias`` so mypy treats them as valid types in annotations (a bare ``X = Y`` re-alias of an @@ -134,7 +165,9 @@ def _to_datastore_rest_object(self) -> RestAccountKeyDatastoreCredentials: return RestAccountKeyDatastoreCredentials(secrets=secrets) @classmethod - def _from_datastore_rest_object(cls, obj: RestAccountKeyDatastoreCredentials) -> "AccountKeyConfiguration": + def _from_datastore_rest_object( + cls, obj: RestAccountKeyDatastoreCredentials + ) -> "AccountKeyConfiguration": return cls(account_key=obj.secrets.key if obj.secrets else None) @classmethod @@ -145,7 +178,9 @@ def _from_workspace_connection_rest_object( # rest object as sas token configs return cls(account_key=obj.sas if obj is not None and obj.sas else None) - def _to_workspace_connection_rest_object(self) -> RestWorkspaceConnectionSharedAccessSignature: + def _to_workspace_connection_rest_object( + self, + ) -> RestWorkspaceConnectionSharedAccessSignature: return RestWorkspaceConnectionSharedAccessSignature(sas=self.account_key) def __eq__(self, other: object) -> bool: @@ -176,10 +211,14 @@ def _to_datastore_rest_object(self) -> RestSasDatastoreCredentials: return RestSasDatastoreCredentials(secrets=secrets) @classmethod - def _from_datastore_rest_object(cls, obj: RestSasDatastoreCredentials) -> "SasTokenConfiguration": + def _from_datastore_rest_object( + cls, obj: RestSasDatastoreCredentials + ) -> "SasTokenConfiguration": return cls(sas_token=obj.secrets.sas_token if obj.secrets else None) - def _to_workspace_connection_rest_object(self) -> RestWorkspaceConnectionSharedAccessSignature: + def _to_workspace_connection_rest_object( + self, + ) -> RestWorkspaceConnectionSharedAccessSignature: return RestWorkspaceConnectionSharedAccessSignature(sas=self.sas_token) @classmethod @@ -222,7 +261,9 @@ def __init__(self, *, pat: Optional[str]) -> None: self.type = camel_to_snake(ConnectionAuthType.PAT) self.pat = pat - def _to_workspace_connection_rest_object(self) -> RestWorkspaceConnectionPersonalAccessToken: + def _to_workspace_connection_rest_object( + self, + ) -> RestWorkspaceConnectionPersonalAccessToken: return RestWorkspaceConnectionPersonalAccessToken(pat=self.pat) @classmethod @@ -261,8 +302,12 @@ def __init__( self.username = username self.password = password - def _to_workspace_connection_rest_object(self) -> RestWorkspaceConnectionUsernamePassword: - return RestWorkspaceConnectionUsernamePassword(username=self.username, password=self.password) + def _to_workspace_connection_rest_object( + self, + ) -> RestWorkspaceConnectionUsernamePassword: + return RestWorkspaceConnectionUsernamePassword( + username=self.username, password=self.password + ) @classmethod def _from_workspace_connection_rest_object( @@ -351,7 +396,9 @@ def _from_datastore_rest_object( client_secret=obj.secrets.client_secret if obj.secrets else None, ) - def _to_workspace_connection_rest_object(self) -> RestWorkspaceConnectionServicePrincipal: + def _to_workspace_connection_rest_object( + self, + ) -> RestWorkspaceConnectionServicePrincipal: return RestWorkspaceConnectionServicePrincipal( client_id=self.client_id, client_secret=self.client_secret, @@ -364,7 +411,9 @@ def _from_workspace_connection_rest_object( ) -> "ServicePrincipalConfiguration": return cls( client_id=obj.client_id if obj is not None and obj.client_id else None, - client_secret=obj.client_secret if obj is not None and obj.client_secret else None, + client_secret=( + obj.client_secret if obj is not None and obj.client_secret else None + ), tenant_id=obj.tenant_id if obj is not None and obj.tenant_id else None, authority_url="", ) @@ -412,7 +461,9 @@ def _to_datastore_rest_object(self) -> RestCertificateDatastoreCredentials: ) @classmethod - def _from_datastore_rest_object(cls, obj: RestCertificateDatastoreCredentials) -> "CertificateConfiguration": + def _from_datastore_rest_object( + cls, obj: RestCertificateDatastoreCredentials + ) -> "CertificateConfiguration": return cls( authority_url=obj.authority_url, resource_url=obj.resource_url, @@ -438,12 +489,16 @@ def __ne__(self, other: object) -> bool: return not self.__eq__(other) -class _BaseJobIdentityConfiguration(ABC, RestTranslatableMixin, DictMixin, YamlTranslatableMixin): +class _BaseJobIdentityConfiguration( + ABC, RestTranslatableMixin, DictMixin, YamlTranslatableMixin +): def __init__(self) -> None: self.type = None @classmethod - def _from_rest_object(cls, obj: RestJobIdentityConfiguration) -> "RestIdentityConfiguration": + def _from_rest_object( + cls, obj: RestJobIdentityConfiguration + ) -> "RestIdentityConfiguration": if obj is None: return None mapping = { @@ -454,7 +509,13 @@ def _from_rest_object(cls, obj: RestJobIdentityConfiguration) -> "RestIdentityCo if isinstance(obj, dict): # TODO: support data binding expression - obj = RestJobIdentityConfiguration.from_dict(obj) + # The shared arm_ml_service ``IdentityConfiguration`` hybrid model has no ``from_dict``. + # The node-level rest object is a snake_case attribute dict, so wrap it in a dummy rest + # object that supports the attribute access the subclass ``_from_job_rest_object`` methods + # (and the ``identity_type`` discriminator lookup below) rely on. + from azure.ai.ml.entities._util import from_rest_dict_to_dummy_rest_object + + obj = from_rest_dict_to_dummy_rest_object(obj) identity_class = mapping.get(obj.identity_type, None) if identity_class: @@ -479,7 +540,11 @@ def _from_rest_object(cls, obj: RestJobIdentityConfiguration) -> "RestIdentityCo def _load( cls, data: Dict, - ) -> Union["ManagedIdentityConfiguration", "UserIdentityConfiguration", "AmlTokenConfiguration"]: + ) -> Union[ + "ManagedIdentityConfiguration", + "UserIdentityConfiguration", + "AmlTokenConfiguration", + ]: type_str = data.get(CommonYamlFields.TYPE) if type_str == IdentityType.MANAGED_IDENTITY: return ManagedIdentityConfiguration._load_from_dict(data) @@ -529,8 +594,12 @@ def __init__( self.object_id = object_id self.principal_id = principal_id - def _to_workspace_connection_rest_object(self) -> RestWorkspaceConnectionManagedIdentity: - return RestWorkspaceConnectionManagedIdentity(client_id=self.client_id, resource_id=self.resource_id) + def _to_workspace_connection_rest_object( + self, + ) -> RestWorkspaceConnectionManagedIdentity: + return RestWorkspaceConnectionManagedIdentity( + client_id=self.client_id, resource_id=self.resource_id + ) @classmethod def _from_workspace_connection_rest_object( @@ -549,7 +618,9 @@ def _to_job_rest_object(self) -> RestJobManagedIdentity: ) @classmethod - def _from_job_rest_object(cls, obj: RestJobManagedIdentity) -> "ManagedIdentityConfiguration": + def _from_job_rest_object( + cls, obj: RestJobManagedIdentity + ) -> "ManagedIdentityConfiguration": return cls( client_id=obj.client_id, object_id=obj.client_id, @@ -578,7 +649,9 @@ def _to_workspace_rest_object(self) -> RestUserAssignedIdentityConfiguration: ) @classmethod - def _from_workspace_rest_object(cls, obj: RestUserAssignedIdentityConfiguration) -> "ManagedIdentityConfiguration": + def _from_workspace_rest_object( + cls, obj: RestUserAssignedIdentityConfiguration + ) -> "ManagedIdentityConfiguration": return cls( principal_id=obj.principal_id, client_id=obj.client_id, @@ -602,7 +675,9 @@ def _load_from_dict(cls, data: Dict) -> "ManagedIdentityConfiguration": def __eq__(self, other: object) -> bool: if not isinstance(other, ManagedIdentityConfiguration): return NotImplemented - return self.client_id == other.client_id and self.resource_id == other.resource_id + return ( + self.client_id == other.client_id and self.resource_id == other.resource_id + ) @classmethod def _get_rest_properties_class(cls) -> Type: @@ -721,19 +796,27 @@ def __init__( def _to_compute_rest_object(self) -> RestIdentityConfiguration: rest_user_assigned_identities = ( - {uai.resource_id: uai._to_identity_configuration_rest_object() for uai in self.user_assigned_identities} + { + uai.resource_id: uai._to_identity_configuration_rest_object() + for uai in self.user_assigned_identities + } if self.user_assigned_identities else None ) return RestIdentityConfiguration( - type=snake_to_pascal(self.type), user_assigned_identities=rest_user_assigned_identities + type=snake_to_pascal(self.type), + user_assigned_identities=rest_user_assigned_identities, ) @classmethod - def _from_compute_rest_object(cls, obj: RestIdentityConfiguration) -> "IdentityConfiguration": + def _from_compute_rest_object( + cls, obj: RestIdentityConfiguration + ) -> "IdentityConfiguration": from_rest_user_assigned_identities = ( [ - ManagedIdentityConfiguration._from_identity_configuration_rest_object(uai, resource_id=resource_id) + ManagedIdentityConfiguration._from_identity_configuration_rest_object( + uai, resource_id=resource_id + ) for (resource_id, uai) in obj.user_assigned_identities.items() ] if obj.user_assigned_identities @@ -747,9 +830,14 @@ def _from_compute_rest_object(cls, obj: RestIdentityConfiguration) -> "IdentityC result.tenant_id = obj.tenant_id return result - def _to_online_endpoint_rest_object(self) -> RestManagedServiceIdentityConfiguration: + def _to_online_endpoint_rest_object( + self, + ) -> RestManagedServiceIdentityConfiguration: rest_user_assigned_identities = ( - {uai.resource_id: uai._to_online_endpoint_rest_object() for uai in self.user_assigned_identities} + { + uai.resource_id: uai._to_online_endpoint_rest_object() + for uai in self.user_assigned_identities + } if self.user_assigned_identities else None ) @@ -762,10 +850,14 @@ def _to_online_endpoint_rest_object(self) -> RestManagedServiceIdentityConfigura ) @classmethod - def _from_online_endpoint_rest_object(cls, obj: RestManagedServiceIdentityConfiguration) -> "IdentityConfiguration": + def _from_online_endpoint_rest_object( + cls, obj: RestManagedServiceIdentityConfiguration + ) -> "IdentityConfiguration": from_rest_user_assigned_identities = ( [ - ManagedIdentityConfiguration._from_identity_configuration_rest_object(uai, resource_id=resource_id) + ManagedIdentityConfiguration._from_identity_configuration_rest_object( + uai, resource_id=resource_id + ) for (resource_id, uai) in obj.user_assigned_identities.items() ] if obj.user_assigned_identities @@ -780,10 +872,14 @@ def _from_online_endpoint_rest_object(cls, obj: RestManagedServiceIdentityConfig return result @classmethod - def _from_workspace_rest_object(cls, obj: RestManagedServiceIdentityConfiguration) -> "IdentityConfiguration": + def _from_workspace_rest_object( + cls, obj: RestManagedServiceIdentityConfiguration + ) -> "IdentityConfiguration": from_rest_user_assigned_identities = ( [ - ManagedIdentityConfiguration._from_identity_configuration_rest_object(uai, resource_id=resource_id) + ManagedIdentityConfiguration._from_identity_configuration_rest_object( + uai, resource_id=resource_id + ) for (resource_id, uai) in obj.user_assigned_identities.items() ] if obj.user_assigned_identities @@ -799,12 +895,16 @@ def _from_workspace_rest_object(cls, obj: RestManagedServiceIdentityConfiguratio def _to_workspace_rest_object(self) -> RestManagedServiceIdentityConfiguration: rest_user_assigned_identities = ( - {uai.resource_id: uai._to_workspace_rest_object() for uai in self.user_assigned_identities} + { + uai.resource_id: uai._to_workspace_rest_object() + for uai in self.user_assigned_identities + } if self.user_assigned_identities else None ) return RestManagedServiceIdentityConfiguration( - type=snake_to_pascal(self.type), user_assigned_identities=rest_user_assigned_identities + type=snake_to_pascal(self.type), + user_assigned_identities=rest_user_assigned_identities, ) def _to_rest_object(self) -> RestRegistryManagedIdentity: @@ -815,7 +915,9 @@ def _to_rest_object(self) -> RestRegistryManagedIdentity: ) @classmethod - def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfiguration": + def _from_rest_object( + cls, obj: RestRegistryManagedIdentity + ) -> "IdentityConfiguration": result = cls( type=obj.type, user_assigned_identities=None, @@ -838,7 +940,9 @@ def _to_datastore_rest_object(self) -> RestNoneDatastoreCredentials: @classmethod # pylint: disable=unused-argument - def _from_datastore_rest_object(cls, obj: RestNoneDatastoreCredentials) -> "NoneCredentialConfiguration": + def _from_datastore_rest_object( + cls, obj: RestNoneDatastoreCredentials + ) -> "NoneCredentialConfiguration": return cls() def _to_workspace_connection_rest_object(self) -> None: @@ -868,7 +972,9 @@ def _to_datastore_rest_object(self) -> RestNoneDatastoreCredentials: @classmethod # pylint: disable=unused-argument - def _from_datastore_rest_object(cls, obj: RestNoneDatastoreCredentials) -> "AadCredentialConfiguration": + def _from_datastore_rest_object( + cls, obj: RestNoneDatastoreCredentials + ) -> "AadCredentialConfiguration": return cls() # Has no credential object, just a property bag class. @@ -918,14 +1024,23 @@ def _from_workspace_connection_rest_object( cls, obj: Optional[RestWorkspaceConnectionAccessKey] ) -> "AccessKeyConfiguration": return cls( - access_key_id=obj.access_key_id if obj is not None and obj.access_key_id else None, - secret_access_key=obj.secret_access_key if obj is not None and obj.secret_access_key else None, + access_key_id=( + obj.access_key_id if obj is not None and obj.access_key_id else None + ), + secret_access_key=( + obj.secret_access_key + if obj is not None and obj.secret_access_key + else None + ), ) def __eq__(self, other: object) -> bool: if not isinstance(other, AccessKeyConfiguration): return NotImplemented - return self.access_key_id == other.access_key_id and self.secret_access_key == other.secret_access_key + return ( + self.access_key_id == other.access_key_id + and self.secret_access_key == other.secret_access_key + ) def _get_rest_properties_class(self): return AccessKeyAuthTypeWorkspaceConnectionProperties From 653932681102b8bac00634f3e97be13ad5579ee2 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 11:48:38 +0530 Subject: [PATCH 028/146] Migrate spark builder read-path annotations to arm_ml_service JobBase/SparkJob --- .../azure/ai/ml/entities/_builders/spark.py | 139 ++++++++++++++---- 1 file changed, 108 insertions(+), 31 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py index 08b759e69059..11bb9fc1e0f1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py @@ -13,10 +13,14 @@ from marshmallow import INCLUDE, Schema -from ..._restclient.v2023_04_01_preview.models import JobBase as JobBaseData -from ..._restclient.v2023_04_01_preview.models import SparkJob as RestSparkJob +from ..._restclient.arm_ml_service.models import JobBase as JobBaseData +from ..._restclient.arm_ml_service.models import SparkJob as RestSparkJob from ..._schema import NestedField, PathAwareSchema, UnionField -from ..._schema.job.identity import AMLTokenIdentitySchema, ManagedIdentitySchema, UserIdentitySchema +from ..._schema.job.identity import ( + AMLTokenIdentitySchema, + ManagedIdentitySchema, + UserIdentitySchema, +) from ..._schema.job.parameterized_spark import CONF_KEY_MAP from ..._schema.job.spark_job import SparkJobSchema from ..._utils.utils import is_url @@ -55,7 +59,12 @@ _validate_spark_configurations, ) from .._job.spark_job_entry_mixin import SparkJobEntry, SparkJobEntryMixin -from .._util import convert_ordered_dict_to_dict, get_rest_dict_for_node_attrs, load_from_dict, validate_attribute_type +from .._util import ( + convert_ordered_dict_to_dict, + get_rest_dict_for_node_attrs, + load_from_dict, + validate_attribute_type, +) from .base_node import BaseNode module_logger = logging.getLogger(__name__) @@ -137,7 +146,12 @@ def __init__( *, component: Union[str, SparkComponent], identity: Optional[ - Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] + Union[ + Dict, + ManagedIdentityConfiguration, + AmlTokenConfiguration, + UserIdentityConfiguration, + ] ] = None, driver_cores: Optional[Union[int, str]] = None, driver_memory: Optional[str] = None, @@ -175,11 +189,19 @@ def __init__( **kwargs: Any, ) -> None: # validate init params are valid type - validate_attribute_type(attrs_to_check=locals(), attr_type_map=self._attr_type_map()) + validate_attribute_type( + attrs_to_check=locals(), attr_type_map=self._attr_type_map() + ) kwargs.pop("type", None) BaseNode.__init__( - self, type=NodeType.SPARK, inputs=inputs, outputs=outputs, component=component, compute=compute, **kwargs + self, + type=NodeType.SPARK, + inputs=inputs, + outputs=outputs, + component=component, + compute=compute, + **kwargs, ) # init mark for _AttrDict @@ -205,15 +227,24 @@ def __init__( self.driver_memory = self.driver_memory or _component.driver_memory self.executor_cores = self.executor_cores or _component.executor_cores self.executor_memory = self.executor_memory or _component.executor_memory - self.executor_instances = self.executor_instances or _component.executor_instances - self.dynamic_allocation_enabled = self.dynamic_allocation_enabled or _component.dynamic_allocation_enabled + self.executor_instances = ( + self.executor_instances or _component.executor_instances + ) + self.dynamic_allocation_enabled = ( + self.dynamic_allocation_enabled or _component.dynamic_allocation_enabled + ) self.dynamic_allocation_min_executors = ( - self.dynamic_allocation_min_executors or _component.dynamic_allocation_min_executors + self.dynamic_allocation_min_executors + or _component.dynamic_allocation_min_executors ) self.dynamic_allocation_max_executors = ( - self.dynamic_allocation_max_executors or _component.dynamic_allocation_max_executors + self.dynamic_allocation_max_executors + or _component.dynamic_allocation_max_executors ) - if self.executor_instances is None and str(self.dynamic_allocation_enabled).lower() == "true": + if ( + self.executor_instances is None + and str(self.dynamic_allocation_enabled).lower() == "true" + ): self.executor_instances = self.dynamic_allocation_min_executors # When create standalone job or pipeline job, following fields will always get value from component or get # default None, because we will not pass those fields to Spark. But in following cases, we expect to get @@ -260,7 +291,9 @@ def resources(self) -> Optional[Union[Dict, SparkResourceConfiguration]]: return self._resources # type: ignore @resources.setter - def resources(self, value: Optional[Union[Dict, SparkResourceConfiguration]]) -> None: + def resources( + self, value: Optional[Union[Dict, SparkResourceConfiguration]] + ) -> None: """Sets the compute resource configuration for the job. :param value: The compute resource configuration for the job. @@ -273,7 +306,14 @@ def resources(self, value: Optional[Union[Dict, SparkResourceConfiguration]]) -> @property def identity( self, - ) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: + ) -> Optional[ + Union[ + Dict, + ManagedIdentityConfiguration, + AmlTokenConfiguration, + UserIdentityConfiguration, + ] + ]: """The identity that the Spark job will use while running on compute. :rtype: Union[~azure.ai.ml.entities.ManagedIdentityConfiguration, ~azure.ai.ml.entities.AmlTokenConfiguration, @@ -293,7 +333,12 @@ def identity( def identity( self, value: Optional[ - Union[Dict[str, str], ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] + Union[ + Dict[str, str], + ManagedIdentityConfiguration, + AmlTokenConfiguration, + UserIdentityConfiguration, + ] ], ) -> None: """Sets the identity that the Spark job will use while running on compute. @@ -347,10 +392,14 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: obj = super()._from_rest_object_to_init_params(obj) if "resources" in obj and obj["resources"]: - obj["resources"] = SparkResourceConfiguration._from_rest_object(obj["resources"]) + obj["resources"] = SparkResourceConfiguration._from_rest_object( + obj["resources"] + ) if "identity" in obj and obj["identity"]: - obj["identity"] = _BaseJobIdentityConfiguration._from_rest_object(obj["identity"]) + obj["identity"] = _BaseJobIdentityConfiguration._from_rest_object( + obj["identity"] + ) if "entry" in obj and obj["entry"]: obj["entry"] = SparkJobEntry._from_rest_object(obj["entry"]) @@ -364,11 +413,17 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: return obj @classmethod - def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Spark": + def _load_from_dict( + cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any + ) -> "Spark": from .spark_func import spark - loaded_data = load_from_dict(SparkJobSchema, data, context, additional_message, **kwargs) - spark_job: Spark = spark(base_path=context[BASE_PATH_CONTEXT_KEY], **loaded_data) + loaded_data = load_from_dict( + SparkJobSchema, data, context, additional_message, **kwargs + ) + spark_job: Spark = spark( + base_path=context[BASE_PATH_CONTEXT_KEY], **loaded_data + ) return spark_job @@ -407,11 +462,21 @@ def _load_from_rest_job(cls, obj: JobBaseData) -> "Spark": driver_memory=rest_spark_conf.get(SparkConfKey.DRIVER_MEMORY, None), executor_cores=rest_spark_conf.get(SparkConfKey.EXECUTOR_CORES, None), executor_memory=rest_spark_conf.get(SparkConfKey.EXECUTOR_MEMORY, None), - executor_instances=rest_spark_conf.get(SparkConfKey.EXECUTOR_INSTANCES, None), - dynamic_allocation_enabled=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_ENABLED, None), - dynamic_allocation_min_executors=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_MIN_EXECUTORS, None), - dynamic_allocation_max_executors=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None), - resources=SparkResourceConfiguration._from_rest_object(rest_spark_job.resources), + executor_instances=rest_spark_conf.get( + SparkConfKey.EXECUTOR_INSTANCES, None + ), + dynamic_allocation_enabled=rest_spark_conf.get( + SparkConfKey.DYNAMIC_ALLOCATION_ENABLED, None + ), + dynamic_allocation_min_executors=rest_spark_conf.get( + SparkConfKey.DYNAMIC_ALLOCATION_MIN_EXECUTORS, None + ), + dynamic_allocation_max_executors=rest_spark_conf.get( + SparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None + ), + resources=SparkResourceConfiguration._from_rest_object( + rest_spark_job.resources + ), inputs=from_rest_inputs_to_dataset_literal(rest_spark_job.inputs), outputs=from_rest_data_outputs(rest_spark_job.outputs), ) @@ -498,7 +563,9 @@ def _to_job(self) -> SparkJob: ) @classmethod - def _create_schema_for_validation(cls, context: Any) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context: Any + ) -> Union[PathAwareSchema, Schema]: from azure.ai.ml._schema.pipeline import SparkSchema return SparkSchema(context=context) @@ -565,7 +632,11 @@ def _validate_entry_exist(self) -> MutableValidationResult: ) validation_result = self._create_empty_validation_result() # validate whether component entry exists to ensure code path is correct, especially when code is default value - if self.code is None or is_remote_code or not isinstance(self.entry, SparkJobEntry): + if ( + self.code is None + or is_remote_code + or not isinstance(self.entry, SparkJobEntry) + ): # skip validate when code is not a local path or code is None, or self.entry is not SparkJobEntry object pass else: @@ -576,7 +647,8 @@ def _validate_entry_exist(self) -> MutableValidationResult: code_path = code_path.resolve().absolute() else: validation_result.append_error( - message=f"Code path {code_path} doesn't exist.", yaml_path="component.code" + message=f"Code path {code_path} doesn't exist.", + yaml_path="component.code", ) entry_path = code_path / self.entry.entry else: @@ -588,7 +660,8 @@ def _validate_entry_exist(self) -> MutableValidationResult: ): if not entry_path.exists(): validation_result.append_error( - message=f"Entry {entry_path} doesn't exist.", yaml_path="component.entry" + message=f"Entry {entry_path} doesn't exist.", + yaml_path="component.entry", ) return validation_result @@ -608,9 +681,13 @@ def _validate_fields(self) -> MutableValidationResult: if m: io_type, io_name = m.groups() if io_type == "Input": - validation_result.append_error(message=msg, yaml_path=f"inputs.{io_name}") + validation_result.append_error( + message=msg, yaml_path=f"inputs.{io_name}" + ) else: - validation_result.append_error(message=msg, yaml_path=f"outputs.{io_name}") + validation_result.append_error( + message=msg, yaml_path=f"outputs.{io_name}" + ) try: _validate_spark_configurations(self) From 1e14cd53c87bd3d6c98b726a12c338fe1f142f9d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 11:59:03 +0530 Subject: [PATCH 029/146] Migrate _util.py normalize_job_input_output_type imports to arm_ml_service (JobInput/JobOutput annotations + JobInputType enum, identical values) --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py index eddac231a205..6b96807d5b24 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py @@ -12,9 +12,9 @@ import msrest from marshmallow.exceptions import ValidationError -from .._restclient.v2023_04_01_preview.models import JobInput as RestJobInput -from .._restclient.v2023_04_01_preview.models import JobInputType as JobInputType10 -from .._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput +from .._restclient.arm_ml_service.models import JobInput as RestJobInput +from .._restclient.arm_ml_service.models import JobInputType as JobInputType10 +from .._restclient.arm_ml_service.models import JobOutput as RestJobOutput from .._schema._datastore import AzureBlobSchema, AzureDataLakeGen1Schema, AzureDataLakeGen2Schema, AzureFileSchema from .._schema._deployment.batch.batch_deployment import BatchDeploymentSchema from .._schema._deployment.online.online_deployment import ( From cb656166af427ecf9148a86967e70c279afb61ec Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 12:11:37 +0530 Subject: [PATCH 030/146] Migrate pipeline IO read helpers to arm_ml_service JobInput/JobOutput Flip InputDeliveryMode, JobInput and JobOutput imports in _pipeline_job_helpers.py and the pipeline _io/mixin.py to the shared arm_ml_service hybrid client. These build the transient rest input/output objects consumed in-module by from_rest_inputs_to_dataset_literal / from_rest_data_outputs, so there is no wire impact. from_dict_to_rest_io previously did rest_object_class.from_dict(val) on a snake_case dict. arm hybrid models have no from_dict and their _deserialize needs camelCase wire keys, so branch on hasattr(from_dict): msrest uses from_dict directly; arm converts keys via snake_to_camel then _deserialize, which rebuilds the correct discriminated subtype (e.g. UriFileJobInput) exactly like msrest did. Verified InputDeliveryMode enum values and the resulting discriminated subtype match v2023_04. Ray/Mpi/PyTorch/TensorFlow stay on v2023_04 in _pipeline_job_helpers.py's from_dict_to_rest_distribution because arm has no Ray distribution subtype. Validated: smoke+pipeline+dsl 636 passed. --- .../ai/ml/entities/_job/pipeline/_io/mixin.py | 4 +- .../_job/pipeline/_pipeline_job_helpers.py | 57 +++++++++++++++---- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 50ae5d77a62e..091bf4ea180b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -5,8 +5,8 @@ import copy from typing import Any, Dict, List, Optional, Tuple, Type, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import ( JobOutput as RestJobOutput, ) from azure.ai.ml.constants._component import ComponentJobConstants diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py index 3a7d89e75985..b301279007d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py @@ -4,10 +4,19 @@ import re from typing import Dict, List, Tuple, Type, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import InputDeliveryMode -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput -from azure.ai.ml._restclient.v2023_04_01_preview.models import Mpi, PyTorch, Ray, TensorFlow +from azure.ai.ml._restclient.arm_ml_service.models import InputDeliveryMode +from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput +from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput + +# Ray has no arm_ml_service subtype (arm DistributionType only has PyTorch/TensorFlow/Mpi), so the +# distribution helper below must keep building the msrest v2023_04 distribution models. +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + Mpi, + PyTorch, + Ray, + TensorFlow, +) +from azure.ai.ml._utils.utils import snake_to_camel from azure.ai.ml.constants._component import ComponentJobConstants from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job._input_output_helpers import ( @@ -55,9 +64,13 @@ def process_sdk_component_job_io( # add mode to literal value for binding input if mode: if isinstance(io_value, Input): - io_bindings[io_name].update({"mode": INPUT_MOUNT_MAPPING_TO_REST[mode]}) + io_bindings[io_name].update( + {"mode": INPUT_MOUNT_MAPPING_TO_REST[mode]} + ) else: - io_bindings[io_name].update({"mode": OUTPUT_MOUNT_MAPPING_TO_REST[mode]}) + io_bindings[io_name].update( + {"mode": OUTPUT_MOUNT_MAPPING_TO_REST[mode]} + ) if name or version: assert isinstance(io_value, Output) if name: @@ -73,7 +86,9 @@ def process_sdk_component_job_io( msg = "{} has changed to {}, please change to use new format." raise ValidationException( message=msg.format(path, new_format), - no_personal_data_message=msg.format("[io_value]", "[io_value_new_format]"), + no_personal_data_message=msg.format( + "[io_value]", "[io_value_new_format]" + ), target=ErrorTarget.PIPELINE, error_category=ErrorCategory.USER_ERROR, ) @@ -128,9 +143,13 @@ def from_dict_to_rest_io( io_mode = DIRTY_MODE_MAPPING[io_mode] val["mode"] = io_mode if io_mode in OUTPUT_MOUNT_MAPPING_FROM_REST: - io_bindings[key].update({"mode": OUTPUT_MOUNT_MAPPING_FROM_REST[io_mode]}) + io_bindings[key].update( + {"mode": OUTPUT_MOUNT_MAPPING_FROM_REST[io_mode]} + ) else: - io_bindings[key].update({"mode": INPUT_MOUNT_MAPPING_FROM_REST[io_mode]}) + io_bindings[key].update( + {"mode": INPUT_MOUNT_MAPPING_FROM_REST[io_mode]} + ) # add name and version for binding input if io_name or io_version: assert rest_object_class.__name__ == "JobOutput" @@ -150,7 +169,17 @@ def from_dict_to_rest_io( val["asset_name"] = val.pop("name") if "version" in val.keys(): val["asset_version"] = val.pop("version") - rest_obj = rest_object_class.from_dict(val) + if hasattr(rest_object_class, "from_dict"): + # msrest model: ``from_dict`` accepts the snake_case ``val`` directly. + rest_obj = rest_object_class.from_dict(val) + else: + # arm_ml_service hybrid model: it has no ``from_dict`` and ``_deserialize`` needs + # camelCase wire keys, so convert the snake_case ``val`` first. This rebuilds the + # correct discriminated subtype (e.g. UriFileJobInput) just like msrest did. + camel_val = {snake_to_camel(k): v for k, v in val.items()} + rest_obj = rest_object_class._deserialize( + camel_val, [] + ) # pylint: disable=protected-access rest_io_objects[key] = rest_obj else: msg = "Got unsupported type of input/output: {}:" + f"{type(val)}" @@ -163,7 +192,9 @@ def from_dict_to_rest_io( return io_bindings, rest_io_objects -def from_dict_to_rest_distribution(distribution_dict: Dict) -> Union[PyTorch, Mpi, TensorFlow, Ray]: +def from_dict_to_rest_distribution( + distribution_dict: Dict, +) -> Union[PyTorch, Mpi, TensorFlow, Ray]: target_type = distribution_dict["distribution_type"].lower() if target_type == "pytorch": return PyTorch(**distribution_dict) @@ -173,7 +204,9 @@ def from_dict_to_rest_distribution(distribution_dict: Dict) -> Union[PyTorch, Mp return TensorFlow(**distribution_dict) if target_type == "ray": return Ray(**distribution_dict) - msg = "Distribution type must be pytorch, mpi, tensorflow or ray: {}".format(target_type) + msg = "Distribution type must be pytorch, mpi, tensorflow or ray: {}".format( + target_type + ) raise ValidationException( message=msg, no_personal_data_message=msg, From fd80f90536d76207f51eb7c8bcdcad8d7d0ddb14 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 14:45:34 +0530 Subject: [PATCH 031/146] Migrate base Component entity to arm_ml_service ComponentVersion models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flip ComponentContainer, ComponentContainerProperties, ComponentVersion and ComponentVersionProperties imports in entities/_component/component.py to the shared arm_ml_service hybrid client (pipeline_component.py was already on arm). The msrest v2024_01 client's Serializer reads an arm model body and produces byte-identical wire, so the entity migrates independently of the component operations client. Set is_archived=False explicitly in _to_rest_object because the v2024_01 model defaulted it to False and always emitted isArchived:false, while the arm model does not default it — verified byte-identical (BYTE EQUAL True) and the smoke golden component wire retains isArchived:false. Fixed test-side casing in the component/dsl/pipeline_job test suites: arm .as_dict() emits camelCase (componentSpec/isAnonymous) while the tests expect snake_case from the prior msrest .as_dict(); swap to as_attribute_dict(...) which yields snake matching the old output. Validated: smoke 146/146, component units 122 passed, pipeline+dsl 490 passed. --- .../ai/ml/entities/_component/component.py | 113 ++++-- .../test_command_component_entity.py | 334 ++++++++++++++---- .../test_data_transfer_component_entity.py | 50 ++- .../unittests/test_flow_component.py | 118 +++++-- .../test_parallel_component_entity.py | 42 ++- .../unittests/test_spark_component_entity.py | 50 ++- .../dsl/unittests/test_command_builder.py | 11 +- .../unittests/test_pipeline_job_entity.py | 4 +- .../unittests/test_pipeline_job_schema.py | 8 +- 9 files changed, 558 insertions(+), 172 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py index 3e8174811ceb..6e7831fb5cc8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py @@ -5,11 +5,22 @@ import uuid from os import PathLike from pathlib import Path -from typing import IO, TYPE_CHECKING, Any, AnyStr, Callable, Dict, Iterable, Optional, Tuple, Union +from typing import ( + IO, + TYPE_CHECKING, + Any, + AnyStr, + Callable, + Dict, + Iterable, + Optional, + Tuple, + Union, +) from marshmallow import INCLUDE -from ..._restclient.v2024_01_01_preview.models import ( +from ..._restclient.arm_ml_service.models import ( ComponentContainer, ComponentContainerProperties, ComponentVersion, @@ -33,7 +44,11 @@ from ...entities._mixins import LocalizableMixin, TelemetryMixin, YamlTranslatableMixin from ...entities._system_data import SystemData from ...entities._util import find_type_in_override -from ...entities._validation import MutableValidationResult, PathAwareSchemaValidatableMixin, RemoteValidatableMixin +from ...entities._validation import ( + MutableValidationResult, + PathAwareSchemaValidatableMixin, + RemoteValidatableMixin, +) from ...exceptions import ErrorCategory, ErrorTarget, ValidationException from .._inputs_outputs import GroupInput @@ -115,7 +130,9 @@ def __init__( self._auto_increment_version = kwargs.pop("auto_increment", False) # Get source from id first, then kwargs. self._source = ( - self._resolve_component_source_from_id(id) if id else kwargs.pop("_source", ComponentSource.CLASS) + self._resolve_component_source_from_id(id) + if id + else kwargs.pop("_source", ComponentSource.CLASS) ) # use ANONYMOUS_COMPONENT_NAME instead of guid is_anonymous = kwargs.pop("is_anonymous", False) @@ -155,7 +172,9 @@ def __init__( @property def _func(self) -> Callable[..., "BaseNode"]: - from azure.ai.ml.entities._job.pipeline._load_component import _generate_component_function + from azure.ai.ml.entities._job.pipeline._load_component import ( + _generate_component_function, + ) # validate input/output names before creating component function validation_result = self._validate_io_names(self.inputs) @@ -261,7 +280,9 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) + dump_yaml_to_file( + dest, yaml_serialized, default_flow_style=False, path=path, **kwargs + ) @staticmethod def _resolve_component_source_from_id( # pylint: disable=docstring-type-do-not-use-class @@ -290,7 +311,9 @@ def _resolve_component_source_from_id( # pylint: disable=docstring-type-do-not- ) @classmethod - def _validate_io_names(cls, io_names: Iterable[str], raise_error: bool = False) -> MutableValidationResult: + def _validate_io_names( + cls, io_names: Iterable[str], raise_error: bool = False + ) -> MutableValidationResult: """Validate input/output names, raise exception if invalid. :param io_names: The names to validate @@ -306,13 +329,16 @@ def _validate_io_names(cls, io_names: Iterable[str], raise_error: bool = False) for name in io_names: if re.match(IOConstants.VALID_KEY_PATTERN, name) is None: msg = "{!r} is not a valid parameter name, must be composed letters, numbers, and underscores." - validation_result.append_error(message=msg.format(name), yaml_path=f"inputs.{name}") + validation_result.append_error( + message=msg.format(name), yaml_path=f"inputs.{name}" + ) # validate name conflict lower_key = name.lower() if lower_key in lower2original_kwargs: msg = "Invalid component input names {!r} and {!r}, which are equal ignore case." validation_result.append_error( - message=msg.format(name, lower2original_kwargs[lower_key]), yaml_path=f"inputs.{name}" + message=msg.format(name, lower2original_kwargs[lower_key]), + yaml_path=f"inputs.{name}", ) else: lower2original_kwargs[lower_key] = name @@ -325,7 +351,9 @@ def _build_io(cls, io_dict: Union[Dict, Input, Output], is_input: bool) -> Dict: if is_input: component_io[name] = port if isinstance(port, Input) else Input(**port) else: - component_io[name] = port if isinstance(port, Output) else Output(**port) + component_io[name] = ( + port if isinstance(port, Output) else Output(**port) + ) if is_input: # Restore flattened parameters to group @@ -338,7 +366,9 @@ def _create_schema_for_validation(cls, context: Any) -> PathAwareSchema: return ComponentSchema(context=context) @classmethod - def _create_validation_error(cls, message: str, no_personal_data_message: str) -> ValidationException: + def _create_validation_error( + cls, message: str, no_personal_data_message: str + ) -> ValidationException: return ValidationException( message=message, no_personal_data_message=no_personal_data_message, @@ -414,13 +444,19 @@ def _load( return new_instance @classmethod - def _from_container_rest_object(cls, component_container_rest_object: ComponentContainer) -> "Component": - component_container_details: ComponentContainerProperties = component_container_rest_object.properties + def _from_container_rest_object( + cls, component_container_rest_object: ComponentContainer + ) -> "Component": + component_container_details: ComponentContainerProperties = ( + component_container_rest_object.properties + ) component = Component( id=component_container_rest_object.id, name=component_container_rest_object.name, description=component_container_details.description, - creation_context=SystemData._from_rest_object(component_container_rest_object.system_data), + creation_context=SystemData._from_rest_object( + component_container_rest_object.system_data + ), tags=component_container_details.tags, properties=component_container_details.properties, type=NodeType._CONTAINER, @@ -435,7 +471,10 @@ def _from_rest_object(cls, obj: ComponentVersion) -> "Component": # TODO: Remove in PuP with native import job/component type support in MFE/Designer # Convert command component back to import component private preview component_spec = obj.properties.component_spec - if component_spec[CommonYamlFields.TYPE] == NodeType.COMMAND and component_spec["command"] == NodeType.IMPORT: + if ( + component_spec[CommonYamlFields.TYPE] == NodeType.COMMAND + and component_spec["command"] == NodeType.IMPORT + ): component_spec[CommonYamlFields.TYPE] = NodeType.IMPORT component_spec["source"] = component_spec.pop("inputs") component_spec["output"] = component_spec.pop("outputs")["output"] @@ -444,7 +483,9 @@ def _from_rest_object(cls, obj: ComponentVersion) -> "Component": # maybe override serialization method for name field? from azure.ai.ml.entities._component.component_factory import component_factory - create_instance_func, _ = component_factory.get_create_funcs(obj.properties.component_spec, for_load=True) + create_instance_func, _ = component_factory.get_create_funcs( + obj.properties.component_spec, for_load=True + ) instance: Component = create_instance_func() # TODO: Bug Item number: 2883415 @@ -468,9 +509,13 @@ def _from_rest_object_to_init_params(cls, obj: ComponentVersion) -> Dict: outputs = rest_component_version.component_spec.pop("outputs", {}) origin_name = rest_component_version.component_spec[CommonYamlFields.NAME] - rest_component_version.component_spec[CommonYamlFields.NAME] = ANONYMOUS_COMPONENT_NAME + rest_component_version.component_spec[CommonYamlFields.NAME] = ( + ANONYMOUS_COMPONENT_NAME + ) init_kwargs = cls._load_with_schema( - rest_component_version.component_spec, context={BASE_PATH_CONTEXT_KEY: Path.cwd()}, unknown=INCLUDE + rest_component_version.component_spec, + context={BASE_PATH_CONTEXT_KEY: Path.cwd()}, + unknown=INCLUDE, ) init_kwargs.update( { @@ -485,7 +530,11 @@ def _from_rest_object_to_init_params(cls, obj: ComponentVersion) -> Dict: # remove empty values, because some property only works for specific component, eg: distribution for command # note that there is an issue that environment == {} will always be true, so use isinstance here - return {k: v for k, v in init_kwargs.items() if v is not None and not (isinstance(v, dict) and not v)} + return { + k: v + for k, v in init_kwargs.items() + if v is not None and not (isinstance(v, dict) and not v) + } def _get_anonymous_hash(self) -> str: """Return the hash of anonymous component. @@ -537,8 +586,12 @@ def _customized_validate(self) -> MutableValidationResult: validation_result = super(Component, self)._customized_validate() # validate inputs names - validation_result.merge_with(self._validate_io_names(self.inputs, raise_error=False)) - validation_result.merge_with(self._validate_io_names(self.outputs, raise_error=False)) + validation_result.merge_with( + self._validate_io_names(self.inputs, raise_error=False) + ) + validation_result.merge_with( + self._validate_io_names(self.outputs, raise_error=False) + ) return validation_result @@ -570,11 +623,17 @@ def _to_rest_object(self) -> ComponentVersion: if self._intellectual_property: # hack while full pass through supported is worked on for IPP fields component.pop("intellectual_property") - component["intellectualProperty"] = self._intellectual_property._to_rest_object() + component["intellectualProperty"] = ( + self._intellectual_property._to_rest_object() + ) properties = ComponentVersionProperties( component_spec=component, description=self.description, is_anonymous=self._is_anonymous, + # The v2024_01 msrest model defaulted is_archived to False and always emitted + # ``isArchived: false`` on the wire. The shared arm_ml_service model does not default it, + # so set it explicitly to keep the serialized body byte-identical to the previous client. + is_archived=False, properties=dict(self.properties) if self.properties else {}, tags=self.tags, ) @@ -583,7 +642,9 @@ def _to_rest_object(self) -> ComponentVersion: result.name = ANONYMOUS_COMPONENT_NAME else: result.name = self.name - result.properties.properties["client_component_hash"] = self._get_component_hash(keys_to_omit=["version"]) + result.properties.properties["client_component_hash"] = ( + self._get_component_hash(keys_to_omit=["version"]) + ) return result def _to_dict(self) -> Dict: @@ -602,7 +663,11 @@ def _localize(self, base_path: str) -> None: :type base_path: str """ if not getattr(self, "id", None): - raise ValueError("Only remote asset can be localize but got a {} without id.".format(type(self))) + raise ValueError( + "Only remote asset can be localize but got a {} without id.".format( + type(self) + ) + ) self._id = None self._creation_context = None self._base_path = base_path diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py index b8fa4efc94cf..d9e2fd2a4ccd 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py @@ -15,10 +15,23 @@ verify_entity_load_and_dump, ) -from azure.ai.ml import Input, MpiDistribution, Output, TensorFlowDistribution, command, load_component +from azure.ai.ml import ( + Input, + MpiDistribution, + Output, + TensorFlowDistribution, + command, + load_component, +) from azure.ai.ml._utils.utils import load_yaml from azure.ai.ml.constants._common import AzureMLResourceType -from azure.ai.ml.entities import CommandComponent, CommandJobLimits, Component, JobResourceConfiguration +from azure.core.serialization import as_attribute_dict +from azure.ai.ml.entities import ( + CommandComponent, + CommandJobLimits, + Component, + JobResourceConfiguration, +) from azure.ai.ml.entities._assets import Code, Environment from azure.ai.ml.entities._builders import Command, Sweep from azure.ai.ml.entities._job.pipeline._io import PipelineInput @@ -46,13 +59,19 @@ class AdditionalIncludesCheckFunc(enum.Enum): class TestCommandComponentEntity: def test_component_load(self): # code is specified in yaml, value is respected - component_yaml = "./tests/test_configs/components/basic_component_code_local_path.yml" + component_yaml = ( + "./tests/test_configs/components/basic_component_code_local_path.yml" + ) def simple_component_validation(command_component): assert command_component.code == "./helloworld_components_with_env" - command_component = verify_entity_load_and_dump(load_component, simple_component_validation, component_yaml)[0] - component_yaml = "./tests/test_configs/components/basic_component_code_arm_id.yml" + command_component = verify_entity_load_and_dump( + load_component, simple_component_validation, component_yaml + )[0] + component_yaml = ( + "./tests/test_configs/components/basic_component_code_arm_id.yml" + ) command_component = load_component( source=component_yaml, ) @@ -69,7 +88,10 @@ def test_command_component_to_dict(self): yaml_dict = load_yaml(yaml_path) yaml_dict["mock_option_param"] = {"mock_key": "mock_val"} command_component = CommandComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert command_component._other_parameter.get("mock_option_param") == yaml_dict["mock_option_param"] + assert ( + command_component._other_parameter.get("mock_option_param") + == yaml_dict["mock_option_param"] + ) yaml_dict["version"] = str(yaml_dict["version"]) component_dict = command_component._to_dict() @@ -93,7 +115,7 @@ def test_command_component_entity(self): code=code, environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", ) - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) omits = [ "properties.component_spec.$schema", "properties.component_spec._source", @@ -103,7 +125,7 @@ def test_command_component_entity(self): yaml_path = "./tests/test_configs/components/basic_component_code_arm_id.yml" yaml_component = load_component(source=yaml_path) - yaml_component_dict = yaml_component._to_rest_object().as_dict() + yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) yaml_component_dict = pydash.omit(yaml_component_dict, *omits) assert component_dict == yaml_component_dict @@ -162,7 +184,9 @@ def test_command_component_entity_with_io_class(self): "data_1": Input(type="uri_file", optional=True), "param_float0": Input(type="number", default=1.1, min=0, max=5), "param_float1": Input(type="number"), - "param_integer": Input(type="integer", default=2, min=-1, max=4, optional=True), + "param_integer": Input( + type="integer", default=2, min=-1, max=4, optional=True + ), "param_string": Input(type="string", default="default_str"), "param_boolean": Input(type="boolean", default=False), }, @@ -175,7 +199,7 @@ def test_command_component_entity_with_io_class(self): command="""echo Hello World""", environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", ) - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) inputs = component_dict["properties"]["component_spec"]["inputs"] outputs = component_dict["properties"]["component_spec"]["outputs"] source = component_dict["properties"]["component_spec"]["_source"] @@ -183,13 +207,27 @@ def test_command_component_entity_with_io_class(self): assert inputs == { "data_0": {"mode": "ro_mount", "type": "uri_folder"}, "data_1": {"type": "uri_file", "optional": True}, - "param_float0": {"type": "number", "default": "1.1", "max": "5.0", "min": "0.0"}, + "param_float0": { + "type": "number", + "default": "1.1", + "max": "5.0", + "min": "0.0", + }, "param_float1": {"type": "number"}, - "param_integer": {"type": "integer", "optional": True, "default": "2", "max": "4", "min": "-1"}, + "param_integer": { + "type": "integer", + "optional": True, + "default": "2", + "max": "4", + "min": "-1", + }, "param_string": {"type": "string", "default": "default_str"}, "param_boolean": {"type": "boolean", "default": "False"}, } - assert outputs == {"train_data_x": {"type": "uri_file"}, "test_data_x": {"type": "uri_folder"}} + assert outputs == { + "train_data_x": {"type": "uri_file"}, + "test_data_x": {"type": "uri_folder"}, + } assert source == "CLASS" def test_command_component_instance_count(self): @@ -199,7 +237,11 @@ def test_command_component_instance_count(self): description="This is the TensorFlow command component", tags={"tag": "tagvalue", "owner": "sdkteam"}, inputs={ - "component_in_number": {"description": "A number", "type": "number", "default": 10.99}, + "component_in_number": { + "description": "A number", + "type": "number", + "default": 10.99, + }, "component_in_path": {"description": "A path", "type": "uri_folder"}, }, outputs={"component_out_path": {"type": "uri_folder"}}, @@ -214,11 +256,13 @@ def test_command_component_instance_count(self): ), instance_count=2, ) - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) - yaml_path = "./tests/test_configs/components/helloworld_component_tensorflow.yml" + yaml_path = ( + "./tests/test_configs/components/helloworld_component_tensorflow.yml" + ) yaml_component = load_component(source=yaml_path) - yaml_component_dict = yaml_component._to_rest_object().as_dict() + yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) component_dict = pydash.omit( component_dict, @@ -251,7 +295,9 @@ def test_command_component_code(self): code="./helloworld_components_with_env", ) - yaml_path = "./tests/test_configs/components/basic_component_code_local_path.yml" + yaml_path = ( + "./tests/test_configs/components/basic_component_code_local_path.yml" + ) yaml_component = load_component(source=yaml_path) assert component.code == yaml_component.code @@ -267,7 +313,9 @@ def test_command_component_code_with_current_folder(self): os.chdir(old_cwd) def test_command_component_code_git_path(self): - from azure.ai.ml.operations._component_operations import _try_resolve_code_for_component + from azure.ai.ml.operations._component_operations import ( + _try_resolve_code_for_component, + ) yaml_path = "./tests/test_configs/components/component_git_path.yml" yaml_dict = load_yaml(yaml_path) @@ -291,7 +339,9 @@ def test_command_component_version_as_a_function(self): "_source": "YAML.COMPONENT", } - yaml_path = "./tests/test_configs/components/basic_component_code_local_path.yml" + yaml_path = ( + "./tests/test_configs/components/basic_component_code_local_path.yml" + ) yaml_component_version = load_component(source=yaml_path) assert isinstance(yaml_component_version, CommandComponent) @@ -310,14 +360,20 @@ def test_command_component_version_as_a_function(self): # unknown kw arg with pytest.raises(UnexpectedKeywordError) as error_info: yaml_component_version(unknown=1) - assert "[component] CommandComponentBasic() got an unexpected keyword argument 'unknown'." in str(error_info) + assert ( + "[component] CommandComponentBasic() got an unexpected keyword argument 'unknown'." + in str(error_info) + ) def test_command_component_version_as_a_function_with_inputs(self): expected_rest_component = { "componentId": "fake_component", "inputs": { "component_in_number": {"job_input_type": "literal", "value": "10"}, - "component_in_path": {"job_input_type": "literal", "value": "${{parent.inputs.pipeline_input}}"}, + "component_in_path": { + "job_input_type": "literal", + "value": "${{parent.inputs.pipeline_input}}", + }, }, "type": "command", "_source": "YAML.COMPONENT", @@ -325,8 +381,12 @@ def test_command_component_version_as_a_function_with_inputs(self): yaml_path = "./tests/test_configs/components/helloworld_component.yml" yaml_component_version = load_component(source=yaml_path) - pipeline_input = PipelineInput(name="pipeline_input", owner="pipeline", meta=None) - yaml_component = yaml_component_version(component_in_number=10, component_in_path=pipeline_input) + pipeline_input = PipelineInput( + name="pipeline_input", owner="pipeline", meta=None + ) + yaml_component = yaml_component_version( + component_in_number=10, component_in_path=pipeline_input + ) yaml_component._component = "fake_component" rest_yaml_component = yaml_component._to_rest_object() @@ -352,8 +412,12 @@ def test_command_component_help_function(self): # we're using a curated environment environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", ) - basic_component = load_component(source="./tests/test_configs/components/basic_component_code_local_path.yml") - sweep_component = load_component(source="./tests/test_configs/components/helloworld_component_for_sweep.yml") + basic_component = load_component( + source="./tests/test_configs/components/basic_component_code_local_path.yml" + ) + sweep_component = load_component( + source="./tests/test_configs/components/helloworld_component_for_sweep.yml" + ) with patch("sys.stdout", new=StringIO()) as std_out: help(download_unzip_component._func) @@ -361,7 +425,10 @@ def test_command_component_help_function(self): help(sweep_component._func) assert "name: download_and_unzip" in std_out.getvalue() assert "name: sample_command_component_basic" in std_out.getvalue() - assert "name: microsoftsamples_command_component_for_sweep" in std_out.getvalue() + assert ( + "name: microsoftsamples_command_component_for_sweep" + in std_out.getvalue() + ) with patch("sys.stdout", new=StringIO()) as std_out: print(basic_component) @@ -375,7 +442,10 @@ def test_command_component_help_function(self): "name: download_and_unzip\nversion: 0.0.1\ntype: command\ninputs:\n url:\n type: string\n" in std_out.getvalue() ) - assert "name: microsoftsamples_command_component_for_sweep\nversion: 0.0.1\n" in std_out.getvalue() + assert ( + "name: microsoftsamples_command_component_for_sweep\nversion: 0.0.1\n" + in std_out.getvalue() + ) def test_command_help_function(self): test_command = command( @@ -390,15 +460,25 @@ def test_command_help_function(self): distribution=MpiDistribution(process_count_per_instance=4), environment_variables=dict(foo="bar"), # Customers can still do this: - resources=JobResourceConfiguration(instance_count=2, instance_type="STANDARD_D2"), + resources=JobResourceConfiguration( + instance_count=2, instance_type="STANDARD_D2" + ), limits=CommandJobLimits(timeout=300), inputs={ "float": 0.01, "integer": 1, "string": "str", "boolean": False, - "uri_folder": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), - "uri_file": dict(type="uri_file", path="https://my-blob/path/to/data", mode="download"), + "uri_folder": Input( + type="uri_folder", + path="https://my-blob/path/to/data", + mode="ro_mount", + ), + "uri_file": dict( + type="uri_file", + path="https://my-blob/path/to/data", + mode="download", + ), }, outputs={"my_model": Output(type="mlflow_model", mode="rw_mount")}, ) @@ -419,7 +499,8 @@ def test_sweep_help_function(self): component_to_sweep: CommandComponent = load_component(source=yaml_file) cmd_node1: Command = component_to_sweep( - component_in_number=Choice([2, 3, 4, 5]), component_in_path=Input(path="/a/path/on/ds") + component_in_number=Choice([2, 3, 4, 5]), + component_in_path=Input(path="/a/path/on/ds"), ) sweep_job1: Sweep = cmd_node1.sweep( @@ -440,7 +521,8 @@ def test_sweep_early_termination_setter(self): component_to_sweep: CommandComponent = load_component(source=yaml_file) cmd_node1: Command = component_to_sweep( - component_in_number=Choice([2, 3, 4, 5]), component_in_path=Input(path="/a/path/on/ds") + component_in_number=Choice([2, 3, 4, 5]), + component_in_path=Input(path="/a/path/on/ds"), ) sweep_job1: Sweep = cmd_node1.sweep( @@ -454,7 +536,9 @@ def test_sweep_early_termination_setter(self): "delay_evaluation": 200, "slack_factor": 40.0, } - from azure.ai.ml.entities._job.sweep.early_termination_policy import BanditPolicy + from azure.ai.ml.entities._job.sweep.early_termination_policy import ( + BanditPolicy, + ) assert isinstance(sweep_job1.early_termination, BanditPolicy) assert [ @@ -468,11 +552,18 @@ def test_invalid_component_inputs(self) -> None: component = load_component(yaml_path) with pytest.raises(ValidationException) as e: component._validate(raise_error=True) - assert "Invalid component input names 'COMPONENT_IN_NUMBER' and 'component_in_number'" in str(e.value) + assert ( + "Invalid component input names 'COMPONENT_IN_NUMBER' and 'component_in_number'" + in str(e.value) + ) component = load_component( yaml_path, params_override=[ - {"inputs": {"component_in_number": {"description": "1", "type": "number"}}}, + { + "inputs": { + "component_in_number": {"description": "1", "type": "number"} + } + }, ], ) validation_result = component._validate() @@ -493,9 +584,18 @@ def test_primitive_output(self): "is_deterministic": True, "name": "sample_command_component_basic", "outputs": { - "component_out_boolean": {"description": "A boolean", "type": "boolean"}, - "component_out_integer": {"description": "A integer", "type": "integer"}, - "component_out_number": {"description": "A ranged number", "type": "number"}, + "component_out_boolean": { + "description": "A boolean", + "type": "boolean", + }, + "component_out_integer": { + "description": "A integer", + "type": "integer", + }, + "component_out_number": { + "description": "A ranged number", + "type": "number", + }, "component_out_string": {"description": "A string", "type": "string"}, "component_out_early_available_string": { "description": "A early available string", @@ -510,10 +610,15 @@ def test_primitive_output(self): omits = ["$schema", "_source", "code"] # from YAML - yaml_path = "./tests/test_configs/components/helloworld_component_primitive_outputs.yml" + yaml_path = ( + "./tests/test_configs/components/helloworld_component_primitive_outputs.yml" + ) component1 = load_component(yaml_path) actual_component_dict1 = pydash.omit( - component1._to_rest_object().as_dict()["properties"]["component_spec"], *omits + as_attribute_dict(component1._to_rest_object())["properties"][ + "component_spec" + ], + *omits, ) assert actual_component_dict1 == expected_rest_component @@ -525,9 +630,20 @@ def test_primitive_output(self): version="1", tags={"tag": "tagvalue", "owner": "sdkteam"}, outputs={ - "component_out_boolean": {"description": "A boolean", "type": "boolean", "is_control": True}, - "component_out_integer": {"description": "A integer", "type": "integer", "is_control": True}, - "component_out_number": {"description": "A ranged number", "type": "number"}, + "component_out_boolean": { + "description": "A boolean", + "type": "boolean", + "is_control": True, + }, + "component_out_integer": { + "description": "A integer", + "type": "integer", + "is_control": True, + }, + "component_out_number": { + "description": "A ranged number", + "type": "number", + }, "component_out_string": {"description": "A string", "type": "string"}, "component_out_early_available_string": { "description": "A early available string", @@ -541,7 +657,10 @@ def test_primitive_output(self): code="./helloworld_components_with_env", ) actual_component_dict2 = pydash.omit( - component2._to_rest_object().as_dict()["properties"]["component_spec"], *omits + as_attribute_dict(component2._to_rest_object())["properties"][ + "component_spec" + ], + *omits, ) assert actual_component_dict2 == expected_rest_component @@ -584,7 +703,9 @@ def test_component_code_asset_ignoring_pycache(self) -> None: # use samefile to avoid windows path auto shortening issue assert len(excluded) == 1 assert os.path.isabs(excluded[0]) - assert Path(excluded[0]).samefile((Path(temp_dir) / "__pycache__/a.pyc")) + assert Path(excluded[0]).samefile( + (Path(temp_dir) / "__pycache__/a.pyc") + ) def test_normalized_arm_id_in_component_dict(self): component_dict = { @@ -636,9 +757,14 @@ def test_component_with_ipp_fields(self): "publisher": "contoso", "protectionLevel": "all", } - assert rest_component.properties.component_spec["outputs"] == expected_output_dict + assert ( + rest_component.properties.component_spec["outputs"] == expected_output_dict + ) - assert rest_component.properties.component_spec["inputs"]["training_data"] == expected_training_data_input_dict + assert ( + rest_component.properties.component_spec["inputs"]["training_data"] + == expected_training_data_input_dict + ) # because there's a mismatch between what the service accepts for IPP fields and what it returns # (accepts camelCase for IPP, returns snake_case IPP), mock out the service response @@ -654,12 +780,13 @@ def test_component_with_ipp_fields(self): assert from_rest_dict["intellectual_property"] assert from_rest_dict["intellectual_property"] == yaml_dict assert from_rest_dict["outputs"] == expected_output_dict - assert from_rest_dict["inputs"]["training_data"] == expected_training_data_input_dict + assert ( + from_rest_dict["inputs"]["training_data"] + == expected_training_data_input_dict + ) def test_additional_includes(self) -> None: - yaml_path = ( - "./tests/test_configs/components/component_with_additional_includes/helloworld_additional_includes.yml" - ) + yaml_path = "./tests/test_configs/components/component_with_additional_includes/helloworld_additional_includes.yml" component = load_component(source=yaml_path) assert component._validate().passed, repr(component._validate()) with component._build_code() as code: @@ -667,7 +794,11 @@ def test_additional_includes(self) -> None: assert code_path.is_dir() assert (code_path / "LICENSE").is_file() assert (code_path / "library.zip").is_file() - assert ZipFile(code_path / "library.zip").namelist() == ["library/", "library/hello.py", "library/world.py"] + assert ZipFile(code_path / "library.zip").namelist() == [ + "library/", + "library/hello.py", + "library/world.py", + ] assert (code_path / "library1" / "hello.py").is_file() assert (code_path / "library1" / "world.py").is_file() @@ -687,15 +818,27 @@ def test_additional_includes(self) -> None: AdditionalIncludesCheckFunc.NO_PARENT, ), # will be saved to library1/ignore.py, should be ignored - ("additional_includes/library1/ignore.py", None, AdditionalIncludesCheckFunc.NOT_EXISTS), + ( + "additional_includes/library1/ignore.py", + None, + AdditionalIncludesCheckFunc.NOT_EXISTS, + ), # will be saved to library1/test_ignore, should be kept - ("additional_includes/library1/test_ignore/a.py", None, AdditionalIncludesCheckFunc.SELF_IS_FILE), + ( + "additional_includes/library1/test_ignore/a.py", + None, + AdditionalIncludesCheckFunc.SELF_IS_FILE, + ), ], id="amlignore", ), pytest.param( [ - ("component_with_additional_includes/hello.py", None, AdditionalIncludesCheckFunc.SELF_IS_FILE), + ( + "component_with_additional_includes/hello.py", + None, + AdditionalIncludesCheckFunc.SELF_IS_FILE, + ), ( "component_with_additional_includes/test_code/.amlignore", "hello.py", @@ -723,9 +866,17 @@ def test_additional_includes(self) -> None: AdditionalIncludesCheckFunc.SELF_IS_FILE, ), # will be saved to library1/ignore.py, should be ignored - ("additional_includes/library1/ignore.py", None, AdditionalIncludesCheckFunc.NOT_EXISTS), + ( + "additional_includes/library1/ignore.py", + None, + AdditionalIncludesCheckFunc.NOT_EXISTS, + ), # will be saved to library1/test_ignore, should be kept - ("additional_includes/library1/test_ignore/a.py", None, AdditionalIncludesCheckFunc.NOT_EXISTS), + ( + "additional_includes/library1/test_ignore/a.py", + None, + AdditionalIncludesCheckFunc.NOT_EXISTS, + ), ], id="amlignore_in_additional_includes_folder", ), @@ -757,7 +908,11 @@ def test_additional_includes(self) -> None: None, AdditionalIncludesCheckFunc.NO_PARENT, ), - ("additional_includes/library1/__pycache__/a.pyc", None, AdditionalIncludesCheckFunc.NO_PARENT), + ( + "additional_includes/library1/__pycache__/a.pyc", + None, + AdditionalIncludesCheckFunc.NO_PARENT, + ), ( "additional_includes/library1/test/__pycache__/a.pyc", None, @@ -771,7 +926,10 @@ def test_additional_includes(self) -> None: def test_additional_includes_with_ignore_file(self, test_files) -> None: with build_temp_folder( source_base_dir="./tests/test_configs/components/", - relative_dirs_to_copy=["component_with_additional_includes", "additional_includes"], + relative_dirs_to_copy=[ + "component_with_additional_includes", + "additional_includes", + ], extra_files_to_create={file: content for file, content, _ in test_files}, ) as test_configs_dir: yaml_path = ( @@ -788,26 +946,34 @@ def test_additional_includes_with_ignore_file(self, test_files) -> None: for file, content, check_func in test_files: # original file is based on test_configs_dir, need to remove the leading # "component_with_additional_includes" or "additional_includes" to get the relative path - resolved_file_path = Path(os.path.join(code.path, *Path(file).parts[1:])) + resolved_file_path = Path( + os.path.join(code.path, *Path(file).parts[1:]) + ) if check_func == AdditionalIncludesCheckFunc.NO_PARENT: - assert not resolved_file_path.parent.exists(), f"{file} should not have parent" + assert ( + not resolved_file_path.parent.exists() + ), f"{file} should not have parent" elif check_func == AdditionalIncludesCheckFunc.SELF_IS_FILE: assert resolved_file_path.is_file(), f"{file} is not a file" if content is not None: - assert resolved_file_path.read_text() == content, f"{file} content is not expected" + assert ( + resolved_file_path.read_text() == content + ), f"{file} content is not expected" elif check_func == AdditionalIncludesCheckFunc.PARENT_EXISTS: - assert resolved_file_path.parent.is_dir(), f"{file} should have parent" + assert ( + resolved_file_path.parent.is_dir() + ), f"{file} should have parent" elif check_func == AdditionalIncludesCheckFunc.NOT_EXISTS: - assert not resolved_file_path.exists(), f"{file} should not exist" + assert ( + not resolved_file_path.exists() + ), f"{file} should not exist" elif check_func == AdditionalIncludesCheckFunc.SKIP: pass else: raise ValueError(f"Unknown check func: {check_func}") def test_additional_includes_merge_folder(self) -> None: - yaml_path = ( - "./tests/test_configs/components/component_with_additional_includes/additional_includes_merge_folder.yml" - ) + yaml_path = "./tests/test_configs/components/component_with_additional_includes/additional_includes_merge_folder.yml" component = load_component(source=yaml_path) assert component._validate().passed, repr(component._validate()) with component._build_code() as code: @@ -827,8 +993,13 @@ def test_additional_includes_merge_folder(self) -> None: ("code_and_additional_includes/component_spec.yml", True), ], ) - def test_additional_includes_with_code_specified(self, yaml_path: str, has_additional_includes: bool) -> None: - yaml_path = os.path.join("./tests/test_configs/components/component_with_additional_includes/", yaml_path) + def test_additional_includes_with_code_specified( + self, yaml_path: str, has_additional_includes: bool + ) -> None: + yaml_path = os.path.join( + "./tests/test_configs/components/component_with_additional_includes/", + yaml_path, + ) component = load_component(source=yaml_path) assert component._validate().passed, repr(component._validate()) # resolve @@ -847,12 +1018,18 @@ def test_additional_includes_with_code_specified(self, yaml_path: str, has_addit "helloworld_invalid_additional_includes_root_directory.yml", "helloworld_invalid_additional_includes_zip_file_not_found.yml", ]: - assert (code_path / path).is_file() if ".yml" in path else (code_path / path).is_dir() + assert ( + (code_path / path).is_file() + if ".yml" in path + else (code_path / path).is_dir() + ) assert (code_path / "LICENSE").is_file() else: # additional includes not specified, code should be specified path (default yaml folder) yaml_dict = load_yaml(yaml_path) - specified_code_path = Path(yaml_path).parent / yaml_dict.get("code", "./") + specified_code_path = Path(yaml_path).parent / yaml_dict.get( + "code", "./" + ) assert code_path.resolve() == specified_code_path.resolve() def test_artifacts_in_additional_includes(self): @@ -908,10 +1085,17 @@ def test_artifacts_in_additional_includes(self): ), ], ) - def test_invalid_additional_includes(self, yaml_path: str, expected_error_msg_prefix: str) -> None: + def test_invalid_additional_includes( + self, yaml_path: str, expected_error_msg_prefix: str + ) -> None: component = load_component( - os.path.join("./tests/test_configs/components/component_with_additional_includes", yaml_path) + os.path.join( + "./tests/test_configs/components/component_with_additional_includes", + yaml_path, + ) ) validation_result = component._validate() assert validation_result.passed is False - assert validation_result.error_messages["additional_includes"].startswith(expected_error_msg_prefix) + assert validation_result.error_messages["additional_includes"].startswith( + expected_error_msg_prefix + ) diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py index 232ff7c44c65..7aacb82c8855 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py @@ -8,16 +8,22 @@ DataTransferExportComponent, DataTransferImportComponent, ) +from azure.core.serialization import as_attribute_dict from .._util import _COMPONENT_TIMEOUT_SECOND -from .test_component_schema import load_component_entity_from_rest_json, load_component_entity_from_yaml +from .test_component_schema import ( + load_component_entity_from_rest_json, + load_component_entity_from_yaml, +) @pytest.mark.timeout(_COMPONENT_TIMEOUT_SECOND) @pytest.mark.unittest @pytest.mark.pipeline_test class TestDataTransferComponentEntity: - def test_serialize_deserialize_copy_task_component(self, mock_machinelearning_client: MLClient): + def test_serialize_deserialize_copy_task_component( + self, mock_machinelearning_client: MLClient + ): test_path = "./tests/test_configs/components/data_transfer/copy_files.yaml" component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" @@ -47,11 +53,15 @@ def test_serialize_deserialize_copy_task_component(self, mock_machinelearning_cl ] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) rest_dict = pydash.omit(dict(rest_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) + sdk_dict = pydash.omit( + dict(data_transfer_copy_component._to_dict()), *omit_fields + ) assert yaml_dict == rest_dict assert sdk_dict == yaml_dict - def test_serialize_deserialize_merge_task_component(self, mock_machinelearning_client: MLClient): + def test_serialize_deserialize_merge_task_component( + self, mock_machinelearning_client: MLClient + ): test_path = "./tests/test_configs/components/data_transfer/merge_files.yaml" component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" @@ -85,12 +95,18 @@ def test_serialize_deserialize_merge_task_component(self, mock_machinelearning_c ] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) rest_dict = pydash.omit(dict(rest_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) + sdk_dict = pydash.omit( + dict(data_transfer_copy_component._to_dict()), *omit_fields + ) assert yaml_dict == rest_dict assert sdk_dict == yaml_dict - def test_serialize_deserialize_import_task_component(self, mock_machinelearning_client: MLClient): - test_path = "./tests/test_configs/components/data_transfer/import_file_to_blob.yaml" + def test_serialize_deserialize_import_task_component( + self, mock_machinelearning_client: MLClient + ): + test_path = ( + "./tests/test_configs/components/data_transfer/import_file_to_blob.yaml" + ) component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" ) @@ -106,11 +122,17 @@ def test_serialize_deserialize_import_task_component(self, mock_machinelearning_ omit_fields = ["name", "id", "$schema"] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) + sdk_dict = pydash.omit( + dict(data_transfer_copy_component._to_dict()), *omit_fields + ) assert sdk_dict == yaml_dict - def test_serialize_deserialize_export_task_component(self, mock_machinelearning_client: MLClient): - test_path = "./tests/test_configs/components/data_transfer/export_blob_to_database.yaml" + def test_serialize_deserialize_export_task_component( + self, mock_machinelearning_client: MLClient + ): + test_path = ( + "./tests/test_configs/components/data_transfer/export_blob_to_database.yaml" + ) component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" ) @@ -126,7 +148,9 @@ def test_serialize_deserialize_export_task_component(self, mock_machinelearning_ omit_fields = ["name", "id", "$schema"] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) + sdk_dict = pydash.omit( + dict(data_transfer_copy_component._to_dict()), *omit_fields + ) assert sdk_dict == yaml_dict def test_copy_task_component_entity(self): @@ -148,12 +172,12 @@ def test_copy_task_component_entity(self): "properties.properties.client_component_hash", ] component._validate() - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) component_dict = pydash.omit(component_dict, *omit_fields) yaml_path = "./tests/test_configs/components/data_transfer/copy_files.yaml" yaml_component = load_component(yaml_path) - yaml_component_dict = yaml_component._to_rest_object().as_dict() + yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) yaml_component_dict = pydash.omit(yaml_component_dict, *omit_fields) assert component_dict == yaml_component_dict diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py index 59ec077fab4d..5465d1a98d62 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py @@ -9,6 +9,7 @@ from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.constants._component import NodeType from azure.ai.ml.entities._component.flow import FlowComponent +from azure.core.serialization import as_attribute_dict from .._util import _COMPONENT_TIMEOUT_SECOND @@ -20,7 +21,9 @@ def test_component_load_from_dag(self): target_path = "./tests/test_configs/flows/basic/flow.dag.yaml" component = load_component(target_path) - component._fill_back_code_value("/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1") + component._fill_back_code_value( + "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" + ) component.version = "2" component.description = "test load component from flow" @@ -55,7 +58,7 @@ def test_component_load_from_dag(self): }, } - assert component._to_rest_object().as_dict() == expected_rest_dict + assert as_attribute_dict(component._to_rest_object()) == expected_rest_dict named_component = load_component( target_path, @@ -70,7 +73,9 @@ def test_component_load_from_dag(self): "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" ) - assert named_component._to_rest_object().as_dict() == expected_rest_dict + assert ( + as_attribute_dict(named_component._to_rest_object()) == expected_rest_dict + ) def test_component_normalize_folder_name(self): target_path = "./tests/test_configs/flows/basic/" @@ -94,7 +99,10 @@ def test_component_load_from_run(self): "component_spec": { "_source": "YAML.COMPONENT", "connections": { - "llm": {"connection": "azure_open_ai_connection", "deployment_name": "text-davinci-003"} + "llm": { + "connection": "azure_open_ai_connection", + "deployment_name": "text-davinci-003", + } }, "description": "A run of the basic flow", "display_name": "Basic Run", @@ -115,14 +123,18 @@ def test_component_load_from_run(self): "description": "A run of the basic flow", "is_anonymous": False, "is_archived": False, - "properties": {"client_component_hash": "f060820c-7fb3-56a8-790c-ae2969a7b544"}, + "properties": { + "client_component_hash": "f060820c-7fb3-56a8-790c-ae2969a7b544" + }, "tags": {}, }, } - component._fill_back_code_value("/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1") + component._fill_back_code_value( + "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" + ) - assert component._to_rest_object().as_dict() == expected_rest_dict + assert as_attribute_dict(component._to_rest_object()) == expected_rest_dict def test_component_load_fail(self): flow_dir_path = "./tests/test_configs/flows/basic" @@ -135,16 +147,23 @@ def test_component_load_fail(self): ) component = load_component(f"{temp_dir}/basic/flow.dag.yaml") - with pytest.raises(Exception, match="Flow component must be created with a ./promptflow/flow.tools.json"): + with pytest.raises( + Exception, + match="Flow component must be created with a ./promptflow/flow.tools.json", + ): with component._build_code(): pass def test_flow_component_load_with_additional_includes(self): - flow_dir_path = "./tests/test_configs/flows/web_classification_with_additional_includes" + flow_dir_path = ( + "./tests/test_configs/flows/web_classification_with_additional_includes" + ) component = load_component(f"{flow_dir_path}/flow.dag.yaml") with component._build_code() as code: assert Path(code.path, "convert_to_dict.py").is_file() - flow_dag = yaml.safe_load(Path(code.path, "flow.dag.yaml").read_text(encoding="utf-8")) + flow_dag = yaml.safe_load( + Path(code.path, "flow.dag.yaml").read_text(encoding="utf-8") + ) # we won't update the flow.dag.yaml for now. user may use `mldesigner compile` if they want to update it assert "additional_includes" in flow_dag @@ -155,15 +174,21 @@ def test_flow_component_load_from_run_with_additional_includes(self): assert Path(code.path, "convert_to_dict.py").is_file() def test_flow_component_entity(self): - component: FlowComponent = load_component("./tests/test_configs/flows/basic/flow.dag.yaml") + component: FlowComponent = load_component( + "./tests/test_configs/flows/basic/flow.dag.yaml" + ) assert component.type == NodeType.FLOW_PARALLEL input_port_dict = component.inputs - with pytest.raises(RuntimeError, match="Ports of flow component are not editable."): + with pytest.raises( + RuntimeError, match="Ports of flow component are not editable." + ): input_port_dict["text"] = None - with pytest.raises(RuntimeError, match="Ports of flow component are not editable."): + with pytest.raises( + RuntimeError, match="Ports of flow component are not editable." + ): del input_port_dict["text"] with pytest.raises(AttributeError): @@ -181,15 +206,19 @@ def test_flow_component_entity(self): "AZURE_OPENAI_API_BASE": "${azure_open_ai_connection.api_base}", } - component._fill_back_code_value("/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1") + component._fill_back_code_value( + "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" + ) - assert component._to_rest_object().as_dict() == { + assert as_attribute_dict(component._to_rest_object()) == { "name": "basic", "properties": { "component_spec": { "_source": "YAML.COMPONENT", "code": "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1", - "environment_variables": {"AZURE_OPENAI_API_BASE": "${azure_open_ai_connection.api_base}"}, + "environment_variables": { + "AZURE_OPENAI_API_BASE": "${azure_open_ai_connection.api_base}" + }, "flow_file_name": "flow.dag.yaml", "is_deterministic": True, "name": "basic", @@ -199,13 +228,18 @@ def test_flow_component_entity(self): "is_anonymous": False, "is_archived": False, # note that this won't take effect actually - "properties": {"client_component_hash": "07cdc416-c6ee-0beb-3d1b-4e5a5c4b44ec"}, + "properties": { + "client_component_hash": "07cdc416-c6ee-0beb-3d1b-4e5a5c4b44ec" + }, "tags": {}, }, } flow_node = component( - data=Input(path="./tests/test_configs/flows/data/basic.jsonl", type=AssetTypes.URI_FILE), + data=Input( + path="./tests/test_configs/flows/data/basic.jsonl", + type=AssetTypes.URI_FILE, + ), text="${data.text}", ) @@ -215,7 +249,10 @@ def test_flow_component_entity(self): "_source": "YAML.COMPONENT", "componentId": "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/components/xxx/versions/1", "inputs": { - "data": {"job_input_type": "uri_file", "uri": "./tests/test_configs/flows/data/basic.jsonl"}, + "data": { + "job_input_type": "uri_file", + "uri": "./tests/test_configs/flows/data/basic.jsonl", + }, "text": {"job_input_type": "literal", "value": "${data.text}"}, }, "type": "parallel", @@ -227,7 +264,10 @@ def test_flow_component_entity(self): pytest.param( {"connections": {"llm": {"connection": "azure_open_ai_connection"}}}, { - "connections.llm.connection": {"job_input_type": "literal", "value": "azure_open_ai_connection"}, + "connections.llm.connection": { + "job_input_type": "literal", + "value": "azure_open_ai_connection", + }, }, id="dict-1", ), @@ -242,8 +282,14 @@ def test_flow_component_entity(self): } }, { - "connections.llm.connection": {"job_input_type": "literal", "value": "azure_open_ai_connection"}, - "connections.llm.deployment_name": {"job_input_type": "literal", "value": "text-davinci-003"}, + "connections.llm.connection": { + "job_input_type": "literal", + "value": "azure_open_ai_connection", + }, + "connections.llm.deployment_name": { + "job_input_type": "literal", + "value": "text-davinci-003", + }, "connections.llm.custom_connection": { "job_input_type": "literal", "value": "azure_open_ai_connection", @@ -254,7 +300,10 @@ def test_flow_component_entity(self): pytest.param( {"connections.llm.connection": "azure_open_ai_connection"}, { - "connections.llm.connection": {"job_input_type": "literal", "value": "azure_open_ai_connection"}, + "connections.llm.connection": { + "job_input_type": "literal", + "value": "azure_open_ai_connection", + }, }, id="dot-key-1", ), @@ -265,26 +314,39 @@ def test_flow_component_entity(self): "connections": {"llm": {"deployment_name": "text-davinci-003"}}, }, { - "connections.llm.connection": {"job_input_type": "literal", "value": "azure_open_ai_connection"}, + "connections.llm.connection": { + "job_input_type": "literal", + "value": "azure_open_ai_connection", + }, "connections.llm.custom_connection": { "job_input_type": "literal", "value": "azure_open_ai_connection", }, - "connections.llm.deployment_name": {"job_input_type": "literal", "value": "text-davinci-003"}, + "connections.llm.deployment_name": { + "job_input_type": "literal", + "value": "text-davinci-003", + }, }, id="dot-key-plus-dict", ), ], ) - def test_component_connection_inputs(self, input_values: dict, expected_rest_objects: dict): + def test_component_connection_inputs( + self, input_values: dict, expected_rest_objects: dict + ): component = load_component("./tests/test_configs/flows/basic/flow.dag.yaml") - data_input = Input(path="./tests/test_configs/flows/data/basic.jsonl", type=AssetTypes.URI_FILE) + data_input = Input( + path="./tests/test_configs/flows/data/basic.jsonl", type=AssetTypes.URI_FILE + ) # validation_result = component()._validate() # assert validation_result.passed is False node = component(data=data_input, **input_values) node._component = "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/components/xxx/versions/1" assert node._to_rest_object()["inputs"] == { - "data": {"job_input_type": "uri_file", "uri": "./tests/test_configs/flows/data/basic.jsonl"}, + "data": { + "job_input_type": "uri_file", + "uri": "./tests/test_configs/flows/data/basic.jsonl", + }, **expected_rest_objects, } diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py index 0ef4b522dee6..40d2f1e548a1 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py @@ -9,6 +9,7 @@ from azure.ai.ml.entities import Component from azure.ai.ml.entities._component.parallel_component import ParallelComponent from azure.ai.ml.entities._job.pipeline._io import PipelineInput +from azure.core.serialization import as_attribute_dict from .._util import _COMPONENT_TIMEOUT_SECOND @@ -19,7 +20,9 @@ class TestParallelComponentEntity: def test_component_load(self): # code is specified in yaml, value is respected - component_yaml = "./tests/test_configs/components/basic_parallel_component_score.yml" + component_yaml = ( + "./tests/test_configs/components/basic_parallel_component_score.yml" + ) parallel_component = load_component( source=component_yaml, ) @@ -31,8 +34,13 @@ def test_command_component_to_dict(self): yaml_path = "./tests/test_configs/components/basic_parallel_component_score.yml" yaml_dict = load_yaml(yaml_path) yaml_dict["mock_option_param"] = {"mock_key": "mock_val"} - parallel_component = ParallelComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert parallel_component._other_parameter.get("mock_option_param") == yaml_dict["mock_option_param"] + parallel_component = ParallelComponent._load( + data=yaml_dict, yaml_path=yaml_path + ) + assert ( + parallel_component._other_parameter.get("mock_option_param") + == yaml_dict["mock_option_param"] + ) def test_parallel_component_entity(self): task = { @@ -70,12 +78,12 @@ def test_parallel_component_entity(self): "properties.component_spec._source", "properties.properties.client_component_hash", ] - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) component_dict = pydash.omit(component_dict, *omit_fields) yaml_path = "./tests/test_configs/components/basic_parallel_component_score.yml" yaml_component = load_component(source=yaml_path) - yaml_component_dict = yaml_component._to_rest_object().as_dict() + yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) yaml_component_dict = pydash.omit(yaml_component_dict, *omit_fields) assert component_dict == yaml_component_dict @@ -107,8 +115,12 @@ def test_parallel_component_version_as_a_function_with_inputs(self): "type": "run_function", }, } - pipeline_input = PipelineInput(name="pipeline_input", owner="pipeline", meta=None) - yaml_component = yaml_component_version(model="SVM", label="test", component_in_path=pipeline_input) + pipeline_input = PipelineInput( + name="pipeline_input", owner="pipeline", meta=None + ) + yaml_component = yaml_component_version( + model="SVM", label="test", component_in_path=pipeline_input + ) yaml_component._component = "fake_component" rest_yaml_component = yaml_component._to_rest_object() @@ -116,11 +128,21 @@ def test_parallel_component_version_as_a_function_with_inputs(self): assert rest_yaml_component == expected_rest_component def test_parallel_component_run_settings_picked_up(self): - yaml_path = "./tests/test_configs/components/parallel_component_with_run_settings.yml" + yaml_path = ( + "./tests/test_configs/components/parallel_component_with_run_settings.yml" + ) parallel_component = load_component(source=yaml_path) parallel_node = parallel_component() # Normally, during initiation of nodes, the settings from the yaml file shouldn't be changed - assert parallel_component.resources.instance_count == parallel_node.resources.instance_count == 1 - assert parallel_component.max_concurrency_per_instance == parallel_node.max_concurrency_per_instance == 16 + assert ( + parallel_component.resources.instance_count + == parallel_node.resources.instance_count + == 1 + ) + assert ( + parallel_component.max_concurrency_per_instance + == parallel_node.max_concurrency_per_instance + == 16 + ) assert parallel_component.retry_settings == parallel_node.retry_settings assert parallel_component.retry_settings.timeout == 12345 diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py index 0d233d59989d..63209bfb99ff 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py @@ -5,6 +5,7 @@ from azure.ai.ml._utils.utils import load_yaml from azure.ai.ml.entities._component.spark_component import SparkComponent from azure.ai.ml.entities._job.pipeline._io import PipelineInput +from azure.core.serialization import as_attribute_dict from .._util import _COMPONENT_TIMEOUT_SECOND @@ -20,9 +21,12 @@ def test_component_load(self): component_yaml, ) - assert isinstance(spark_component.py_files, list) and spark_component.py_files[0] == "utils.zip" + assert ( + isinstance(spark_component.py_files, list) + and spark_component.py_files[0] == "utils.zip" + ) assert spark_component.code == "./src" - assert spark_component.entry._to_rest_object().as_dict() == { + assert as_attribute_dict(spark_component.entry._to_rest_object()) == { "spark_job_entry_type": "SparkJobPythonEntry", "file": "add_greeting_column.py", } @@ -46,7 +50,10 @@ def test_spark_component_to_dict(self): yaml_dict = load_yaml(yaml_path) yaml_dict["mock_option_param"] = {"mock_key": "mock_val"} spark_component = SparkComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert spark_component._other_parameter.get("mock_option_param") == yaml_dict["mock_option_param"] + assert ( + spark_component._other_parameter.get("mock_option_param") + == yaml_dict["mock_option_param"] + ) def test_spark_component_to_dict_additional_include(self): # Test optional params exists in component dict @@ -54,7 +61,10 @@ def test_spark_component_to_dict_additional_include(self): yaml_dict = load_yaml(yaml_path) yaml_dict["additional_includes"] = ["common_src"] spark_component = SparkComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert spark_component.additional_includes[0] == yaml_dict["additional_includes"][0] + assert ( + spark_component.additional_includes[0] + == yaml_dict["additional_includes"][0] + ) def test_spark_component_entity(self): component = SparkComponent( @@ -82,12 +92,12 @@ def test_spark_component_entity(self): "properties.component_spec._source", "properties.properties.client_component_hash", ] - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) component_dict = pydash.omit(component_dict, *omit_fields) yaml_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/add_greeting_column_component.yml" yaml_component = load_component(yaml_path) - yaml_component_dict = yaml_component._to_rest_object().as_dict() + yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) yaml_component_dict = pydash.omit(yaml_component_dict, *omit_fields) assert component_dict == yaml_component_dict @@ -116,20 +126,26 @@ def test_spark_component_entity_additional_include(self): "properties.component_spec._source", "properties.properties.client_component_hash", ] - component_dict = component._to_rest_object().as_dict() + component_dict = as_attribute_dict(component._to_rest_object()) component_dict = pydash.omit(component_dict, *omit_fields) yaml_path = "./tests/test_configs/components/hello_spark_component_with_additional_include.yml" yaml_component = load_component(yaml_path) - yaml_component_dict = yaml_component._to_rest_object().as_dict() + yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) yaml_component_dict = pydash.omit(yaml_component_dict, *omit_fields) assert component_dict == yaml_component_dict def test_spark_component_version_as_a_function_with_inputs(self): expected_rest_component = { "type": "spark", - "resources": {"instance_type": "Standard_E8S_V3", "runtime_version": "3.4.0"}, - "entry": {"file": "add_greeting_column.py", "spark_job_entry_type": "SparkJobPythonEntry"}, + "resources": { + "instance_type": "Standard_E8S_V3", + "runtime_version": "3.4.0", + }, + "entry": { + "file": "add_greeting_column.py", + "spark_job_entry_type": "SparkJobPythonEntry", + }, "py_files": ["utils.zip"], "files": ["my_files.txt"], "identity": {"identity_type": "UserIdentity"}, @@ -142,16 +158,24 @@ def test_spark_component_version_as_a_function_with_inputs(self): }, "args": "--file_input ${{inputs.file_input}}", "inputs": { - "file_input": {"job_input_type": "literal", "value": "${{parent.inputs.pipeline_input}}"}, + "file_input": { + "job_input_type": "literal", + "value": "${{parent.inputs.pipeline_input}}", + }, }, "_source": "YAML.COMPONENT", "componentId": "fake_component", } yaml_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/add_greeting_column_component.yml" yaml_component_version = load_component(yaml_path) - pipeline_input = PipelineInput(name="pipeline_input", owner="pipeline", meta=None) + pipeline_input = PipelineInput( + name="pipeline_input", owner="pipeline", meta=None + ) yaml_component = yaml_component_version(file_input=pipeline_input) - yaml_component.resources = {"instance_type": "Standard_E8S_V3", "runtime_version": "3.4.0"} + yaml_component.resources = { + "instance_type": "Standard_E8S_V3", + "runtime_version": "3.4.0", + } yaml_component._component = "fake_component" rest_yaml_component = yaml_component._to_rest_object() diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py index d1088ee032da..3e840bcb685e 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py @@ -36,6 +36,7 @@ ComponentTranslatableMixin, ) from azure.ai.ml.exceptions import JobException, ValidationException +from azure.core.serialization import as_attribute_dict from .._util import _DSL_TIMEOUT_SECOND @@ -209,7 +210,7 @@ def test_command_function(self, test_command): } } actual_component = pydash.omit( - test_command._component._to_rest_object().as_dict(), + as_attribute_dict(test_command._component._to_rest_object()), "name", "properties.component_spec.name", "properties.properties.client_component_hash", @@ -254,7 +255,9 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): } } actual_component = pydash.omit( - test_no_deterministic_command._component._to_rest_object().as_dict(), + as_attribute_dict( + test_no_deterministic_command._component._to_rest_object() + ), "name", "properties.component_spec.name", "properties.properties.client_component_hash", @@ -455,7 +458,7 @@ def test_command_with_artifact_inputs(self, command_with_artifact_inputs): # node1's component stores proper inputs & outputs actual_component = pydash.omit( - node1._component._to_rest_object().as_dict(), + as_attribute_dict(node1._component._to_rest_object()), "name", "properties.component_spec.name", "properties.properties.client_component_hash", @@ -679,7 +682,7 @@ def test_command_unprovided_inputs_outputs(self, test_command_params): node1 = command(**test_command_params) actual_component = pydash.omit( - node1._component._to_rest_object().as_dict(), + as_attribute_dict(node1._component._to_rest_object()), "name", "properties.component_spec.name", "properties.properties.client_component_hash", diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index c007aa9f9cab..d77ffc5dc419 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -1960,7 +1960,9 @@ def test_pipeline_job_with_inline_command_job_input_binding_to_registered_compon # check component of pipeline job is expected for name, expected_dict in expected_components.items(): - actual_dict = pipeline_job.jobs[name].component._to_rest_object().as_dict() + actual_dict = as_attribute_dict( + pipeline_job.jobs[name].component._to_rest_object() + ) omit_fields = [ "name", ] diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py index c59fac1800b0..4caa4980b380 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py @@ -1443,8 +1443,8 @@ def test_command_job_in_pipeline_to_component(self, test_path, expected_componen pipeline_entity = load_job(source=test_path) # check component of pipeline job is expected for name, expected_dict in expected_components.items(): - actual_dict = ( - pipeline_entity.jobs[name].component._to_rest_object().as_dict() + actual_dict = as_attribute_dict( + pipeline_entity.jobs[name].component._to_rest_object() ) omit_fields = [ "name", @@ -1504,8 +1504,8 @@ def test_command_job_in_pipeline_deep_reference(self): }, } for name, expected_dict in expected_components.items(): - actual_dict = ( - pipeline_entity.jobs[name].component._to_rest_object().as_dict() + actual_dict = as_attribute_dict( + pipeline_entity.jobs[name].component._to_rest_object() ) omit_fields = [ "name", From d770750e5a4adeb5aaf63c6d9ccb245c3f5f3771 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 14:51:01 +0530 Subject: [PATCH 032/146] Migrate BatchDeployment entity to arm_ml_service models (byte-identical wire, identical field set) --- .../entities/_deployment/batch_deployment.py | 89 ++++++++++++++----- 1 file changed, 67 insertions(+), 22 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py index dc2852c6cccf..b4b0c6a25450 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py @@ -10,11 +10,17 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchDeployment as BatchDeploymentData -from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchDeploymentProperties as RestBatchDeployment -from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchOutputAction -from azure.ai.ml._restclient.v2024_01_01_preview.models import CodeConfiguration as RestCodeConfiguration -from azure.ai.ml._restclient.v2024_01_01_preview.models import IdAssetReference +from azure.ai.ml._restclient.arm_ml_service.models import ( + BatchDeployment as BatchDeploymentData, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + BatchDeploymentProperties as RestBatchDeployment, +) +from azure.ai.ml._restclient.arm_ml_service.models import BatchOutputAction +from azure.ai.ml._restclient.arm_ml_service.models import ( + CodeConfiguration as RestCodeConfiguration, +) +from azure.ai.ml._restclient.arm_ml_service.models import IdAssetReference from azure.ai.ml._schema._deployment.batch.batch_deployment import BatchDeploymentSchema from azure.ai.ml._utils._arm_id_utils import _parse_endpoint_name_from_deployment_id from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY @@ -24,11 +30,18 @@ from azure.ai.ml.entities._job.resource_configuration import ResourceConfiguration from azure.ai.ml.entities._system_data import SystemData from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationErrorType, + ValidationException, +) from .code_configuration import CodeConfiguration from .deployment import Deployment -from .model_batch_deployment_settings import ModelBatchDeploymentSettings as BatchDeploymentSettings +from .model_batch_deployment_settings import ( + ModelBatchDeploymentSettings as BatchDeploymentSettings, +) module_logger = logging.getLogger(__name__) @@ -122,11 +135,15 @@ def __init__( mini_batch_size: Optional[int] = None, max_concurrency_per_instance: Optional[int] = None, environment_variables: Optional[Dict[str, str]] = None, - code_path: Optional[Union[str, PathLike]] = None, # promoted property from code_configuration.code + code_path: Optional[ + Union[str, PathLike] + ] = None, # promoted property from code_configuration.code scoring_script: Optional[ Union[str, PathLike] ] = None, # promoted property from code_configuration.scoring_script - instance_count: Optional[int] = None, # promoted property from resources.instance_count + instance_count: Optional[ + int + ] = None, # promoted property from resources.instance_count **kwargs: Any, ) -> None: _type = kwargs.pop("_type", None) @@ -182,7 +199,9 @@ def __init__( def _setup_instance_count( self, - ) -> None: # No need to check instance_count here as it's already set in self._settings during initialization + ) -> ( + None + ): # No need to check instance_count here as it's already set in self._settings during initialization if self.resources and self._settings.instance_count: msg = "Can't set instance_count when resources is provided." raise ValidationException( @@ -194,7 +213,9 @@ def _setup_instance_count( ) if not self.resources and self._settings.instance_count: - self.resources = ResourceConfiguration(instance_count=self._settings.instance_count) + self.resources = ResourceConfiguration( + instance_count=self._settings.instance_count + ) def __getattr__(self, name: str) -> Optional[Any]: # Support backwards compatibility with old BatchDeployment properties. @@ -235,7 +256,9 @@ def provisioning_state(self) -> Optional[str]: return self._provisioning_state def _to_dict(self) -> Dict: - res: dict = BatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = BatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump( + self + ) return res @classmethod @@ -281,12 +304,16 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # type: ignore model=model, output_file_name=self.output_file_name, output_action=( - BatchDeployment._yaml_output_action_to_rest_output_action(self.output_action) + BatchDeployment._yaml_output_action_to_rest_output_action( + self.output_action + ) if isinstance(self.output_action, str) else None ), error_threshold=self.error_threshold, - retry_settings=self.retry_settings._to_rest_object() if self.retry_settings else None, + retry_settings=( + self.retry_settings._to_rest_object() if self.retry_settings else None + ), logging_level=self.logging_level, mini_batch_size=self.mini_batch_size, max_concurrency_per_instance=self.max_concurrency_per_instance, @@ -294,13 +321,19 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # type: ignore properties=self.properties, ) - return BatchDeploymentData(location=location, properties=batch_deployment, tags=self.tags) + return BatchDeploymentData( + location=location, properties=batch_deployment, tags=self.tags + ) @classmethod def _from_rest_object( # pylint: disable=arguments-renamed cls, deployment: BatchDeploymentData ) -> BatchDeploymentData: - modelId = deployment.properties.model.asset_id if deployment.properties.model else None + modelId = ( + deployment.properties.model.asset_id + if deployment.properties.model + else None + ) if ( hasattr(deployment.properties, "deployment_configuration") @@ -323,7 +356,9 @@ def _from_rest_object( # pylint: disable=arguments-renamed properties = deployment.properties.properties code_configuration = ( - CodeConfiguration._from_rest_code_configuration(deployment.properties.code_configuration) + CodeConfiguration._from_rest_code_configuration( + deployment.properties.code_configuration + ) if deployment.properties.code_configuration else None ) @@ -337,17 +372,25 @@ def _from_rest_object( # pylint: disable=arguments-renamed code_configuration=code_configuration, output_file_name=( deployment.properties.output_file_name - if cls._rest_output_action_to_yaml_output_action(deployment.properties.output_action) + if cls._rest_output_action_to_yaml_output_action( + deployment.properties.output_action + ) == BatchDeploymentOutputAction.APPEND_ROW else None ), - output_action=cls._rest_output_action_to_yaml_output_action(deployment.properties.output_action), + output_action=cls._rest_output_action_to_yaml_output_action( + deployment.properties.output_action + ), error_threshold=deployment.properties.error_threshold, - retry_settings=BatchRetrySettings._from_rest_object(deployment.properties.retry_settings), + retry_settings=BatchRetrySettings._from_rest_object( + deployment.properties.retry_settings + ), logging_level=deployment.properties.logging_level, mini_batch_size=deployment.properties.mini_batch_size, compute=deployment.properties.compute, - resources=ResourceConfiguration._from_rest_object(deployment.properties.resources), + resources=ResourceConfiguration._from_rest_object( + deployment.properties.resources + ), environment_variables=deployment.properties.environment_variables, max_concurrency_per_instance=deployment.properties.max_concurrency_per_instance, endpoint_name=_parse_endpoint_name_from_deployment_id(deployment.id), @@ -375,7 +418,9 @@ def _load( BASE_PATH_CONTEXT_KEY: Path(yaml_path).parent if yaml_path else Path.cwd(), PARAMS_OVERRIDE_KEY: params_override, } - res: BatchDeployment = load_from_dict(BatchDeploymentSchema, data, context, **kwargs) + res: BatchDeployment = load_from_dict( + BatchDeploymentSchema, data, context, **kwargs + ) return res def _validate(self) -> None: From 8a3f19778f9a236fdac082ddc996ceccf05aba35 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 15:03:55 +0530 Subject: [PATCH 033/146] Migrate PipelineComponentBatchDeployment entity to arm_ml_service models Preserve the v2024_01 msrest constructor defaults (error_threshold=-1, max_concurrency_per_instance=1, mini_batch_size=10, output_file_name=predictions.csv) explicitly since this path never set them and the arm model does not default them, keeping the wire byte-identical. --- .../pipeline_component_batch_deployment.py | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py index faad8d7c3286..bb555cea4743 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py @@ -6,8 +6,10 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, Literal, Optional, Union -from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchDeployment as RestBatchDeployment -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( + BatchDeployment as RestBatchDeployment, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( BatchDeploymentProperties, BatchPipelineComponentDeploymentConfiguration, IdAssetReference, @@ -62,7 +64,12 @@ def __init__( # Get type from kwargs if present, otherwise use the default type defined above _type = kwargs.pop("type", type) super().__init__( - name=name, _type=_type, endpoint_name=endpoint_name, tags=tags, description=description, **kwargs + name=name, + _type=_type, + endpoint_name=endpoint_name, + tags=tags, + description=description, + **kwargs, ) self.component = component self.settings = settings @@ -89,6 +96,13 @@ def _to_rest_object(self, location: str) -> "RestBatchDeployment": # type: igno properties=BatchDeploymentProperties( deployment_configuration=batch_pipeline_config, description=self.description, + # The v2024_01 msrest BatchDeploymentProperties model defaulted these fields and always + # emitted them on the wire even when unset here. The shared arm_ml_service model does not + # default them, so set them explicitly to the same values to keep the body byte-identical. + error_threshold=-1, + max_concurrency_per_instance=1, + mini_batch_size=10, + output_file_name="predictions.csv", ), ) @@ -114,12 +128,18 @@ def _load( return res @classmethod - def _from_rest_object(cls, deployment: RestBatchDeployment) -> "PipelineComponentBatchDeployment": + def _from_rest_object( + cls, deployment: RestBatchDeployment + ) -> "PipelineComponentBatchDeployment": return PipelineComponentBatchDeployment( name=deployment.name, tags=deployment.tags, - component=deployment.properties.additional_properties["deploymentConfiguration"]["componentId"]["assetId"], - settings=deployment.properties.additional_properties["deploymentConfiguration"]["settings"], + component=deployment.properties.additional_properties[ + "deploymentConfiguration" + ]["componentId"]["assetId"], + settings=deployment.properties.additional_properties[ + "deploymentConfiguration" + ]["settings"], endpoint_name=_parse_endpoint_name_from_deployment_id(deployment.id), ) @@ -136,9 +156,13 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) + dump_yaml_to_file( + dest, yaml_serialized, default_flow_style=False, path=path, **kwargs + ) def _to_dict(self) -> Dict: - res: dict = PipelineComponentBatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = PipelineComponentBatchDeploymentSchema( + context={BASE_PATH_CONTEXT_KEY: "./"} + ).dump(self) return res From 8b1fa486e7f4a1b8765bb0fb88702b070a0f206a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 15:45:23 +0530 Subject: [PATCH 034/146] Migrate DistillationJob to arm_ml_service with custom read-path handling Flip CustomModelFineTuning, FineTuningJob, JobBase, MLFlowModelJobInput and UriFileJobInput imports in distillation_job.py to the shared arm_ml_service hybrid client, with custom code to preserve the previous behavior: - Convert SDK Input values to their REST job-input models BEFORE constructing the arm CustomModelFineTuning. The arm hybrid models coerce a value assigned to a field into their backing dict, so the previous post-construction isinstance(..., Input) checks would no longer match. - Stringify hyper_parameters. The v2024_01 msrest model typed it Dict[str, str] and coerced values to strings on the wire; the arm model preserves the type, so stringify to keep the serialized body byte-identical. - Add _coerce_property_value and apply it in _filter_properties. The arm FineTuningJob.properties field is Dict[str, str] and eagerly stringifies values when stored (0.1 -> "0.1", True -> "True"), whereas msrest kept the native type in memory until serialization. Restore native bool/int/float types on read so the round-trip matches the prior behavior. The on-the-wire payload is unchanged (both clients send the stringified form). Flip the distillation test imports (MLFlowModelJobInput/UriFileJobInput/ FineTuningJob) to arm to match. Validated: distillation units 16 passed, smoke + finetuning 184 passed. --- .../_job/distillation/distillation_job.py | 215 ++++++++++++++---- .../unittests/test_distillation_conversion.py | 148 ++++++++---- .../unittests/test_distillation_job_schema.py | 68 ++++-- 3 files changed, 329 insertions(+), 102 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py index b6b79630e868..0e540b6c9b37 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py @@ -5,30 +5,44 @@ import json from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( CustomModelFineTuning as RestCustomModelFineTuningVertical, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models import FineTuningJob as RestFineTuningJob -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as RestJobBase -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLFlowModelJobInput, UriFileJobInput +from azure.ai.ml._restclient.arm_ml_service.models import ( + FineTuningJob as RestFineTuningJob, +) +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as RestJobBase +from azure.ai.ml._restclient.arm_ml_service.models import ( + MLFlowModelJobInput, + UriFileJobInput, +) from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants import DataGenerationType, JobType from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, TYPE, AssetTypes from azure.ai.ml.entities._inputs_outputs import Input -from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, to_rest_data_outputs +from azure.ai.ml.entities._job._input_output_helpers import ( + from_rest_data_outputs, + to_rest_data_outputs, +) from azure.ai.ml.entities._job.distillation.constants import ( AzureMLDistillationProperties, EndpointSettings, PromptSettingKeys, ) -from azure.ai.ml.entities._job.distillation.endpoint_request_settings import EndpointRequestSettings +from azure.ai.ml.entities._job.distillation.endpoint_request_settings import ( + EndpointRequestSettings, +) from azure.ai.ml.entities._job.distillation.prompt_settings import PromptSettings -from azure.ai.ml.entities._job.distillation.teacher_model_settings import TeacherModelSettings +from azure.ai.ml.entities._job.distillation.teacher_model_settings import ( + TeacherModelSettings, +) from azure.ai.ml.entities._job.job import Job from azure.ai.ml.entities._job.job_io_mixin import JobIOMixin from azure.ai.ml.entities._job.resource_configuration import ResourceConfiguration from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.entities._workspace.connections.workspace_connection import WorkspaceConnection +from azure.ai.ml.entities._workspace.connections.workspace_connection import ( + WorkspaceConnection, +) # pylint: disable=too-many-instance-attributes @@ -60,13 +74,19 @@ def __init__( self._hyperparameters = hyperparameters self._resources = resources - if self._training_data is None and self._data_generation_type == DataGenerationType.LABEL_GENERATION: + if ( + self._training_data is None + and self._data_generation_type == DataGenerationType.LABEL_GENERATION + ): raise ValueError( f"Training data can not be None when data generation type is set to " f"{DataGenerationType.LABEL_GENERATION}." ) - if self._validation_data is None and self._data_generation_type == DataGenerationType.LABEL_GENERATION: + if ( + self._validation_data is None + and self._data_generation_type == DataGenerationType.LABEL_GENERATION + ): raise ValueError( f"Validation data can not be None when data generation type is set to " f"{DataGenerationType.LABEL_GENERATION}." @@ -123,7 +143,9 @@ def teacher_model_endpoint_connection(self) -> WorkspaceConnection: return self._teacher_model_endpoint_connection @teacher_model_endpoint_connection.setter - def teacher_model_endpoint_connection(self, connection: WorkspaceConnection) -> None: + def teacher_model_endpoint_connection( + self, connection: WorkspaceConnection + ) -> None: """Set the endpoint information of the teacher model. :param connection: Workspace connection @@ -243,7 +265,8 @@ def set_teacher_model_settings( :type endpoint_request_settings: typing.Optional[EndpointRequestSettings] """ self._teacher_model_settings = TeacherModelSettings( - inference_parameters=inference_parameters, endpoint_request_settings=endpoint_request_settings + inference_parameters=inference_parameters, + endpoint_request_settings=endpoint_request_settings, ) def set_prompt_settings(self, prompt_settings: Optional[PromptSettings]): @@ -252,7 +275,9 @@ def set_prompt_settings(self, prompt_settings: Optional[PromptSettings]): :param prompt_settings: Settings related to the system prompt used for generating data. :type prompt_settings: typing.Optional[PromptSettings] """ - self._prompt_settings = prompt_settings if prompt_settings is not None else self._prompt_settings + self._prompt_settings = ( + prompt_settings if prompt_settings is not None else self._prompt_settings + ) def set_finetuning_settings(self, hyperparameters: Optional[Dict]): """Set the hyperparamters for finetuning. @@ -260,7 +285,9 @@ def set_finetuning_settings(self, hyperparameters: Optional[Dict]): :param hyperparameters: The hyperparameters for finetuning. :type hyperparameters: typing.Optional[typing.Dict] """ - self._hyperparameters = hyperparameters if hyperparameters is not None else self._hyperparameters + self._hyperparameters = ( + hyperparameters if hyperparameters is not None else self._hyperparameters + ) def _to_dict(self) -> Dict: """Convert the object to a dictionary. @@ -268,10 +295,14 @@ def _to_dict(self) -> Dict: :return: dictionary representation of the object. :rtype: typing.Dict """ - from azure.ai.ml._schema._distillation.distillation_job import DistillationJobSchema + from azure.ai.ml._schema._distillation.distillation_job import ( + DistillationJobSchema, + ) schema_dict: dict = {} - schema_dict = DistillationJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = DistillationJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump( + self + ) return schema_dict @@ -294,9 +325,13 @@ def _load_from_dict( :return: DistillationJob object. :rtype: DistillationJob """ - from azure.ai.ml._schema._distillation.distillation_job import DistillationJobSchema + from azure.ai.ml._schema._distillation.distillation_job import ( + DistillationJobSchema, + ) - loaded_data = load_from_dict(DistillationJobSchema, data, context, additional_message, **kwargs) + loaded_data = load_from_dict( + DistillationJobSchema, data, context, additional_message, **kwargs + ) training_data = loaded_data.get("training_data", None) if isinstance(training_data, str): @@ -304,11 +339,15 @@ def _load_from_dict( validation_data = loaded_data.get("validation_data", None) if isinstance(validation_data, str): - loaded_data["validation_data"] = Input(type="uri_file", path=validation_data) + loaded_data["validation_data"] = Input( + type="uri_file", path=validation_data + ) student_model = loaded_data.get("student_model", None) if isinstance(student_model, str): - loaded_data["student_model"] = Input(type=AssetTypes.URI_FILE, path=student_model) + loaded_data["student_model"] = Input( + type=AssetTypes.URI_FILE, path=student_model + ) job_instance = DistillationJob(**loaded_data) return job_instance @@ -323,9 +362,13 @@ def _from_rest_object(cls, obj: RestJobBase) -> "DistillationJob": :rtype: DistillationJob """ properties: RestFineTuningJob = obj.properties - finetuning_details: RestCustomModelFineTuningVertical = properties.fine_tuning_details + finetuning_details: RestCustomModelFineTuningVertical = ( + properties.fine_tuning_details + ) - job_kwargs_dict = DistillationJob._filter_properties(properties=properties.properties) + job_kwargs_dict = DistillationJob._filter_properties( + properties=properties.properties + ) job_args_dict = { "id": obj.id, @@ -360,22 +403,42 @@ def _to_rest_object(self) -> "RestFineTuningJob": :return: REST object representation of this object. :rtype: JobBase """ + # Convert any SDK Input values to their REST job-input models BEFORE constructing the arm hybrid + # model. The shared arm_ml_service models coerce a value assigned to a field into their backing + # dict, so a post-construction ``isinstance(..., Input)`` check would no longer see the original + # Input (unlike the old msrest models, which stored the attribute as-is). + student_model = ( + MLFlowModelJobInput(uri=self.student_model.path) + if isinstance(self.student_model, Input) + else self.student_model + ) + training_data = ( + UriFileJobInput(uri=self.training_data.path) + if isinstance(self.training_data, Input) + else self.training_data + ) + validation_data = ( + UriFileJobInput(uri=self.validation_data.path) + if isinstance(self.validation_data, Input) + else self.validation_data + ) + distillation = RestCustomModelFineTuningVertical( task_type="ChatCompletion", - model=self.student_model, + model=student_model, model_provider="Custom", - training_data=self.training_data, - validation_data=self.validation_data, - hyper_parameters=self._hyperparameters, + training_data=training_data, + validation_data=validation_data, + # The v2024_01 msrest CustomModelFineTuning model typed hyper_parameters as Dict[str, str] and + # coerced every value to a string on the wire. The shared arm_ml_service model preserves the + # original value type, so stringify here to keep the serialized body byte-identical. + hyper_parameters=( + {key: str(value) for key, value in self._hyperparameters.items()} + if self._hyperparameters + else self._hyperparameters + ), ) - if isinstance(distillation.training_data, Input): - distillation.training_data = UriFileJobInput(uri=distillation.training_data.path) - if isinstance(distillation.validation_data, Input): - distillation.validation_data = UriFileJobInput(uri=distillation.validation_data.path) - if isinstance(distillation.model, Input): - distillation.model = MLFlowModelJobInput(uri=distillation.model.path) - self._add_distillation_properties(self.properties) finetuning_job = RestFineTuningJob( @@ -414,13 +477,17 @@ def _add_distillation_properties(self, properties: Dict) -> None: :type properties: typing.Dict """ properties[AzureMLDistillationProperties.ENABLE_DISTILLATION] = True - properties[AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE] = self._data_generation_task_type.upper() + properties[AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE] = ( + self._data_generation_task_type.upper() + ) properties[f"{AzureMLDistillationProperties.TEACHER_MODEL}.endpoint_name"] = ( self._teacher_model_endpoint_connection.name ) # Not needed for FT Overload API but additional info needed to convert from REST object to Distillation object - properties[AzureMLDistillationProperties.DATA_GENERATION_TYPE] = self._data_generation_type + properties[AzureMLDistillationProperties.DATA_GENERATION_TYPE] = ( + self._data_generation_type + ) properties[AzureMLDistillationProperties.CONNECTION_INFORMATION] = json.dumps( self._teacher_model_endpoint_connection._to_dict() # pylint: disable=protected-access ) @@ -437,7 +504,9 @@ def _add_distillation_properties(self, properties: Dict) -> None: if inference_settings: for inference_key, value in inference_settings.items(): if value is not None: - properties[f"{AzureMLDistillationProperties.TEACHER_MODEL}.{inference_key}"] = value + properties[ + f"{AzureMLDistillationProperties.TEACHER_MODEL}.{inference_key}" + ] = value if endpoint_settings: for setting, value in endpoint_settings.items(): @@ -445,7 +514,41 @@ def _add_distillation_properties(self, properties: Dict) -> None: properties[f"azureml.{setting.strip('_')}"] = value if self._resources and self._resources.instance_type: - properties[f"{AzureMLDistillationProperties.INSTANCE_TYPE}.data_generation"] = self._resources.instance_type + properties[ + f"{AzureMLDistillationProperties.INSTANCE_TYPE}.data_generation" + ] = self._resources.instance_type + + # TODO: Remove once Distillation is added to MFE + @staticmethod + def _coerce_property_value(value: Any) -> Any: + """Restore a native Python type from a stringified REST property value. + + The shared arm_ml_service ``FineTuningJob.properties`` field is typed ``Dict[str, str]`` and coerces + every value to a string when stored (e.g. ``0.1`` -> ``"0.1"``, ``True`` -> ``"True"``). The old + msrest model kept the native Python value in memory until serialization, so restore the native type + on read to preserve the previous round-trip behavior. The on-the-wire payload is unchanged: both + clients send the stringified form. + + :param value: The property value read from the REST object. + :type value: typing.Any + :return: The value coerced back to bool/int/float where possible, otherwise unchanged. + :rtype: typing.Any + """ + if not isinstance(value, str): + return value + if value == "True": + return True + if value == "False": + return False + try: + return int(value) + except ValueError: + pass + try: + return float(value) + except ValueError: + pass + return value # TODO: Remove once Distillation is added to MFE @classmethod @@ -465,17 +568,20 @@ def _filter_properties(cls, properties: Dict) -> Dict: teacher_model_info = "" for key, val in properties.items(): param = key.split(".")[-1] - if AzureMLDistillationProperties.TEACHER_MODEL in key and param != "endpoint_name": - inference_parameters[param] = val + if ( + AzureMLDistillationProperties.TEACHER_MODEL in key + and param != "endpoint_name" + ): + inference_parameters[param] = cls._coerce_property_value(val) elif AzureMLDistillationProperties.INSTANCE_TYPE in key: resources[key.split(".")[1]] = val elif AzureMLDistillationProperties.CONNECTION_INFORMATION in key: teacher_model_info = val else: if param in EndpointSettings.VALID_SETTINGS: - endpoint_settings[param] = val + endpoint_settings[param] = cls._coerce_property_value(val) elif param in PromptSettingKeys.VALID_SETTINGS: - prompt_settings[param] = val + prompt_settings[param] = cls._coerce_property_value(val) if inference_parameters: teacher_settings["inference_parameters"] = inference_parameters @@ -483,26 +589,38 @@ def _filter_properties(cls, properties: Dict) -> Dict: teacher_settings["endpoint_request_settings"] = EndpointRequestSettings(**endpoint_settings) # type: ignore return { - "data_generation_task_type": properties.get(AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE), - "data_generation_type": properties.get(AzureMLDistillationProperties.DATA_GENERATION_TYPE), + "data_generation_task_type": properties.get( + AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE + ), + "data_generation_type": properties.get( + AzureMLDistillationProperties.DATA_GENERATION_TYPE + ), "teacher_model_endpoint_connection": WorkspaceConnection._load( # pylint: disable=protected-access data=json.loads(teacher_model_info) ), "teacher_model_settings": ( TeacherModelSettings(**teacher_settings) if teacher_settings else None # type: ignore ), - "prompt_settings": PromptSettings(**prompt_settings) if prompt_settings else None, + "prompt_settings": ( + PromptSettings(**prompt_settings) if prompt_settings else None + ), "resources": ResourceConfiguration(**resources) if resources else None, } def _restore_inputs(self) -> None: """Restore UriFileJobInputs to JobInputs within data_settings.""" if isinstance(self.training_data, UriFileJobInput): - self.training_data = Input(type=AssetTypes.URI_FILE, path=self.training_data.uri) + self.training_data = Input( + type=AssetTypes.URI_FILE, path=self.training_data.uri + ) if isinstance(self.validation_data, UriFileJobInput): - self.validation_data = Input(type=AssetTypes.URI_FILE, path=self.validation_data.uri) + self.validation_data = Input( + type=AssetTypes.URI_FILE, path=self.validation_data.uri + ) if isinstance(self.student_model, MLFlowModelJobInput): - self.student_model = Input(type=AssetTypes.MLFLOW_MODEL, path=self.student_model.uri) + self.student_model = Input( + type=AssetTypes.MLFLOW_MODEL, path=self.student_model.uri + ) def __eq__(self, other: object) -> bool: """Returns True if both instances have the same values. @@ -531,7 +649,8 @@ def __eq__(self, other: object) -> bool: return ( self.data_generation_type == other.data_generation_type and self.data_generation_task_type == other.data_generation_task_type - and self.teacher_model_endpoint_connection.name == other.teacher_model_endpoint_connection.name + and self.teacher_model_endpoint_connection.name + == other.teacher_model_endpoint_connection.name and self.student_model == other.student_model and self.training_data == other.training_data and self.validation_data == other.validation_data diff --git a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py index 8be2579c4592..d7c3f65a132b 100644 --- a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py +++ b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py @@ -3,18 +3,29 @@ import pytest -from azure.ai.ml._restclient.v2024_01_01_preview.models import MLFlowModelJobInput, UriFileJobInput +from azure.ai.ml._restclient.arm_ml_service.models import ( + MLFlowModelJobInput, + UriFileJobInput, +) from azure.ai.ml.constants import DataGenerationTaskType, DataGenerationType from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job.distillation.distillation_job import DistillationJob -from azure.ai.ml.entities._job.distillation.endpoint_request_settings import EndpointRequestSettings +from azure.ai.ml.entities._job.distillation.endpoint_request_settings import ( + EndpointRequestSettings, +) from azure.ai.ml.entities._job.distillation.prompt_settings import PromptSettings -from azure.ai.ml.entities._job.distillation.teacher_model_settings import TeacherModelSettings +from azure.ai.ml.entities._job.distillation.teacher_model_settings import ( + TeacherModelSettings, +) from azure.ai.ml.entities._job.job import Job from azure.ai.ml.entities._job.resource_configuration import ResourceConfiguration -from azure.ai.ml.entities._workspace.connections.connection_subtypes import ServerlessConnection -from azure.ai.ml.entities._workspace.connections.workspace_connection import WorkspaceConnection +from azure.ai.ml.entities._workspace.connections.connection_subtypes import ( + ServerlessConnection, +) +from azure.ai.ml.entities._workspace.connections.workspace_connection import ( + WorkspaceConnection, +) class TestDistillationJobConversion: @@ -51,7 +62,9 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): data_generation_type=DataGenerationType.LABEL_GENERATION, data_generation_task_type=data_generation_task_type, teacher_model_endpoint_connection=ServerlessConnection( - name="Llama-3-1-405B-Instruct-BASE", endpoint="http://foo.com", api_key="TESTKEY" + name="Llama-3-1-405B-Instruct-BASE", + endpoint="http://foo.com", + api_key="TESTKEY", ), student_model=Input( type=AssetTypes.MLFLOW_MODEL, @@ -61,13 +74,17 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): validation_data=Input(type=AssetTypes.URI_FILE, path="bar.jsonl"), teacher_model_settings=TeacherModelSettings( inference_parameters={"temperature": 0.1}, - endpoint_request_settings=EndpointRequestSettings(request_batch_size=2, min_endpoint_success_ratio=0.8), + endpoint_request_settings=EndpointRequestSettings( + request_batch_size=2, min_endpoint_success_ratio=0.8 + ), ), prompt_settings=PromptSettings(enable_chain_of_thought=True), hyperparameters={"bar": "baz"}, name="llama-distillation", experiment_name="bar_experiment", - outputs={"registered_model": Output(type="mlflow_model", name="llama-distilled")}, + outputs={ + "registered_model": Output(type="mlflow_model", name="llama-distilled") + }, ) rest_object = distillation_job._to_rest_object() @@ -80,7 +97,8 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): original_object = DistillationJob._from_rest_object(rest_object) assert ( - original_object.data_generation_task_type.lower() == data_generation_task_type.lower() + original_object.data_generation_task_type.lower() + == data_generation_task_type.lower() ), "Data Generation Task Type not set correctly" assert ( original_object.data_generation_type == DataGenerationType.LABEL_GENERATION @@ -93,57 +111,90 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): original_object.teacher_model_endpoint_connection, ServerlessConnection ), "Teacher model endpoint connection is not ServerlessConnection" assert ( - original_object.teacher_model_endpoint_connection.name == "Llama-3-1-405B-Instruct-BASE" + original_object.teacher_model_endpoint_connection.name + == "Llama-3-1-405B-Instruct-BASE" ), "Teacher model endpoint connection name not set correctly" assert ( - original_object.teacher_model_endpoint_connection.endpoint == "http://foo.com" + original_object.teacher_model_endpoint_connection.endpoint + == "http://foo.com" ), "Teacher model endpoint connection endpoint url not set correctly" assert ( original_object.teacher_model_endpoint_connection.api_key == "TESTKEY" ), "Teacher model endpoint connection api_key not set correctly" - assert isinstance(original_object.student_model, Input), "Student model is not Input" - assert original_object.student_model.type == AssetTypes.MLFLOW_MODEL, "Student model type is not mlflow_model" + assert isinstance( + original_object.student_model, Input + ), "Student model is not Input" + assert ( + original_object.student_model.type == AssetTypes.MLFLOW_MODEL + ), "Student model type is not mlflow_model" assert ( original_object.student_model.path == "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1" ), "Student model path not set correctly" - assert isinstance(original_object.training_data, Input), "Training data is not Input" - assert original_object.training_data.type == AssetTypes.URI_FILE, "Training data type not set correctly" - assert original_object.training_data.path == "foo.jsonl", "Training data path not set correctly" - assert isinstance(original_object.validation_data, Input), "Validation data is not Input" - assert original_object.validation_data.type == AssetTypes.URI_FILE, "Validation data type not set correctly" - assert original_object.validation_data.path == "bar.jsonl", "Validation data path not set correctly" + assert isinstance( + original_object.training_data, Input + ), "Training data is not Input" + assert ( + original_object.training_data.type == AssetTypes.URI_FILE + ), "Training data type not set correctly" + assert ( + original_object.training_data.path == "foo.jsonl" + ), "Training data path not set correctly" + assert isinstance( + original_object.validation_data, Input + ), "Validation data is not Input" + assert ( + original_object.validation_data.type == AssetTypes.URI_FILE + ), "Validation data type not set correctly" + assert ( + original_object.validation_data.path == "bar.jsonl" + ), "Validation data path not set correctly" assert original_object.teacher_model_settings.inference_parameters == { "temperature": 0.1 }, "Inference parameters not set correctly" - assert original_object._hyperparameters == {"bar": "baz"}, "Hyperparameters not set correctly" + assert original_object._hyperparameters == { + "bar": "baz" + }, "Hyperparameters not set correctly" assert original_object.name == "llama-distillation", "Name not set correctly" - assert original_object.experiment_name == "bar_experiment", "Experiment name not set correctly" + assert ( + original_object.experiment_name == "bar_experiment" + ), "Experiment name not set correctly" assert isinstance( original_object.teacher_model_settings, TeacherModelSettings ), "Teacher model settings is not TeacherModelSettings" assert isinstance( - original_object.teacher_model_settings.endpoint_request_settings, EndpointRequestSettings + original_object.teacher_model_settings.endpoint_request_settings, + EndpointRequestSettings, ), "Endpoint request settings is not EndpointRequestSettings" assert ( - original_object.teacher_model_settings.endpoint_request_settings.request_batch_size == 2 + original_object.teacher_model_settings.endpoint_request_settings.request_batch_size + == 2 ), "Request batch size not set correctly" assert ( - original_object.teacher_model_settings.endpoint_request_settings.min_endpoint_success_ratio == 0.8 + original_object.teacher_model_settings.endpoint_request_settings.min_endpoint_success_ratio + == 0.8 ), "Min endpoint success ration not set correctly" assert isinstance( original_object._prompt_settings, PromptSettings ), "Prompt settings is not DistillationPromptSettings" - assert original_object._prompt_settings.enable_chain_of_thought, "Chain of thought not set correctly" - assert not original_object._prompt_settings.enable_chain_of_density, "Chain of density not set correctly" - assert original_object._prompt_settings.max_len_summary is None, "Max len summary not set correctly" + assert ( + original_object._prompt_settings.enable_chain_of_thought + ), "Chain of thought not set correctly" + assert ( + not original_object._prompt_settings.enable_chain_of_density + ), "Chain of density not set correctly" + assert ( + original_object._prompt_settings.max_len_summary is None + ), "Max len summary not set correctly" - assert distillation_job == original_object, "Conversion to/from rest object failed" + assert ( + distillation_job == original_object + ), "Conversion to/from rest object failed" @pytest.mark.parametrize( "data_generation_task_type", @@ -166,8 +217,12 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): type=AssetTypes.MLFLOW_MODEL, path="azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B/versions/1", ), - training_data=Input(type=AssetTypes.URI_FILE, path="./alex_dataset/math_train.json1"), - validation_data=Input(type=AssetTypes.URI_FILE, path="./alex_dataset/math_val.json1"), + training_data=Input( + type=AssetTypes.URI_FILE, path="./alex_dataset/math_train.json1" + ), + validation_data=Input( + type=AssetTypes.URI_FILE, path="./alex_dataset/math_val.json1" + ), teacher_model_settings=TeacherModelSettings( inference_parameters={"max_tokens": 248}, endpoint_request_settings=None ), @@ -178,7 +233,9 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): experiment_name="llama-experiment", tags={"bar": "baz"}, properties={"foo": "baz"}, - outputs={"registered_model": Output(type="mlflow_model", name="llama-distilled")}, + outputs={ + "registered_model": Output(type="mlflow_model", name="llama-distilled") + }, ) dict_object = distillation_job._to_dict() @@ -189,7 +246,9 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): dict_object["data_generation_task_type"] == data_generation_task_type ), "Data Generation Task Type not set correctly" assert dict_object["name"] == "llama-distillation", "Name not set correctly" - assert dict_object["experiment_name"] == "llama-experiment", "Experiment name not set correctly" + assert ( + dict_object["experiment_name"] == "llama-experiment" + ), "Experiment name not set correctly" assert dict_object["tags"] == {"bar": "baz"}, "Tags not set correctly" assert dict_object["properties"]["foo"] == "baz", "Properties not set correctly" @@ -197,30 +256,41 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): dict_object["teacher_model_endpoint_connection"]["name"] == "llama-teacher" ), "Teacher model endpoint connection name not set correctly" assert ( - dict_object["teacher_model_endpoint_connection"]["endpoint"] == "http://bar.com" + dict_object["teacher_model_endpoint_connection"]["endpoint"] + == "http://bar.com" ), "Teacher model endpoint connection endpoint url not set correctly" assert ( dict_object["teacher_model_endpoint_connection"]["api_key"] == "TESTKEY" ), "Teacher model endpoint connection api_key not set correctly" - assert dict_object["student_model"]["type"] == "mlflow_model", "Student model type not set correctly" + assert ( + dict_object["student_model"]["type"] == "mlflow_model" + ), "Student model type not set correctly" assert ( dict_object["student_model"]["path"] == "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B/versions/1" ), "Student model path not set correctly" - assert dict_object["training_data"]["type"] == AssetTypes.URI_FILE, "Training data type not set correctly" assert ( - dict_object["training_data"]["path"] == "azureml:./alex_dataset/math_train.json1" + dict_object["training_data"]["type"] == AssetTypes.URI_FILE + ), "Training data type not set correctly" + assert ( + dict_object["training_data"]["path"] + == "azureml:./alex_dataset/math_train.json1" ), "Training data path not set correctly" - assert dict_object["validation_data"]["type"] == AssetTypes.URI_FILE, "Validation data type not set correctly" assert ( - dict_object["validation_data"]["path"] == "azureml:./alex_dataset/math_val.json1" + dict_object["validation_data"]["type"] == AssetTypes.URI_FILE + ), "Validation data type not set correctly" + assert ( + dict_object["validation_data"]["path"] + == "azureml:./alex_dataset/math_val.json1" ), "Validation data path not set correctly" assert dict_object["teacher_model_settings"]["inference_parameters"] == { "max_tokens": 248 }, "Inference parameters not set correctly" - assert dict_object["prompt_settings"]["enable_chain_of_thought"], "Enable chain of thought not set correctly" + assert dict_object["prompt_settings"][ + "enable_chain_of_thought" + ], "Enable chain of thought not set correctly" assert not dict_object["prompt_settings"][ "enable_chain_of_density" ], "Enable chain of density not set correctly" diff --git a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py index d45859ec3830..72e5f9fa5ea5 100644 --- a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py @@ -1,14 +1,22 @@ from pathlib import Path from azure.ai.ml import load_job -from azure.ai.ml._restclient.v2024_01_01_preview.models import FineTuningJob +from azure.ai.ml._restclient.arm_ml_service.models import FineTuningJob from azure.ai.ml.constants import DataGenerationTaskType, DataGenerationType -from azure.ai.ml.entities import NoneCredentialConfiguration, ServerlessConnection, WorkspaceConnection +from azure.ai.ml.entities import ( + NoneCredentialConfiguration, + ServerlessConnection, + WorkspaceConnection, +) from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job.distillation.distillation_job import DistillationJob -from azure.ai.ml.entities._job.distillation.endpoint_request_settings import EndpointRequestSettings +from azure.ai.ml.entities._job.distillation.endpoint_request_settings import ( + EndpointRequestSettings, +) from azure.ai.ml.entities._job.distillation.prompt_settings import PromptSettings -from azure.ai.ml.entities._job.distillation.teacher_model_settings import TeacherModelSettings +from azure.ai.ml.entities._job.distillation.teacher_model_settings import ( + TeacherModelSettings, +) from azure.ai.ml.entities._job.finetuning.finetuning_job import FineTuningJob from azure.ai.ml.entities._job.resource_configuration import ResourceConfiguration @@ -35,18 +43,38 @@ def test_distillation_job_full_rest_transform(self): type="mlflow_model", path="azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1", ), - training_data=Input(type="uri_file", path="./samsum_dataset/small_train.jsonl"), - validation_data=Input(type="uri_file", path="./samsum_dataset/small_validation.jsonl"), + training_data=Input( + type="uri_file", path="./samsum_dataset/small_train.jsonl" + ), + validation_data=Input( + type="uri_file", path="./samsum_dataset/small_validation.jsonl" + ), teacher_model_settings=TeacherModelSettings( - inference_parameters={"temperature": 0.1, "max_tokens": 100, "top_p": 0.95}, - endpoint_request_settings=EndpointRequestSettings(request_batch_size=5, min_endpoint_success_ratio=0.7), + inference_parameters={ + "temperature": 0.1, + "max_tokens": 100, + "top_p": 0.95, + }, + endpoint_request_settings=EndpointRequestSettings( + request_batch_size=5, min_endpoint_success_ratio=0.7 + ), ), - prompt_settings=PromptSettings(enable_chain_of_thought=False, enable_chain_of_density=False), - hyperparameters={"learning_rate": "0.00002", "num_train_epochs": "1", "per_device_train_batch_size": "1"}, + prompt_settings=PromptSettings( + enable_chain_of_thought=False, enable_chain_of_density=False + ), + hyperparameters={ + "learning_rate": "0.00002", + "num_train_epochs": "1", + "per_device_train_batch_size": "1", + }, experiment_name="Distillation-Math-Test-1234", name="distillation_job_test", description="Distill Llama 3.1 8b model using Llama 3.1 405B teacher model", - outputs={"registered_model": Output(type="mlflow_model", name="llama-3-1-8b-distilled-1234")}, + outputs={ + "registered_model": Output( + type="mlflow_model", name="llama-3-1-8b-distilled-1234" + ) + }, resources=ResourceConfiguration(instance_type="Standard_D2_v2"), ) sdk_rest_object = DistillationJob._to_rest_object(distillation_job) @@ -60,7 +88,9 @@ def test_distillation_job_input_rest_transform(self): data_generation_type=DataGenerationType.LABEL_GENERATION, data_generation_task_type=DataGenerationTaskType.SUMMARIZATION, teacher_model_endpoint_connection=ServerlessConnection( - name="Llama-3-1-405B-Instruct-BASE", endpoint="http://foo.com", api_key="FAKEKEY" + name="Llama-3-1-405B-Instruct-BASE", + endpoint="http://foo.com", + api_key="FAKEKEY", ), student_model=Input( type="mlflow_model", @@ -70,16 +100,24 @@ def test_distillation_job_input_rest_transform(self): validation_data=Input(type="uri_file", path="validation_data:1"), teacher_model_settings=TeacherModelSettings( inference_parameters={"frequency_penalty": 1, "presence_penalty": 1}, - endpoint_request_settings=EndpointRequestSettings(min_endpoint_success_ratio=0.9), + endpoint_request_settings=EndpointRequestSettings( + min_endpoint_success_ratio=0.9 + ), ), prompt_settings=PromptSettings( - enable_chain_of_thought=False, enable_chain_of_density=True, max_len_summary=220 + enable_chain_of_thought=False, + enable_chain_of_density=True, + max_len_summary=220, ), hyperparameters={"num_train_epochs": "3"}, experiment_name="Distillation-Math-Test-1234", name="distillation_job_test", description="Distill Llama 3.1 8b model using Llama 3.1 405B teacher model", - outputs={"registered_model": Output(type="mlflow_model", name="llama-3-1-8b-distilled-1234")}, + outputs={ + "registered_model": Output( + type="mlflow_model", name="llama-3-1-8b-distilled-1234" + ) + }, resources=ResourceConfiguration(instance_type="Standard_D2_v3"), ) sdk_rest_object = DistillationJob._to_rest_object(distillation_job) From 2164ae851e16da0ec18e56d006ab8c9a9255cf20 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 16:11:41 +0530 Subject: [PATCH 035/146] Migrate job.py off v2024_01: arm JobBase + literal FineTuning discriminator The shared arm_ml_service JobType enum has no FINE_TUNING member, but the wire discriminator for fine-tuning jobs is the literal string 'FineTuning' (emitted by both arm and v2024_01 FineTuningJob models). Compare against the literal so the read dispatcher works regardless of which client deserialized the object. Drop the v2024_01 JobBase/JobType imports; use arm JobBase in the Union. Validated: distillation+finetuning+command+spark+sweep+smoke 332 passed, job_common+automl+pipeline 487 passed. --- .../azure/ai/ml/entities/_job/job.py | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py index 74b714250108..5990874ceb89 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py @@ -16,11 +16,13 @@ from azure.ai.ml._restclient.runhistory.models import Run from azure.ai.ml._restclient.arm_ml_service.models import JobBase, JobService from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobType as RestJobType_20240101Preview from azure.ai.ml._utils._html_utils import make_link, to_html 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, CommonYamlFields +from azure.ai.ml.constants._common import ( + BASE_PATH_CONTEXT_KEY, + PARAMS_OVERRIDE_KEY, + CommonYamlFields, +) from azure.ai.ml.constants._compute import ComputeType from azure.ai.ml.constants._job.job import JobServices, JobType from azure.ai.ml.entities._mixins import TelemetryMixin @@ -172,7 +174,9 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) + dump_yaml_to_file( + dest, yaml_serialized, default_flow_style=False, path=path, **kwargs + ) def _get_base_info_dict(self) -> OrderedDict: return OrderedDict( @@ -191,7 +195,9 @@ def _repr_html_(self) -> str: [ ( "Details Page", - make_link(self.studio_url, "Link to Azure Machine Learning studio"), + make_link( + self.studio_url, "Link to Azure Machine Learning studio" + ), ), ] ) @@ -203,11 +209,15 @@ def _to_dict(self) -> Dict: pass @classmethod - def _resolve_cls_and_type(cls, data: Dict, params_override: Optional[List[Dict]] = None) -> Tuple: + def _resolve_cls_and_type( + cls, data: Dict, params_override: Optional[List[Dict]] = None + ) -> Tuple: from azure.ai.ml.entities._builders.command import Command from azure.ai.ml.entities._builders.spark import Spark from azure.ai.ml.entities._job.automl.automl_job import AutoMLJob - from azure.ai.ml.entities._job.distillation.distillation_job import DistillationJob + from azure.ai.ml.entities._job.distillation.distillation_job import ( + DistillationJob, + ) from azure.ai.ml.entities._job.finetuning.finetuning_job import FineTuningJob from azure.ai.ml.entities._job.import_job import ImportJob from azure.ai.ml.entities._job.pipeline.pipeline_job import PipelineJob @@ -215,7 +225,9 @@ def _resolve_cls_and_type(cls, data: Dict, params_override: Optional[List[Dict]] job_type: Optional[Type["Job"]] = None type_in_override = find_type_in_override(params_override) - type_str = type_in_override or data.get(CommonYamlFields.TYPE, JobType.COMMAND) # override takes the priority + type_str = type_in_override or data.get( + CommonYamlFields.TYPE, JobType.COMMAND + ) # override takes the priority if type_str == JobType.COMMAND: job_type = Command elif type_str == JobType.SPARK: @@ -286,14 +298,16 @@ def _load( @classmethod def _from_rest_object( # pylint: disable=too-many-return-statements - cls, obj: Union[JobBase, JobBase_2401, Run] + cls, obj: Union[JobBase, Run] ) -> "Job": from azure.ai.ml.entities import PipelineJob from azure.ai.ml.entities._builders.command import Command from azure.ai.ml.entities._builders.spark import Spark from azure.ai.ml.entities._job.automl.automl_job import AutoMLJob from azure.ai.ml.entities._job.base_job import _BaseJob - from azure.ai.ml.entities._job.distillation.distillation_job import DistillationJob + from azure.ai.ml.entities._job.distillation.distillation_job import ( + DistillationJob, + ) from azure.ai.ml.entities._job.finetuning.finetuning_job import FineTuningJob from azure.ai.ml.entities._job.import_job import ImportJob from azure.ai.ml.entities._job.sweep.sweep_job import SweepJob @@ -307,7 +321,9 @@ def _from_rest_object( # pylint: disable=too-many-return-statements if obj.properties.job_type == RestJobType.COMMAND: # PrP only until new import job type is ready on MFE in PuP # compute type 'DataFactory' is reserved compute name for 'clusterless' ADF jobs - if obj.properties.compute_id and obj.properties.compute_id.endswith("/" + ComputeType.ADF): + if obj.properties.compute_id and obj.properties.compute_id.endswith( + "/" + ComputeType.ADF + ): return ImportJob._load_from_rest(obj) res_command: Job = Command._load_from_rest_job(obj) @@ -323,7 +339,11 @@ def _from_rest_object( # pylint: disable=too-many-return-statements return SweepJob._load_from_rest(obj) if obj.properties.job_type == RestJobType.AUTO_ML: return AutoMLJob._load_from_rest(obj) - if obj.properties.job_type == RestJobType_20240101Preview.FINE_TUNING: + # The shared arm_ml_service JobType enum has no FINE_TUNING member, but the wire discriminator + # for fine-tuning jobs is the literal string "FineTuning" (emitted by both the arm and v2024_01 + # FineTuningJob models). Compare against the literal so this works regardless of which client + # deserialized the object. + if obj.properties.job_type == "FineTuning": if obj.properties.properties.get("azureml.enable_distillation", False): return DistillationJob._load_from_rest(obj) return FineTuningJob._load_from_rest(obj) @@ -360,5 +380,7 @@ def _get_telemetry_values(self) -> Dict: # pylint: disable=arguments-differ @classmethod @abstractmethod - def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Job": + def _load_from_dict( + cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any + ) -> "Job": pass From f7d174e61d1de435ad526be059da120523934bc4 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 7 Jul 2026 18:07:37 +0530 Subject: [PATCH 036/146] Migrate workspace connection entity family to arm_ml_service models Flip the v2024_04 WorkspaceConnectionPropertiesV2BasicResource, ConnectionCategory and all *AuthTypeWorkspaceConnectionProperties models to the shared arm_ml_service client across workspace_connection.py, connection_subtypes.py and the connection block in _credentials.py (these must move together so the isinstance/discriminator checks match). Wire verified byte-identical via the msrest serializer. Validated: connection+smoke 179 passed, connection+workspace 97 passed. --- .../azure/ai/ml/entities/_credentials.py | 2 +- .../connections/connection_subtypes.py | 29 ++-- .../connections/workspace_connection.py | 134 ++++++++++++++---- 3 files changed, 127 insertions(+), 38 deletions(-) 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 8bd1996e40c7..244deb7ddb0b 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 @@ -83,7 +83,7 @@ # Note, this import needs to match the restclient that's imported by the # Connection class, otherwise some unit tests will start failing # Due to the mismatch between expected and received classes in WC rest conversions. -from azure.ai.ml._restclient.v2024_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py index d97e513e8a88..e3f52a0dde63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py @@ -5,7 +5,7 @@ import re from typing import Any, Dict, List, Optional, Type, Union -from azure.ai.ml._restclient.v2024_04_01_preview.models import ConnectionCategory +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionCategory from azure.ai.ml._schema.workspace.connections.connection_subtypes import ( APIKeyConnectionSchema, AzureAISearchConnectionSchema, @@ -31,7 +31,10 @@ CognitiveServiceKinds, ConnectionTypes, ) -from azure.ai.ml.entities._credentials import AadCredentialConfiguration, ApiKeyConfiguration +from azure.ai.ml.entities._credentials import ( + AadCredentialConfiguration, + ApiKeyConfiguration, +) from .one_lake_artifacts import OneLakeConnectionArtifact from .workspace_connection import WorkspaceConnection @@ -192,8 +195,12 @@ def __init__( if endpoint is None: raise ValueError("If target is unset, then endpoint must be set") if one_lake_workspace_name is None: - raise ValueError("If target is unset, then one_lake_workspace_name must be set") - target = MicrosoftOneLakeConnection._construct_target(endpoint, one_lake_workspace_name, artifact) + raise ValueError( + "If target is unset, then one_lake_workspace_name must be set" + ) + target = MicrosoftOneLakeConnection._construct_target( + endpoint, one_lake_workspace_name, artifact + ) super().__init__( target=target, type=camel_to_snake(ConnectionCategory.AZURE_ONE_LAKE), @@ -209,7 +216,9 @@ def _get_schema_class(cls) -> Type: # Target is constructed from user inputs, because it's apparently very difficult for users to # directly access a One Lake's target URL. @classmethod - def _construct_target(cls, endpoint: str, workspace: str, artifact: OneLakeConnectionArtifact) -> str: + def _construct_target( + cls, endpoint: str, workspace: str, artifact: OneLakeConnectionArtifact + ) -> str: artifact_name = artifact.name # If an id is supplied, the format is different if re.match(".{7}-.{4}-.{4}-.{4}.{12}", artifact_name): @@ -253,8 +262,8 @@ def __init__( **kwargs: Any, ): # See if credentials directly inputted via kwargs - credentials: Union[AadCredentialConfiguration, ApiKeyConfiguration] = kwargs.pop( - "credentials", AadCredentialConfiguration() + credentials: Union[AadCredentialConfiguration, ApiKeyConfiguration] = ( + kwargs.pop("credentials", AadCredentialConfiguration()) ) # Replace anything that isn't an API credential with an AAD credential. # Importantly, this replaced the None credential default from the parent YAML schema. @@ -353,7 +362,11 @@ def __init__( @classmethod def _get_required_metadata_fields(cls) -> List[str]: - return [CONNECTION_API_VERSION_KEY, CONNECTION_API_TYPE_KEY, CONNECTION_RESOURCE_ID_KEY] + return [ + CONNECTION_API_VERSION_KEY, + CONNECTION_API_TYPE_KEY, + CONNECTION_RESOURCE_ID_KEY, + ] @classmethod def _get_schema_class(cls) -> Type: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py index ab1ee9f88cd2..267164e39412 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py @@ -10,16 +10,18 @@ from typing import IO, Any, AnyStr, Dict, List, Optional, Type, Union, cast -from azure.ai.ml._restclient.v2024_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionPropertiesV2BasicResource as RestWorkspaceConnection, ) -from azure.ai.ml._restclient.v2024_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ConnectionCategory, NoneAuthTypeWorkspaceConnectionProperties, AADAuthTypeWorkspaceConnectionProperties, ) -from azure.ai.ml._schema.workspace.connections.workspace_connection import WorkspaceConnectionSchema +from azure.ai.ml._schema.workspace.connections.workspace_connection import ( + WorkspaceConnectionSchema, +) from azure.ai.ml._utils.utils import _snake_to_camel, camel_to_snake, dump_yaml_to_file from azure.ai.ml.constants._common import ( BASE_PATH_CONTEXT_KEY, @@ -48,15 +50,30 @@ CONNECTION_CATEGORY_TO_CREDENTIAL_MAP = { - ConnectionCategory.AZURE_BLOB: [AccessKeyConfiguration, SasTokenConfiguration, AadCredentialConfiguration], + ConnectionCategory.AZURE_BLOB: [ + AccessKeyConfiguration, + SasTokenConfiguration, + AadCredentialConfiguration, + ], ConnectionTypes.AZURE_DATA_LAKE_GEN_2: [ ServicePrincipalConfiguration, AadCredentialConfiguration, ManagedIdentityConfiguration, ], - ConnectionCategory.GIT: [PatTokenConfiguration, NoneCredentialConfiguration, UsernamePasswordConfiguration], - ConnectionCategory.PYTHON_FEED: [UsernamePasswordConfiguration, PatTokenConfiguration, NoneCredentialConfiguration], - ConnectionCategory.CONTAINER_REGISTRY: [ManagedIdentityConfiguration, UsernamePasswordConfiguration], + ConnectionCategory.GIT: [ + PatTokenConfiguration, + NoneCredentialConfiguration, + UsernamePasswordConfiguration, + ], + ConnectionCategory.PYTHON_FEED: [ + UsernamePasswordConfiguration, + PatTokenConfiguration, + NoneCredentialConfiguration, + ], + ConnectionCategory.CONTAINER_REGISTRY: [ + ManagedIdentityConfiguration, + UsernamePasswordConfiguration, + ], } DATASTORE_CONNECTIONS = { @@ -65,7 +82,13 @@ ConnectionCategory.AZURE_ONE_LAKE, } -CONNECTION_ALTERNATE_TARGET_NAMES = ["target", "api_base", "url", "azure_endpoint", "endpoint"] +CONNECTION_ALTERNATE_TARGET_NAMES = [ + "target", + "api_base", + "url", + "azure_endpoint", + "endpoint", +] # Dev note: The acceptable strings for the type field are all snake_cased versions of the string constants defined @@ -153,7 +176,10 @@ def __init__( target = None for target_name in CONNECTION_ALTERNATE_TARGET_NAMES: target = kwargs.pop(target_name, target) - if target is None and type not in {ConnectionCategory.SERP, ConnectionCategory.Open_AI}: + if target is None and type not in { + ConnectionCategory.SERP, + ConnectionCategory.Open_AI, + }: raise ValueError("target is a required field for Connection.") tags = kwargs.pop("tags", None) @@ -168,7 +194,9 @@ def __init__( ) else: metadata = tags - warnings.warn("Tags are a deprecated field for connections, use metadata instead.") + warnings.warn( + "Tags are a deprecated field for connections, use metadata instead." + ) super().__init__(**kwargs) @@ -191,13 +219,17 @@ def _validate_cred_for_conn_cat(self) -> None: # so I will endeavor to smooth over that inconsistency here. converted_type = _snake_to_camel(self.type).lower() if self._credentials == NoneCredentialConfiguration() and any( - converted_type == _snake_to_camel(item).lower() for item in DATASTORE_CONNECTIONS + converted_type == _snake_to_camel(item).lower() + for item in DATASTORE_CONNECTIONS ): self._credentials = AadCredentialConfiguration() if self.type in CONNECTION_CATEGORY_TO_CREDENTIAL_MAP: allowed_credentials = CONNECTION_CATEGORY_TO_CREDENTIAL_MAP[self.type] - if self.credentials is None and NoneCredentialConfiguration not in allowed_credentials: + if ( + self.credentials is None + and NoneCredentialConfiguration not in allowed_credentials + ): raise ValueError( f"Cannot instantiate a Connection with a type of {self.type} and no credentials." f"Please supply credentials from one of the following types: {allowed_credentials}." @@ -387,7 +419,9 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) + dump_yaml_to_file( + dest, yaml_serialized, default_flow_style=False, path=path, **kwargs + ) @classmethod def _load( @@ -406,10 +440,14 @@ def _load( return cls._load_from_dict(data=data, context=context, **kwargs) @classmethod - def _load_from_dict(cls, data: Dict, context: Dict, **kwargs: Any) -> "WorkspaceConnection": + def _load_from_dict( + cls, data: Dict, context: Dict, **kwargs: Any + ) -> "WorkspaceConnection": conn_type = data["type"] if "type" in data else None schema_class = cls._get_schema_class_from_type(conn_type) - loaded_data: WorkspaceConnection = load_from_dict(schema_class, data, context, **kwargs) + loaded_data: WorkspaceConnection = load_from_dict( + schema_class, data, context, **kwargs + ) return loaded_data def _to_dict(self) -> Dict: @@ -420,16 +458,26 @@ def _to_dict(self) -> Dict: return res @classmethod - def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> "WorkspaceConnection": + def _from_rest_object( + cls, rest_obj: RestWorkspaceConnection + ) -> "WorkspaceConnection": conn_class = cls._get_entity_class_from_rest_obj(rest_obj) popped_metadata = conn_class._get_required_metadata_fields() - rest_kwargs = cls._extract_kwargs_from_rest_obj(rest_obj=rest_obj, popped_metadata=popped_metadata) + rest_kwargs = cls._extract_kwargs_from_rest_obj( + rest_obj=rest_obj, popped_metadata=popped_metadata + ) # Check for alternative name for custom connection type (added for client clarity). - if rest_kwargs["type"].lower() == camel_to_snake(ConnectionCategory.CUSTOM_KEYS).lower(): + if ( + rest_kwargs["type"].lower() + == camel_to_snake(ConnectionCategory.CUSTOM_KEYS).lower() + ): rest_kwargs["type"] = ConnectionTypes.CUSTOM - if rest_kwargs["type"].lower() == camel_to_snake(ConnectionCategory.ADLS_GEN2).lower(): + if ( + rest_kwargs["type"].lower() + == camel_to_snake(ConnectionCategory.ADLS_GEN2).lower() + ): rest_kwargs["type"] = ConnectionTypes.AZURE_DATA_LAKE_GEN_2 target = rest_kwargs.get("target", "") # This dumb code accomplishes 2 things. @@ -449,7 +497,9 @@ def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> "WorkspaceConne # AI Services renames it's metadata field when surfaced to users and inputted # into it's initializer for clarity. ResourceId doesn't really tell much on its own. # No default in pop, this should fail if we somehow don't get a resource ID - rest_kwargs["ai_services_resource_id"] = rest_kwargs.pop(camel_to_snake(CONNECTION_RESOURCE_ID_KEY)) + rest_kwargs["ai_services_resource_id"] = rest_kwargs.pop( + camel_to_snake(CONNECTION_RESOURCE_ID_KEY) + ) connection = conn_class(**rest_kwargs) return cast(WorkspaceConnection, connection) @@ -490,7 +540,11 @@ def _to_rest_object(self) -> RestWorkspaceConnection: else: properties = connection_properties_class( target=self.target, - credentials=self.credentials._to_workspace_connection_rest_object() if self._credentials else None, + credentials=( + self.credentials._to_workspace_connection_rest_object() + if self._credentials + else None + ), metadata=self.metadata, category=_snake_to_camel(conn_type), is_shared_to_all=self.is_shared, @@ -520,25 +574,39 @@ def _extract_kwargs_from_rest_obj( properties = rest_obj.properties credentials: Any = NoneCredentialConfiguration() - credentials_class = _BaseIdentityConfiguration._get_credential_class_from_rest_type(properties.auth_type) + credentials_class = ( + _BaseIdentityConfiguration._get_credential_class_from_rest_type( + properties.auth_type + ) + ) # None and AAD auth types have a property bag class, but no credentials inside that. # Thankfully they both have no inputs. if credentials_class is AadCredentialConfiguration: credentials = AadCredentialConfiguration() elif credentials_class is not NoneCredentialConfiguration: - credentials = credentials_class._from_workspace_connection_rest_object(properties.credentials) + credentials = credentials_class._from_workspace_connection_rest_object( + properties.credentials + ) metadata = properties.metadata if hasattr(properties, "metadata") else {} rest_kwargs = { "id": rest_obj.id, "name": rest_obj.name, "target": properties.target, - "creation_context": SystemData._from_rest_object(rest_obj.system_data) if rest_obj.system_data else None, + "creation_context": ( + SystemData._from_rest_object(rest_obj.system_data) + if rest_obj.system_data + else None + ), "type": camel_to_snake(properties.category), "credentials": credentials, "metadata": metadata, - "is_shared": properties.is_shared_to_all if hasattr(properties, "is_shared_to_all") else True, + "is_shared": ( + properties.is_shared_to_all + if hasattr(properties, "is_shared_to_all") + else True + ), } for name in popped_metadata: @@ -590,11 +658,19 @@ def _get_entity_class_from_type(cls, type: str) -> Type: ConnectionCategory.OPEN_AI.lower(): OpenAIConnection, ConnectionCategory.SERP.lower(): SerpConnection, ConnectionCategory.SERVERLESS.lower(): ServerlessConnection, - _snake_to_camel(ConnectionTypes.AZURE_CONTENT_SAFETY).lower(): AzureContentSafetyConnection, - _snake_to_camel(ConnectionTypes.AZURE_SPEECH_SERVICES).lower(): AzureSpeechServicesConnection, + _snake_to_camel( + ConnectionTypes.AZURE_CONTENT_SAFETY + ).lower(): AzureContentSafetyConnection, + _snake_to_camel( + ConnectionTypes.AZURE_SPEECH_SERVICES + ).lower(): AzureSpeechServicesConnection, ConnectionCategory.COGNITIVE_SEARCH.lower(): AzureAISearchConnection, - _snake_to_camel(ConnectionTypes.AZURE_SEARCH).lower(): AzureAISearchConnection, - _snake_to_camel(ConnectionTypes.AZURE_AI_SERVICES).lower(): AzureAIServicesConnection, + _snake_to_camel( + ConnectionTypes.AZURE_SEARCH + ).lower(): AzureAISearchConnection, + _snake_to_camel( + ConnectionTypes.AZURE_AI_SERVICES + ).lower(): AzureAIServicesConnection, ConnectionTypes.AI_SERVICES_REST_PLACEHOLDER.lower(): AzureAIServicesConnection, } return CONNECTION_CATEGORY_TO_SUBCLASS_MAP.get(conn_type, WorkspaceConnection) From 7cef3eedf38dd8c9d7fac83ceee0bead718ef18a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 10:11:21 +0530 Subject: [PATCH 037/146] Repoint workspace connections operation to arm_ml_service client Give the workspace connections operation a dedicated arm_ml_service client at the 2024-04-01-preview wire api-version (ServiceClient042024PreviewArm), so it both sends the arm bodies its entity already builds and deserializes responses into the arm models. All five operation methods (get/create/delete/list/list_secrets) have matching arm signatures. The compute (update_sso_settings) and Azure OpenAI deployment (.connection group) operations keep the v2024_04 msrest client since arm has no equivalent for those yet, so the folder is not retired. Validated offline: connection+workspace 97 passed, smoke 146/146. Wire behavior is covered by the e2e recording suite. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 20 ++++++++++++++++++- .../_workspace_connections_operations.py | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 357593d56040..48778315f74e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -107,6 +107,11 @@ ServiceClient062023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-06-01-preview") ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") ServiceClient102024PreviewTsp = partial(MachineLearningServicesMgmtClient, api_version="2024-10-01-preview") +# arm_ml_service-backed client pinned to the 2024-04-01-preview wire api-version, used only by the workspace +# connections operation (whose entity already builds arm_ml_service bodies and whose operation methods all match +# the arm client). The separate v2024_04_01_preview msrest client is still required by the compute +# (update_sso_settings) and Azure OpenAI deployment (.connection group) operations, which have no arm equivalent. +ServiceClient042024PreviewArm = partial(MachineLearningServicesMgmtClient, api_version="2024-04-01-preview") module_logger = logging.getLogger(__name__) @@ -493,6 +498,19 @@ def __init__( **kwargs, ) + # arm_ml_service-backed client at the 2024-04-01-preview wire api-version, used only by the workspace + # connections operation so it deserializes responses into the shared arm_ml_service models it now builds. + self._service_client_04_2024_preview_arm = ServiceClient042024PreviewArm( + credential=self._credential, + subscription_id=( + self._ws_operation_scope._subscription_id + if registry_reference + else self._operation_scope._subscription_id + ), + base_url=base_url, + **kwargs, + ) + self._workspaces = WorkspaceOperations( self._ws_operation_scope if registry_reference else self._operation_scope, self._service_client_10_2024_preview_tsp, @@ -523,7 +541,7 @@ def __init__( self._connections = WorkspaceConnectionsOperations( self._operation_scope, self._operation_config, - self._service_client_04_2024_preview, + self._service_client_04_2024_preview_arm, self._operation_container, self._credential, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_connections_operations.py index 6debb243b883..3d8944f4b169 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_connections_operations.py @@ -6,7 +6,7 @@ from typing import Any, Dict, Iterable, Optional, cast -from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient082023Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, From 7902c230ddc85cf3d03c805c8a9ff72d9d7ff4e7 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 10:29:19 +0530 Subject: [PATCH 038/146] Normalize formatting to repo black config (line-length 120) Earlier commits in this branch were formatted with black's default 88-char width, which wrapped many lines the repo's black config (eng/black-pyproject.toml, line-length=120) leaves on one line. Reformat all touched files with the repo config so they pass the CI black check and the PR diff stays minimal. --- .../azure/ai/ml/entities/_builders/spark.py | 85 +--- .../ai/ml/entities/_component/component.py | 77 +--- .../azure/ai/ml/entities/_credentials.py | 110 ++--- .../entities/_deployment/batch_deployment.py | 62 +-- .../pipeline_component_batch_deployment.py | 20 +- .../_job/distillation/distillation_job.py | 94 +--- .../azure/ai/ml/entities/_job/distribution.py | 14 +- .../azure/ai/ml/entities/_job/job.py | 28 +- .../azure/ai/ml/entities/_job/job_service.py | 25 +- .../ai/ml/entities/_job/pipeline/_io/mixin.py | 93 +--- .../_job/pipeline/_pipeline_job_helpers.py | 28 +- .../entities/_job/resource_configuration.py | 12 +- .../connections/connection_subtypes.py | 16 +- .../connections/workspace_connection.py | 90 +--- .../test_command_component_entity.py | 159 ++----- .../test_data_transfer_component_entity.py | 40 +- .../unittests/test_flow_component.py | 56 +-- .../test_parallel_component_entity.py | 37 +- .../unittests/test_spark_component_entity.py | 19 +- .../unittests/test_distillation_conversion.py | 120 ++--- .../unittests/test_distillation_job_schema.py | 32 +- .../dsl/unittests/test_command_builder.py | 115 ++--- .../unittests/test_pipeline_job_entity.py | 391 +++++----------- .../unittests/test_pipeline_job_schema.py | 418 +++++------------- 24 files changed, 540 insertions(+), 1601 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py index 11bb9fc1e0f1..ca8493c94d02 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py @@ -189,9 +189,7 @@ def __init__( **kwargs: Any, ) -> None: # validate init params are valid type - validate_attribute_type( - attrs_to_check=locals(), attr_type_map=self._attr_type_map() - ) + validate_attribute_type(attrs_to_check=locals(), attr_type_map=self._attr_type_map()) kwargs.pop("type", None) BaseNode.__init__( @@ -227,24 +225,15 @@ def __init__( self.driver_memory = self.driver_memory or _component.driver_memory self.executor_cores = self.executor_cores or _component.executor_cores self.executor_memory = self.executor_memory or _component.executor_memory - self.executor_instances = ( - self.executor_instances or _component.executor_instances - ) - self.dynamic_allocation_enabled = ( - self.dynamic_allocation_enabled or _component.dynamic_allocation_enabled - ) + self.executor_instances = self.executor_instances or _component.executor_instances + self.dynamic_allocation_enabled = self.dynamic_allocation_enabled or _component.dynamic_allocation_enabled self.dynamic_allocation_min_executors = ( - self.dynamic_allocation_min_executors - or _component.dynamic_allocation_min_executors + self.dynamic_allocation_min_executors or _component.dynamic_allocation_min_executors ) self.dynamic_allocation_max_executors = ( - self.dynamic_allocation_max_executors - or _component.dynamic_allocation_max_executors + self.dynamic_allocation_max_executors or _component.dynamic_allocation_max_executors ) - if ( - self.executor_instances is None - and str(self.dynamic_allocation_enabled).lower() == "true" - ): + if self.executor_instances is None and str(self.dynamic_allocation_enabled).lower() == "true": self.executor_instances = self.dynamic_allocation_min_executors # When create standalone job or pipeline job, following fields will always get value from component or get # default None, because we will not pass those fields to Spark. But in following cases, we expect to get @@ -291,9 +280,7 @@ def resources(self) -> Optional[Union[Dict, SparkResourceConfiguration]]: return self._resources # type: ignore @resources.setter - def resources( - self, value: Optional[Union[Dict, SparkResourceConfiguration]] - ) -> None: + def resources(self, value: Optional[Union[Dict, SparkResourceConfiguration]]) -> None: """Sets the compute resource configuration for the job. :param value: The compute resource configuration for the job. @@ -392,14 +379,10 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: obj = super()._from_rest_object_to_init_params(obj) if "resources" in obj and obj["resources"]: - obj["resources"] = SparkResourceConfiguration._from_rest_object( - obj["resources"] - ) + obj["resources"] = SparkResourceConfiguration._from_rest_object(obj["resources"]) if "identity" in obj and obj["identity"]: - obj["identity"] = _BaseJobIdentityConfiguration._from_rest_object( - obj["identity"] - ) + obj["identity"] = _BaseJobIdentityConfiguration._from_rest_object(obj["identity"]) if "entry" in obj and obj["entry"]: obj["entry"] = SparkJobEntry._from_rest_object(obj["entry"]) @@ -413,17 +396,11 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: return obj @classmethod - def _load_from_dict( - cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any - ) -> "Spark": + def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Spark": from .spark_func import spark - loaded_data = load_from_dict( - SparkJobSchema, data, context, additional_message, **kwargs - ) - spark_job: Spark = spark( - base_path=context[BASE_PATH_CONTEXT_KEY], **loaded_data - ) + loaded_data = load_from_dict(SparkJobSchema, data, context, additional_message, **kwargs) + spark_job: Spark = spark(base_path=context[BASE_PATH_CONTEXT_KEY], **loaded_data) return spark_job @@ -462,21 +439,11 @@ def _load_from_rest_job(cls, obj: JobBaseData) -> "Spark": driver_memory=rest_spark_conf.get(SparkConfKey.DRIVER_MEMORY, None), executor_cores=rest_spark_conf.get(SparkConfKey.EXECUTOR_CORES, None), executor_memory=rest_spark_conf.get(SparkConfKey.EXECUTOR_MEMORY, None), - executor_instances=rest_spark_conf.get( - SparkConfKey.EXECUTOR_INSTANCES, None - ), - dynamic_allocation_enabled=rest_spark_conf.get( - SparkConfKey.DYNAMIC_ALLOCATION_ENABLED, None - ), - dynamic_allocation_min_executors=rest_spark_conf.get( - SparkConfKey.DYNAMIC_ALLOCATION_MIN_EXECUTORS, None - ), - dynamic_allocation_max_executors=rest_spark_conf.get( - SparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None - ), - resources=SparkResourceConfiguration._from_rest_object( - rest_spark_job.resources - ), + executor_instances=rest_spark_conf.get(SparkConfKey.EXECUTOR_INSTANCES, None), + dynamic_allocation_enabled=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_ENABLED, None), + dynamic_allocation_min_executors=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_MIN_EXECUTORS, None), + dynamic_allocation_max_executors=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None), + resources=SparkResourceConfiguration._from_rest_object(rest_spark_job.resources), inputs=from_rest_inputs_to_dataset_literal(rest_spark_job.inputs), outputs=from_rest_data_outputs(rest_spark_job.outputs), ) @@ -563,9 +530,7 @@ def _to_job(self) -> SparkJob: ) @classmethod - def _create_schema_for_validation( - cls, context: Any - ) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation(cls, context: Any) -> Union[PathAwareSchema, Schema]: from azure.ai.ml._schema.pipeline import SparkSchema return SparkSchema(context=context) @@ -632,11 +597,7 @@ def _validate_entry_exist(self) -> MutableValidationResult: ) validation_result = self._create_empty_validation_result() # validate whether component entry exists to ensure code path is correct, especially when code is default value - if ( - self.code is None - or is_remote_code - or not isinstance(self.entry, SparkJobEntry) - ): + if self.code is None or is_remote_code or not isinstance(self.entry, SparkJobEntry): # skip validate when code is not a local path or code is None, or self.entry is not SparkJobEntry object pass else: @@ -681,13 +642,9 @@ def _validate_fields(self) -> MutableValidationResult: if m: io_type, io_name = m.groups() if io_type == "Input": - validation_result.append_error( - message=msg, yaml_path=f"inputs.{io_name}" - ) + validation_result.append_error(message=msg, yaml_path=f"inputs.{io_name}") else: - validation_result.append_error( - message=msg, yaml_path=f"outputs.{io_name}" - ) + validation_result.append_error(message=msg, yaml_path=f"outputs.{io_name}") try: _validate_spark_configurations(self) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py index 6e7831fb5cc8..33d5bf853f50 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py @@ -130,9 +130,7 @@ def __init__( self._auto_increment_version = kwargs.pop("auto_increment", False) # Get source from id first, then kwargs. self._source = ( - self._resolve_component_source_from_id(id) - if id - else kwargs.pop("_source", ComponentSource.CLASS) + self._resolve_component_source_from_id(id) if id else kwargs.pop("_source", ComponentSource.CLASS) ) # use ANONYMOUS_COMPONENT_NAME instead of guid is_anonymous = kwargs.pop("is_anonymous", False) @@ -280,9 +278,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file( - dest, yaml_serialized, default_flow_style=False, path=path, **kwargs - ) + dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) @staticmethod def _resolve_component_source_from_id( # pylint: disable=docstring-type-do-not-use-class @@ -311,9 +307,7 @@ def _resolve_component_source_from_id( # pylint: disable=docstring-type-do-not- ) @classmethod - def _validate_io_names( - cls, io_names: Iterable[str], raise_error: bool = False - ) -> MutableValidationResult: + def _validate_io_names(cls, io_names: Iterable[str], raise_error: bool = False) -> MutableValidationResult: """Validate input/output names, raise exception if invalid. :param io_names: The names to validate @@ -329,9 +323,7 @@ def _validate_io_names( for name in io_names: if re.match(IOConstants.VALID_KEY_PATTERN, name) is None: msg = "{!r} is not a valid parameter name, must be composed letters, numbers, and underscores." - validation_result.append_error( - message=msg.format(name), yaml_path=f"inputs.{name}" - ) + validation_result.append_error(message=msg.format(name), yaml_path=f"inputs.{name}") # validate name conflict lower_key = name.lower() if lower_key in lower2original_kwargs: @@ -351,9 +343,7 @@ def _build_io(cls, io_dict: Union[Dict, Input, Output], is_input: bool) -> Dict: if is_input: component_io[name] = port if isinstance(port, Input) else Input(**port) else: - component_io[name] = ( - port if isinstance(port, Output) else Output(**port) - ) + component_io[name] = port if isinstance(port, Output) else Output(**port) if is_input: # Restore flattened parameters to group @@ -366,9 +356,7 @@ def _create_schema_for_validation(cls, context: Any) -> PathAwareSchema: return ComponentSchema(context=context) @classmethod - def _create_validation_error( - cls, message: str, no_personal_data_message: str - ) -> ValidationException: + def _create_validation_error(cls, message: str, no_personal_data_message: str) -> ValidationException: return ValidationException( message=message, no_personal_data_message=no_personal_data_message, @@ -444,19 +432,13 @@ def _load( return new_instance @classmethod - def _from_container_rest_object( - cls, component_container_rest_object: ComponentContainer - ) -> "Component": - component_container_details: ComponentContainerProperties = ( - component_container_rest_object.properties - ) + def _from_container_rest_object(cls, component_container_rest_object: ComponentContainer) -> "Component": + component_container_details: ComponentContainerProperties = component_container_rest_object.properties component = Component( id=component_container_rest_object.id, name=component_container_rest_object.name, description=component_container_details.description, - creation_context=SystemData._from_rest_object( - component_container_rest_object.system_data - ), + creation_context=SystemData._from_rest_object(component_container_rest_object.system_data), tags=component_container_details.tags, properties=component_container_details.properties, type=NodeType._CONTAINER, @@ -471,10 +453,7 @@ def _from_rest_object(cls, obj: ComponentVersion) -> "Component": # TODO: Remove in PuP with native import job/component type support in MFE/Designer # Convert command component back to import component private preview component_spec = obj.properties.component_spec - if ( - component_spec[CommonYamlFields.TYPE] == NodeType.COMMAND - and component_spec["command"] == NodeType.IMPORT - ): + if component_spec[CommonYamlFields.TYPE] == NodeType.COMMAND and component_spec["command"] == NodeType.IMPORT: component_spec[CommonYamlFields.TYPE] = NodeType.IMPORT component_spec["source"] = component_spec.pop("inputs") component_spec["output"] = component_spec.pop("outputs")["output"] @@ -483,9 +462,7 @@ def _from_rest_object(cls, obj: ComponentVersion) -> "Component": # maybe override serialization method for name field? from azure.ai.ml.entities._component.component_factory import component_factory - create_instance_func, _ = component_factory.get_create_funcs( - obj.properties.component_spec, for_load=True - ) + create_instance_func, _ = component_factory.get_create_funcs(obj.properties.component_spec, for_load=True) instance: Component = create_instance_func() # TODO: Bug Item number: 2883415 @@ -509,9 +486,7 @@ def _from_rest_object_to_init_params(cls, obj: ComponentVersion) -> Dict: outputs = rest_component_version.component_spec.pop("outputs", {}) origin_name = rest_component_version.component_spec[CommonYamlFields.NAME] - rest_component_version.component_spec[CommonYamlFields.NAME] = ( - ANONYMOUS_COMPONENT_NAME - ) + rest_component_version.component_spec[CommonYamlFields.NAME] = ANONYMOUS_COMPONENT_NAME init_kwargs = cls._load_with_schema( rest_component_version.component_spec, context={BASE_PATH_CONTEXT_KEY: Path.cwd()}, @@ -530,11 +505,7 @@ def _from_rest_object_to_init_params(cls, obj: ComponentVersion) -> Dict: # remove empty values, because some property only works for specific component, eg: distribution for command # note that there is an issue that environment == {} will always be true, so use isinstance here - return { - k: v - for k, v in init_kwargs.items() - if v is not None and not (isinstance(v, dict) and not v) - } + return {k: v for k, v in init_kwargs.items() if v is not None and not (isinstance(v, dict) and not v)} def _get_anonymous_hash(self) -> str: """Return the hash of anonymous component. @@ -586,12 +557,8 @@ def _customized_validate(self) -> MutableValidationResult: validation_result = super(Component, self)._customized_validate() # validate inputs names - validation_result.merge_with( - self._validate_io_names(self.inputs, raise_error=False) - ) - validation_result.merge_with( - self._validate_io_names(self.outputs, raise_error=False) - ) + validation_result.merge_with(self._validate_io_names(self.inputs, raise_error=False)) + validation_result.merge_with(self._validate_io_names(self.outputs, raise_error=False)) return validation_result @@ -623,9 +590,7 @@ def _to_rest_object(self) -> ComponentVersion: if self._intellectual_property: # hack while full pass through supported is worked on for IPP fields component.pop("intellectual_property") - component["intellectualProperty"] = ( - self._intellectual_property._to_rest_object() - ) + component["intellectualProperty"] = self._intellectual_property._to_rest_object() properties = ComponentVersionProperties( component_spec=component, description=self.description, @@ -642,9 +607,7 @@ def _to_rest_object(self) -> ComponentVersion: result.name = ANONYMOUS_COMPONENT_NAME else: result.name = self.name - result.properties.properties["client_component_hash"] = ( - self._get_component_hash(keys_to_omit=["version"]) - ) + result.properties.properties["client_component_hash"] = self._get_component_hash(keys_to_omit=["version"]) return result def _to_dict(self) -> Dict: @@ -663,11 +626,7 @@ def _localize(self, base_path: str) -> None: :type base_path: str """ if not getattr(self, "id", None): - raise ValueError( - "Only remote asset can be localize but got a {} without id.".format( - type(self) - ) - ) + raise ValueError("Only remote asset can be localize but got a {} without id.".format(type(self))) self._id = None self._creation_context = None self._base_path = base_path 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 244deb7ddb0b..2024dc36e6b8 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 @@ -165,9 +165,7 @@ def _to_datastore_rest_object(self) -> RestAccountKeyDatastoreCredentials: return RestAccountKeyDatastoreCredentials(secrets=secrets) @classmethod - def _from_datastore_rest_object( - cls, obj: RestAccountKeyDatastoreCredentials - ) -> "AccountKeyConfiguration": + def _from_datastore_rest_object(cls, obj: RestAccountKeyDatastoreCredentials) -> "AccountKeyConfiguration": return cls(account_key=obj.secrets.key if obj.secrets else None) @classmethod @@ -211,9 +209,7 @@ def _to_datastore_rest_object(self) -> RestSasDatastoreCredentials: return RestSasDatastoreCredentials(secrets=secrets) @classmethod - def _from_datastore_rest_object( - cls, obj: RestSasDatastoreCredentials - ) -> "SasTokenConfiguration": + def _from_datastore_rest_object(cls, obj: RestSasDatastoreCredentials) -> "SasTokenConfiguration": return cls(sas_token=obj.secrets.sas_token if obj.secrets else None) def _to_workspace_connection_rest_object( @@ -305,9 +301,7 @@ def __init__( def _to_workspace_connection_rest_object( self, ) -> RestWorkspaceConnectionUsernamePassword: - return RestWorkspaceConnectionUsernamePassword( - username=self.username, password=self.password - ) + return RestWorkspaceConnectionUsernamePassword(username=self.username, password=self.password) @classmethod def _from_workspace_connection_rest_object( @@ -411,9 +405,7 @@ def _from_workspace_connection_rest_object( ) -> "ServicePrincipalConfiguration": return cls( client_id=obj.client_id if obj is not None and obj.client_id else None, - client_secret=( - obj.client_secret if obj is not None and obj.client_secret else None - ), + client_secret=(obj.client_secret if obj is not None and obj.client_secret else None), tenant_id=obj.tenant_id if obj is not None and obj.tenant_id else None, authority_url="", ) @@ -461,9 +453,7 @@ def _to_datastore_rest_object(self) -> RestCertificateDatastoreCredentials: ) @classmethod - def _from_datastore_rest_object( - cls, obj: RestCertificateDatastoreCredentials - ) -> "CertificateConfiguration": + def _from_datastore_rest_object(cls, obj: RestCertificateDatastoreCredentials) -> "CertificateConfiguration": return cls( authority_url=obj.authority_url, resource_url=obj.resource_url, @@ -489,16 +479,12 @@ def __ne__(self, other: object) -> bool: return not self.__eq__(other) -class _BaseJobIdentityConfiguration( - ABC, RestTranslatableMixin, DictMixin, YamlTranslatableMixin -): +class _BaseJobIdentityConfiguration(ABC, RestTranslatableMixin, DictMixin, YamlTranslatableMixin): def __init__(self) -> None: self.type = None @classmethod - def _from_rest_object( - cls, obj: RestJobIdentityConfiguration - ) -> "RestIdentityConfiguration": + def _from_rest_object(cls, obj: RestJobIdentityConfiguration) -> "RestIdentityConfiguration": if obj is None: return None mapping = { @@ -597,9 +583,7 @@ def __init__( def _to_workspace_connection_rest_object( self, ) -> RestWorkspaceConnectionManagedIdentity: - return RestWorkspaceConnectionManagedIdentity( - client_id=self.client_id, resource_id=self.resource_id - ) + return RestWorkspaceConnectionManagedIdentity(client_id=self.client_id, resource_id=self.resource_id) @classmethod def _from_workspace_connection_rest_object( @@ -618,9 +602,7 @@ def _to_job_rest_object(self) -> RestJobManagedIdentity: ) @classmethod - def _from_job_rest_object( - cls, obj: RestJobManagedIdentity - ) -> "ManagedIdentityConfiguration": + def _from_job_rest_object(cls, obj: RestJobManagedIdentity) -> "ManagedIdentityConfiguration": return cls( client_id=obj.client_id, object_id=obj.client_id, @@ -649,9 +631,7 @@ def _to_workspace_rest_object(self) -> RestUserAssignedIdentityConfiguration: ) @classmethod - def _from_workspace_rest_object( - cls, obj: RestUserAssignedIdentityConfiguration - ) -> "ManagedIdentityConfiguration": + def _from_workspace_rest_object(cls, obj: RestUserAssignedIdentityConfiguration) -> "ManagedIdentityConfiguration": return cls( principal_id=obj.principal_id, client_id=obj.client_id, @@ -675,9 +655,7 @@ def _load_from_dict(cls, data: Dict) -> "ManagedIdentityConfiguration": def __eq__(self, other: object) -> bool: if not isinstance(other, ManagedIdentityConfiguration): return NotImplemented - return ( - self.client_id == other.client_id and self.resource_id == other.resource_id - ) + return self.client_id == other.client_id and self.resource_id == other.resource_id @classmethod def _get_rest_properties_class(cls) -> Type: @@ -796,10 +774,7 @@ def __init__( def _to_compute_rest_object(self) -> RestIdentityConfiguration: rest_user_assigned_identities = ( - { - uai.resource_id: uai._to_identity_configuration_rest_object() - for uai in self.user_assigned_identities - } + {uai.resource_id: uai._to_identity_configuration_rest_object() for uai in self.user_assigned_identities} if self.user_assigned_identities else None ) @@ -809,14 +784,10 @@ def _to_compute_rest_object(self) -> RestIdentityConfiguration: ) @classmethod - def _from_compute_rest_object( - cls, obj: RestIdentityConfiguration - ) -> "IdentityConfiguration": + def _from_compute_rest_object(cls, obj: RestIdentityConfiguration) -> "IdentityConfiguration": from_rest_user_assigned_identities = ( [ - ManagedIdentityConfiguration._from_identity_configuration_rest_object( - uai, resource_id=resource_id - ) + ManagedIdentityConfiguration._from_identity_configuration_rest_object(uai, resource_id=resource_id) for (resource_id, uai) in obj.user_assigned_identities.items() ] if obj.user_assigned_identities @@ -834,10 +805,7 @@ def _to_online_endpoint_rest_object( self, ) -> RestManagedServiceIdentityConfiguration: rest_user_assigned_identities = ( - { - uai.resource_id: uai._to_online_endpoint_rest_object() - for uai in self.user_assigned_identities - } + {uai.resource_id: uai._to_online_endpoint_rest_object() for uai in self.user_assigned_identities} if self.user_assigned_identities else None ) @@ -850,14 +818,10 @@ def _to_online_endpoint_rest_object( ) @classmethod - def _from_online_endpoint_rest_object( - cls, obj: RestManagedServiceIdentityConfiguration - ) -> "IdentityConfiguration": + def _from_online_endpoint_rest_object(cls, obj: RestManagedServiceIdentityConfiguration) -> "IdentityConfiguration": from_rest_user_assigned_identities = ( [ - ManagedIdentityConfiguration._from_identity_configuration_rest_object( - uai, resource_id=resource_id - ) + ManagedIdentityConfiguration._from_identity_configuration_rest_object(uai, resource_id=resource_id) for (resource_id, uai) in obj.user_assigned_identities.items() ] if obj.user_assigned_identities @@ -872,14 +836,10 @@ def _from_online_endpoint_rest_object( return result @classmethod - def _from_workspace_rest_object( - cls, obj: RestManagedServiceIdentityConfiguration - ) -> "IdentityConfiguration": + def _from_workspace_rest_object(cls, obj: RestManagedServiceIdentityConfiguration) -> "IdentityConfiguration": from_rest_user_assigned_identities = ( [ - ManagedIdentityConfiguration._from_identity_configuration_rest_object( - uai, resource_id=resource_id - ) + ManagedIdentityConfiguration._from_identity_configuration_rest_object(uai, resource_id=resource_id) for (resource_id, uai) in obj.user_assigned_identities.items() ] if obj.user_assigned_identities @@ -895,10 +855,7 @@ def _from_workspace_rest_object( def _to_workspace_rest_object(self) -> RestManagedServiceIdentityConfiguration: rest_user_assigned_identities = ( - { - uai.resource_id: uai._to_workspace_rest_object() - for uai in self.user_assigned_identities - } + {uai.resource_id: uai._to_workspace_rest_object() for uai in self.user_assigned_identities} if self.user_assigned_identities else None ) @@ -915,9 +872,7 @@ def _to_rest_object(self) -> RestRegistryManagedIdentity: ) @classmethod - def _from_rest_object( - cls, obj: RestRegistryManagedIdentity - ) -> "IdentityConfiguration": + def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfiguration": result = cls( type=obj.type, user_assigned_identities=None, @@ -940,9 +895,7 @@ def _to_datastore_rest_object(self) -> RestNoneDatastoreCredentials: @classmethod # pylint: disable=unused-argument - def _from_datastore_rest_object( - cls, obj: RestNoneDatastoreCredentials - ) -> "NoneCredentialConfiguration": + def _from_datastore_rest_object(cls, obj: RestNoneDatastoreCredentials) -> "NoneCredentialConfiguration": return cls() def _to_workspace_connection_rest_object(self) -> None: @@ -972,9 +925,7 @@ def _to_datastore_rest_object(self) -> RestNoneDatastoreCredentials: @classmethod # pylint: disable=unused-argument - def _from_datastore_rest_object( - cls, obj: RestNoneDatastoreCredentials - ) -> "AadCredentialConfiguration": + def _from_datastore_rest_object(cls, obj: RestNoneDatastoreCredentials) -> "AadCredentialConfiguration": return cls() # Has no credential object, just a property bag class. @@ -1024,23 +975,14 @@ def _from_workspace_connection_rest_object( cls, obj: Optional[RestWorkspaceConnectionAccessKey] ) -> "AccessKeyConfiguration": return cls( - access_key_id=( - obj.access_key_id if obj is not None and obj.access_key_id else None - ), - secret_access_key=( - obj.secret_access_key - if obj is not None and obj.secret_access_key - else None - ), + access_key_id=(obj.access_key_id if obj is not None and obj.access_key_id else None), + secret_access_key=(obj.secret_access_key if obj is not None and obj.secret_access_key else None), ) def __eq__(self, other: object) -> bool: if not isinstance(other, AccessKeyConfiguration): return NotImplemented - return ( - self.access_key_id == other.access_key_id - and self.secret_access_key == other.secret_access_key - ) + return self.access_key_id == other.access_key_id and self.secret_access_key == other.secret_access_key def _get_rest_properties_class(self): return AccessKeyAuthTypeWorkspaceConnectionProperties diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py index b4b0c6a25450..dfdbe2b17133 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py @@ -135,15 +135,11 @@ def __init__( mini_batch_size: Optional[int] = None, max_concurrency_per_instance: Optional[int] = None, environment_variables: Optional[Dict[str, str]] = None, - code_path: Optional[ - Union[str, PathLike] - ] = None, # promoted property from code_configuration.code + code_path: Optional[Union[str, PathLike]] = None, # promoted property from code_configuration.code scoring_script: Optional[ Union[str, PathLike] ] = None, # promoted property from code_configuration.scoring_script - instance_count: Optional[ - int - ] = None, # promoted property from resources.instance_count + instance_count: Optional[int] = None, # promoted property from resources.instance_count **kwargs: Any, ) -> None: _type = kwargs.pop("_type", None) @@ -199,9 +195,7 @@ def __init__( def _setup_instance_count( self, - ) -> ( - None - ): # No need to check instance_count here as it's already set in self._settings during initialization + ) -> None: # No need to check instance_count here as it's already set in self._settings during initialization if self.resources and self._settings.instance_count: msg = "Can't set instance_count when resources is provided." raise ValidationException( @@ -213,9 +207,7 @@ def _setup_instance_count( ) if not self.resources and self._settings.instance_count: - self.resources = ResourceConfiguration( - instance_count=self._settings.instance_count - ) + self.resources = ResourceConfiguration(instance_count=self._settings.instance_count) def __getattr__(self, name: str) -> Optional[Any]: # Support backwards compatibility with old BatchDeployment properties. @@ -256,9 +248,7 @@ def provisioning_state(self) -> Optional[str]: return self._provisioning_state def _to_dict(self) -> Dict: - res: dict = BatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump( - self - ) + res: dict = BatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return res @classmethod @@ -304,16 +294,12 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # type: ignore model=model, output_file_name=self.output_file_name, output_action=( - BatchDeployment._yaml_output_action_to_rest_output_action( - self.output_action - ) + BatchDeployment._yaml_output_action_to_rest_output_action(self.output_action) if isinstance(self.output_action, str) else None ), error_threshold=self.error_threshold, - retry_settings=( - self.retry_settings._to_rest_object() if self.retry_settings else None - ), + retry_settings=(self.retry_settings._to_rest_object() if self.retry_settings else None), logging_level=self.logging_level, mini_batch_size=self.mini_batch_size, max_concurrency_per_instance=self.max_concurrency_per_instance, @@ -321,19 +307,13 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # type: ignore properties=self.properties, ) - return BatchDeploymentData( - location=location, properties=batch_deployment, tags=self.tags - ) + return BatchDeploymentData(location=location, properties=batch_deployment, tags=self.tags) @classmethod def _from_rest_object( # pylint: disable=arguments-renamed cls, deployment: BatchDeploymentData ) -> BatchDeploymentData: - modelId = ( - deployment.properties.model.asset_id - if deployment.properties.model - else None - ) + modelId = deployment.properties.model.asset_id if deployment.properties.model else None if ( hasattr(deployment.properties, "deployment_configuration") @@ -356,9 +336,7 @@ def _from_rest_object( # pylint: disable=arguments-renamed properties = deployment.properties.properties code_configuration = ( - CodeConfiguration._from_rest_code_configuration( - deployment.properties.code_configuration - ) + CodeConfiguration._from_rest_code_configuration(deployment.properties.code_configuration) if deployment.properties.code_configuration else None ) @@ -372,25 +350,17 @@ def _from_rest_object( # pylint: disable=arguments-renamed code_configuration=code_configuration, output_file_name=( deployment.properties.output_file_name - if cls._rest_output_action_to_yaml_output_action( - deployment.properties.output_action - ) + if cls._rest_output_action_to_yaml_output_action(deployment.properties.output_action) == BatchDeploymentOutputAction.APPEND_ROW else None ), - output_action=cls._rest_output_action_to_yaml_output_action( - deployment.properties.output_action - ), + output_action=cls._rest_output_action_to_yaml_output_action(deployment.properties.output_action), error_threshold=deployment.properties.error_threshold, - retry_settings=BatchRetrySettings._from_rest_object( - deployment.properties.retry_settings - ), + retry_settings=BatchRetrySettings._from_rest_object(deployment.properties.retry_settings), logging_level=deployment.properties.logging_level, mini_batch_size=deployment.properties.mini_batch_size, compute=deployment.properties.compute, - resources=ResourceConfiguration._from_rest_object( - deployment.properties.resources - ), + resources=ResourceConfiguration._from_rest_object(deployment.properties.resources), environment_variables=deployment.properties.environment_variables, max_concurrency_per_instance=deployment.properties.max_concurrency_per_instance, endpoint_name=_parse_endpoint_name_from_deployment_id(deployment.id), @@ -418,9 +388,7 @@ def _load( BASE_PATH_CONTEXT_KEY: Path(yaml_path).parent if yaml_path else Path.cwd(), PARAMS_OVERRIDE_KEY: params_override, } - res: BatchDeployment = load_from_dict( - BatchDeploymentSchema, data, context, **kwargs - ) + res: BatchDeployment = load_from_dict(BatchDeploymentSchema, data, context, **kwargs) return res def _validate(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py index bb555cea4743..6c88137c6de8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py @@ -128,18 +128,12 @@ def _load( return res @classmethod - def _from_rest_object( - cls, deployment: RestBatchDeployment - ) -> "PipelineComponentBatchDeployment": + def _from_rest_object(cls, deployment: RestBatchDeployment) -> "PipelineComponentBatchDeployment": return PipelineComponentBatchDeployment( name=deployment.name, tags=deployment.tags, - component=deployment.properties.additional_properties[ - "deploymentConfiguration" - ]["componentId"]["assetId"], - settings=deployment.properties.additional_properties[ - "deploymentConfiguration" - ]["settings"], + component=deployment.properties.additional_properties["deploymentConfiguration"]["componentId"]["assetId"], + settings=deployment.properties.additional_properties["deploymentConfiguration"]["settings"], endpoint_name=_parse_endpoint_name_from_deployment_id(deployment.id), ) @@ -156,13 +150,9 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file( - dest, yaml_serialized, default_flow_style=False, path=path, **kwargs - ) + dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) def _to_dict(self) -> Dict: - res: dict = PipelineComponentBatchDeploymentSchema( - context={BASE_PATH_CONTEXT_KEY: "./"} - ).dump(self) + res: dict = PipelineComponentBatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py index 0e540b6c9b37..1dcfb012ffd4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py @@ -74,19 +74,13 @@ def __init__( self._hyperparameters = hyperparameters self._resources = resources - if ( - self._training_data is None - and self._data_generation_type == DataGenerationType.LABEL_GENERATION - ): + if self._training_data is None and self._data_generation_type == DataGenerationType.LABEL_GENERATION: raise ValueError( f"Training data can not be None when data generation type is set to " f"{DataGenerationType.LABEL_GENERATION}." ) - if ( - self._validation_data is None - and self._data_generation_type == DataGenerationType.LABEL_GENERATION - ): + if self._validation_data is None and self._data_generation_type == DataGenerationType.LABEL_GENERATION: raise ValueError( f"Validation data can not be None when data generation type is set to " f"{DataGenerationType.LABEL_GENERATION}." @@ -143,9 +137,7 @@ def teacher_model_endpoint_connection(self) -> WorkspaceConnection: return self._teacher_model_endpoint_connection @teacher_model_endpoint_connection.setter - def teacher_model_endpoint_connection( - self, connection: WorkspaceConnection - ) -> None: + def teacher_model_endpoint_connection(self, connection: WorkspaceConnection) -> None: """Set the endpoint information of the teacher model. :param connection: Workspace connection @@ -275,9 +267,7 @@ def set_prompt_settings(self, prompt_settings: Optional[PromptSettings]): :param prompt_settings: Settings related to the system prompt used for generating data. :type prompt_settings: typing.Optional[PromptSettings] """ - self._prompt_settings = ( - prompt_settings if prompt_settings is not None else self._prompt_settings - ) + self._prompt_settings = prompt_settings if prompt_settings is not None else self._prompt_settings def set_finetuning_settings(self, hyperparameters: Optional[Dict]): """Set the hyperparamters for finetuning. @@ -285,9 +275,7 @@ def set_finetuning_settings(self, hyperparameters: Optional[Dict]): :param hyperparameters: The hyperparameters for finetuning. :type hyperparameters: typing.Optional[typing.Dict] """ - self._hyperparameters = ( - hyperparameters if hyperparameters is not None else self._hyperparameters - ) + self._hyperparameters = hyperparameters if hyperparameters is not None else self._hyperparameters def _to_dict(self) -> Dict: """Convert the object to a dictionary. @@ -300,9 +288,7 @@ def _to_dict(self) -> Dict: ) schema_dict: dict = {} - schema_dict = DistillationJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump( - self - ) + schema_dict = DistillationJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return schema_dict @@ -329,9 +315,7 @@ def _load_from_dict( DistillationJobSchema, ) - loaded_data = load_from_dict( - DistillationJobSchema, data, context, additional_message, **kwargs - ) + loaded_data = load_from_dict(DistillationJobSchema, data, context, additional_message, **kwargs) training_data = loaded_data.get("training_data", None) if isinstance(training_data, str): @@ -339,15 +323,11 @@ def _load_from_dict( validation_data = loaded_data.get("validation_data", None) if isinstance(validation_data, str): - loaded_data["validation_data"] = Input( - type="uri_file", path=validation_data - ) + loaded_data["validation_data"] = Input(type="uri_file", path=validation_data) student_model = loaded_data.get("student_model", None) if isinstance(student_model, str): - loaded_data["student_model"] = Input( - type=AssetTypes.URI_FILE, path=student_model - ) + loaded_data["student_model"] = Input(type=AssetTypes.URI_FILE, path=student_model) job_instance = DistillationJob(**loaded_data) return job_instance @@ -362,13 +342,9 @@ def _from_rest_object(cls, obj: RestJobBase) -> "DistillationJob": :rtype: DistillationJob """ properties: RestFineTuningJob = obj.properties - finetuning_details: RestCustomModelFineTuningVertical = ( - properties.fine_tuning_details - ) + finetuning_details: RestCustomModelFineTuningVertical = properties.fine_tuning_details - job_kwargs_dict = DistillationJob._filter_properties( - properties=properties.properties - ) + job_kwargs_dict = DistillationJob._filter_properties(properties=properties.properties) job_args_dict = { "id": obj.id, @@ -477,17 +453,13 @@ def _add_distillation_properties(self, properties: Dict) -> None: :type properties: typing.Dict """ properties[AzureMLDistillationProperties.ENABLE_DISTILLATION] = True - properties[AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE] = ( - self._data_generation_task_type.upper() - ) + properties[AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE] = self._data_generation_task_type.upper() properties[f"{AzureMLDistillationProperties.TEACHER_MODEL}.endpoint_name"] = ( self._teacher_model_endpoint_connection.name ) # Not needed for FT Overload API but additional info needed to convert from REST object to Distillation object - properties[AzureMLDistillationProperties.DATA_GENERATION_TYPE] = ( - self._data_generation_type - ) + properties[AzureMLDistillationProperties.DATA_GENERATION_TYPE] = self._data_generation_type properties[AzureMLDistillationProperties.CONNECTION_INFORMATION] = json.dumps( self._teacher_model_endpoint_connection._to_dict() # pylint: disable=protected-access ) @@ -504,9 +476,7 @@ def _add_distillation_properties(self, properties: Dict) -> None: if inference_settings: for inference_key, value in inference_settings.items(): if value is not None: - properties[ - f"{AzureMLDistillationProperties.TEACHER_MODEL}.{inference_key}" - ] = value + properties[f"{AzureMLDistillationProperties.TEACHER_MODEL}.{inference_key}"] = value if endpoint_settings: for setting, value in endpoint_settings.items(): @@ -514,9 +484,7 @@ def _add_distillation_properties(self, properties: Dict) -> None: properties[f"azureml.{setting.strip('_')}"] = value if self._resources and self._resources.instance_type: - properties[ - f"{AzureMLDistillationProperties.INSTANCE_TYPE}.data_generation" - ] = self._resources.instance_type + properties[f"{AzureMLDistillationProperties.INSTANCE_TYPE}.data_generation"] = self._resources.instance_type # TODO: Remove once Distillation is added to MFE @staticmethod @@ -568,10 +536,7 @@ def _filter_properties(cls, properties: Dict) -> Dict: teacher_model_info = "" for key, val in properties.items(): param = key.split(".")[-1] - if ( - AzureMLDistillationProperties.TEACHER_MODEL in key - and param != "endpoint_name" - ): + if AzureMLDistillationProperties.TEACHER_MODEL in key and param != "endpoint_name": inference_parameters[param] = cls._coerce_property_value(val) elif AzureMLDistillationProperties.INSTANCE_TYPE in key: resources[key.split(".")[1]] = val @@ -589,38 +554,26 @@ def _filter_properties(cls, properties: Dict) -> Dict: teacher_settings["endpoint_request_settings"] = EndpointRequestSettings(**endpoint_settings) # type: ignore return { - "data_generation_task_type": properties.get( - AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE - ), - "data_generation_type": properties.get( - AzureMLDistillationProperties.DATA_GENERATION_TYPE - ), + "data_generation_task_type": properties.get(AzureMLDistillationProperties.DATA_GENERATION_TASK_TYPE), + "data_generation_type": properties.get(AzureMLDistillationProperties.DATA_GENERATION_TYPE), "teacher_model_endpoint_connection": WorkspaceConnection._load( # pylint: disable=protected-access data=json.loads(teacher_model_info) ), "teacher_model_settings": ( TeacherModelSettings(**teacher_settings) if teacher_settings else None # type: ignore ), - "prompt_settings": ( - PromptSettings(**prompt_settings) if prompt_settings else None - ), + "prompt_settings": (PromptSettings(**prompt_settings) if prompt_settings else None), "resources": ResourceConfiguration(**resources) if resources else None, } def _restore_inputs(self) -> None: """Restore UriFileJobInputs to JobInputs within data_settings.""" if isinstance(self.training_data, UriFileJobInput): - self.training_data = Input( - type=AssetTypes.URI_FILE, path=self.training_data.uri - ) + self.training_data = Input(type=AssetTypes.URI_FILE, path=self.training_data.uri) if isinstance(self.validation_data, UriFileJobInput): - self.validation_data = Input( - type=AssetTypes.URI_FILE, path=self.validation_data.uri - ) + self.validation_data = Input(type=AssetTypes.URI_FILE, path=self.validation_data.uri) if isinstance(self.student_model, MLFlowModelJobInput): - self.student_model = Input( - type=AssetTypes.MLFLOW_MODEL, path=self.student_model.uri - ) + self.student_model = Input(type=AssetTypes.MLFLOW_MODEL, path=self.student_model.uri) def __eq__(self, other: object) -> bool: """Returns True if both instances have the same values. @@ -649,8 +602,7 @@ def __eq__(self, other: object) -> bool: return ( self.data_generation_type == other.data_generation_type and self.data_generation_task_type == other.data_generation_task_type - and self.teacher_model_endpoint_connection.name - == other.teacher_model_endpoint_connection.name + and self.teacher_model_endpoint_connection.name == other.teacher_model_endpoint_connection.name and self.student_model == other.student_model and self.training_data == other.training_data and self.validation_data == other.validation_data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py index 245cb014e18d..6390ac069bab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py @@ -107,9 +107,7 @@ class MpiDistribution(DistributionConfiguration): :caption: Configuring a CommandComponent with an MpiDistribution. """ - def __init__( - self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any - ) -> None: + def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any) -> None: super().__init__(**kwargs) self.type = DistributionType.MPI self.process_count_per_instance = process_count_per_instance @@ -136,9 +134,7 @@ class PyTorchDistribution(DistributionConfiguration): :caption: Configuring a CommandComponent with a PyTorchDistribution. """ - def __init__( - self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any - ) -> None: + def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs: Any) -> None: super().__init__(**kwargs) self.type = DistributionType.PYTORCH self.process_count_per_instance = process_count_per_instance @@ -173,11 +169,7 @@ class TensorFlowDistribution(DistributionConfiguration): """ def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs: Any + self, *, parameter_server_count: Optional[int] = 0, worker_count: Optional[int] = None, **kwargs: Any ) -> None: super().__init__(**kwargs) self.type = DistributionType.TENSORFLOW diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py index 5990874ceb89..f78d67d9e325 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py @@ -174,9 +174,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file( - dest, yaml_serialized, default_flow_style=False, path=path, **kwargs - ) + dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) def _get_base_info_dict(self) -> OrderedDict: return OrderedDict( @@ -195,9 +193,7 @@ def _repr_html_(self) -> str: [ ( "Details Page", - make_link( - self.studio_url, "Link to Azure Machine Learning studio" - ), + make_link(self.studio_url, "Link to Azure Machine Learning studio"), ), ] ) @@ -209,9 +205,7 @@ def _to_dict(self) -> Dict: pass @classmethod - def _resolve_cls_and_type( - cls, data: Dict, params_override: Optional[List[Dict]] = None - ) -> Tuple: + def _resolve_cls_and_type(cls, data: Dict, params_override: Optional[List[Dict]] = None) -> Tuple: from azure.ai.ml.entities._builders.command import Command from azure.ai.ml.entities._builders.spark import Spark from azure.ai.ml.entities._job.automl.automl_job import AutoMLJob @@ -225,9 +219,7 @@ def _resolve_cls_and_type( job_type: Optional[Type["Job"]] = None type_in_override = find_type_in_override(params_override) - type_str = type_in_override or data.get( - CommonYamlFields.TYPE, JobType.COMMAND - ) # override takes the priority + type_str = type_in_override or data.get(CommonYamlFields.TYPE, JobType.COMMAND) # override takes the priority if type_str == JobType.COMMAND: job_type = Command elif type_str == JobType.SPARK: @@ -297,9 +289,7 @@ def _load( return job @classmethod - def _from_rest_object( # pylint: disable=too-many-return-statements - cls, obj: Union[JobBase, Run] - ) -> "Job": + def _from_rest_object(cls, obj: Union[JobBase, Run]) -> "Job": # pylint: disable=too-many-return-statements from azure.ai.ml.entities import PipelineJob from azure.ai.ml.entities._builders.command import Command from azure.ai.ml.entities._builders.spark import Spark @@ -321,9 +311,7 @@ def _from_rest_object( # pylint: disable=too-many-return-statements if obj.properties.job_type == RestJobType.COMMAND: # PrP only until new import job type is ready on MFE in PuP # compute type 'DataFactory' is reserved compute name for 'clusterless' ADF jobs - if obj.properties.compute_id and obj.properties.compute_id.endswith( - "/" + ComputeType.ADF - ): + if obj.properties.compute_id and obj.properties.compute_id.endswith("/" + ComputeType.ADF): return ImportJob._load_from_rest(obj) res_command: Job = Command._load_from_rest_job(obj) @@ -380,7 +368,5 @@ def _get_telemetry_values(self) -> Dict: # pylint: disable=arguments-differ @classmethod @abstractmethod - def _load_from_dict( - cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any - ) -> "Job": + def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Job": pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py index fb73c03ac371..cfd6648410cd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_service.py @@ -78,8 +78,7 @@ def _validate_nodes(self) -> None: def _validate_type_name(self) -> None: if self.type and not self.type in JobServiceTypeNames.ENTITY_TO_REST: msg = ( - f"type should be one of " - f"{JobServiceTypeNames.NAMES_ALLOWED_FOR_PUBLIC}, but received '{self.type}'." + f"type should be one of " f"{JobServiceTypeNames.NAMES_ALLOWED_FOR_PUBLIC}, but received '{self.type}'." ) raise ValidationException( message=msg, @@ -89,20 +88,14 @@ def _validate_type_name(self) -> None: error_type=ValidationErrorType.INVALID_VALUE, ) - def _to_rest_job_service( - self, updated_properties: Optional[Dict[str, str]] = None - ) -> RestJobService: + def _to_rest_job_service(self, updated_properties: Optional[Dict[str, str]] = None) -> RestJobService: # ``status`` is intentionally NOT set on the wire object. On the v2023_04 msrest model it was a # readonly attribute that ``serialize()`` silently dropped, so the submitted body never carried it. # The shared arm_ml_service model exposes ``status`` as a writable field, so omitting it here keeps # the wire payload byte-identical to the previous behavior. return RestJobService( endpoint=self.endpoint, - job_service_type=( - JobServiceTypeNames.ENTITY_TO_REST.get(self.type, None) - if self.type - else None - ), + job_service_type=(JobServiceTypeNames.ENTITY_TO_REST.get(self.type, None) if self.type else None), nodes=AllNodes() if self.nodes else None, port=self.port, properties=updated_properties if updated_properties else self.properties, @@ -239,9 +232,7 @@ def _from_rest_object(cls, obj: RestJobService) -> "SshJobService": return ssh_job_service def _to_rest_object(self) -> RestJobService: - updated_properties = _append_or_update_properties( - self.properties, "sshPublicKeys", self.ssh_public_keys - ) + updated_properties = _append_or_update_properties(self.properties, "sshPublicKeys", self.ssh_public_keys) return self._to_rest_job_service(updated_properties) @@ -297,16 +288,12 @@ def __init__( @classmethod def _from_rest_object(cls, obj: RestJobService) -> "TensorBoardJobService": - tensorboard_job_Service = cast( - TensorBoardJobService, cls._from_rest_job_service_object(obj) - ) + tensorboard_job_Service = cast(TensorBoardJobService, cls._from_rest_job_service_object(obj)) tensorboard_job_Service.log_dir = _get_property(obj.properties, "logDir") return tensorboard_job_Service def _to_rest_object(self) -> RestJobService: - updated_properties = _append_or_update_properties( - self.properties, "logDir", self.log_dir - ) + updated_properties = _append_or_update_properties(self.properties, "logDir", self.log_dir) return self._to_rest_job_service(updated_properties) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 091bf4ea180b..569bffa193e3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -61,9 +61,7 @@ def _get_supported_outputs_types(cls) -> Optional[Any]: return None @classmethod - def _validate_io( - cls, value: Any, allowed_types: Optional[tuple], *, key: Optional[str] = None - ) -> None: + def _validate_io(cls, value: Any, allowed_types: Optional[tuple], *, key: Optional[str] = None) -> None: if allowed_types is None: return @@ -73,9 +71,7 @@ def _validate_io( msg = "Expecting {} for input/output {}, got {} instead." raise ValidationException( message=msg.format(allowed_types, key, type(value)), - no_personal_data_message=msg.format( - allowed_types, "[key]", type(value) - ), + no_personal_data_message=msg.format(allowed_types, "[key]", type(value)), target=ErrorTarget.PIPELINE, error_type=ValidationErrorType.INVALID_VALUE, ) @@ -84,9 +80,7 @@ def _build_input( self, name: str, meta: Optional[Input], - data: Optional[ - Union[dict, int, bool, float, str, Output, "PipelineInput", Input] - ], + data: Optional[Union[dict, int, bool, float, str, Output, "PipelineInput", Input]], ) -> NodeInput: # output mode of last node should not affect input mode of next node if isinstance(data, NodeOutput): @@ -106,9 +100,7 @@ def _build_input( self._validate_io(data, self._get_supported_inputs_types(), key=name) return NodeInput(port_name=name, meta=meta, data=data, owner=self) - def _build_output( - self, name: str, meta: Optional[Output], data: Optional[Union[Output, str]] - ) -> NodeOutput: + def _build_output(self, name: str, meta: Optional[Output], data: Optional[Union[Output, str]]) -> NodeOutput: if isinstance(data, dict): data = Output(**data) @@ -146,17 +138,12 @@ def _build_inputs_dict( # If input is set through component functions' kwargs, create an input object with real value. data = inputs[key] else: - data = self._get_default_input_val( - val - ) # pylint: disable=assignment-from-none + data = self._get_default_input_val(val) # pylint: disable=assignment-from-none val = self._build_input(name=key, meta=val, data=data) input_dict[key] = val else: - input_dict = { - key: self._build_input(name=key, meta=None, data=val) - for key, val in inputs.items() - } + input_dict = {key: self._build_input(name=key, meta=None, data=val) for key, val in inputs.items()} return InputsAttrDict(input_dict) def _build_outputs_dict( @@ -192,9 +179,7 @@ def _build_outputs_dict( else: output_dict = {} for key, val in outputs.items(): - output_val = self._build_output( - name=key, meta=None, data=val if not none_data else None - ) + output_val = self._build_output(name=key, meta=None, data=val if not none_data else None) output_dict[key] = output_val return OutputsAttrDict(output_dict) @@ -259,9 +244,7 @@ def _to_rest_inputs(self) -> Dict[str, Dict]: return self._input_entity_to_rest_inputs(input_entity=built_inputs) @classmethod - def _input_entity_to_rest_inputs( - cls, input_entity: Dict[str, Input] - ) -> Dict[str, Dict]: + def _input_entity_to_rest_inputs(cls, input_entity: Dict[str, Input]) -> Dict[str, Dict]: # Convert io entity to rest io objects input_bindings, dataset_literal_inputs = process_sdk_component_job_io( input_entity, [ComponentJobConstants.INPUT_PATTERN] @@ -320,17 +303,14 @@ def _rename_name_and_version(output_dict: Dict) -> Dict: return output_dict rest_data_outputs = { - name: _rename_name_and_version(_rest_io_to_snake_dict(val)) - for name, val in rest_data_outputs.items() + name: _rename_name_and_version(_rest_io_to_snake_dict(val)) for name, val in rest_data_outputs.items() } self._update_output_types(rest_data_outputs) rest_data_outputs.update(rest_output_bindings) return rest_data_outputs @classmethod - def _from_rest_inputs( - cls, inputs: Dict - ) -> Dict[str, Union[Input, str, bool, int, float]]: + def _from_rest_inputs(cls, inputs: Dict) -> Dict[str, Union[Input, str, bool, int, float]]: """Load inputs from rest inputs. :param inputs: The REST inputs @@ -340,9 +320,7 @@ def _from_rest_inputs( """ # JObject -> RestJobInput/RestJobOutput - input_bindings, rest_inputs = from_dict_to_rest_io( - inputs, RestJobInput, [ComponentJobConstants.INPUT_PATTERN] - ) + input_bindings, rest_inputs = from_dict_to_rest_io(inputs, RestJobInput, [ComponentJobConstants.INPUT_PATTERN]) # RestJobInput/RestJobOutput -> Input/Output dataset_literal_inputs = from_rest_inputs_to_dataset_literal(rest_inputs) @@ -438,32 +416,23 @@ def _validate_group_input_type( """ # Note: We put and extra validation here instead of doing it in pipeline._validate() # due to group input will be discarded silently if assign it to a non-group parameter. - group_msg = ( - "'%s' is defined as a parameter group but got input '%s' with type '%s'." - ) - non_group_msg = ( - "'%s' is defined as a parameter but got a parameter group as input." - ) + group_msg = "'%s' is defined as a parameter group but got input '%s' with type '%s'." + non_group_msg = "'%s' is defined as a parameter but got a parameter group as input." for key, val in inputs.items(): definition = input_definition_dict.get(key) val = GroupInput.custom_class_value_to_attr_dict(val) if val is None: continue # 1. inputs.group = 'a string' - if isinstance(definition, GroupInput) and not isinstance( - val, (_GroupAttrDict, dict) - ): + if isinstance(definition, GroupInput) and not isinstance(val, (_GroupAttrDict, dict)): raise ValidationException( message=group_msg % (key, val, type(val)), - no_personal_data_message=group_msg - % ("[key]", "[val]", "[type(val)]"), + no_personal_data_message=group_msg % ("[key]", "[val]", "[type(val)]"), target=ErrorTarget.PIPELINE, type=ValidationErrorType.INVALID_VALUE, ) # 2. inputs.str_param = group - if not isinstance(definition, GroupInput) and isinstance( - val, _GroupAttrDict - ): + if not isinstance(definition, GroupInput) and isinstance(val, _GroupAttrDict): raise ValidationException( message=non_group_msg % key, no_personal_data_message=non_group_msg % "[key]", @@ -523,14 +492,8 @@ def _flatten_inputs_and_definition( :return: The flattened inputs and definition :rtype: Tuple[Dict, Dict] """ - group_input_names = [ - key - for key, val in input_definition_dict.items() - if isinstance(val, GroupInput) - ] - flattened_inputs = flatten_dict( - inputs, _GroupAttrDict, allow_dict_fields=group_input_names - ) + group_input_names = [key for key, val in input_definition_dict.items() if isinstance(val, GroupInput)] + flattened_inputs = flatten_dict(inputs, _GroupAttrDict, allow_dict_fields=group_input_names) flattened_definition_dict = flatten_dict(input_definition_dict, GroupInput) return flattened_inputs, flattened_definition_dict @@ -557,13 +520,11 @@ def _build_inputs_dict( self._validate_group_input_type(input_definition_dict, inputs) # Flatten inputs and definition - flattened_inputs, flattened_definition_dict = ( - self._flatten_inputs_and_definition(inputs, input_definition_dict) + flattened_inputs, flattened_definition_dict = self._flatten_inputs_and_definition( + inputs, input_definition_dict ) # Build: zip all flattened parameter with definition - inputs = super()._build_inputs_dict( - flattened_inputs, input_definition_dict=flattened_definition_dict - ) + inputs = super()._build_inputs_dict(flattened_inputs, input_definition_dict=flattened_definition_dict) return InputsAttrDict(GroupInput.restore_flattened_inputs(inputs)) return super()._build_inputs_dict(inputs) @@ -572,9 +533,7 @@ class PipelineJobIOMixin(NodeWithGroupInputMixin): """Provides ability to wrap pipeline job inputs/outputs and build data bindings dynamically.""" - def _build_input( - self, name: str, meta: Optional[Input], data: Any - ) -> "PipelineInput": + def _build_input(self, name: str, meta: Optional[Input], data: Any) -> "PipelineInput": return PipelineInput(name=name, meta=meta, data=data, owner=self) def _build_output( @@ -602,18 +561,14 @@ def _build_inputs_dict( :return: Built input attribute dict. :rtype: InputsAttrDict """ - input_dict = super()._build_inputs_dict( - inputs, input_definition_dict=input_definition_dict - ) + input_dict = super()._build_inputs_dict(inputs, input_definition_dict=input_definition_dict) # TODO: should we do this when input_definition_dict is not None? # TODO: should we put this in super()._build_inputs_dict? if input_definition_dict is None: return InputsAttrDict(GroupInput.restore_flattened_inputs(input_dict)) return input_dict - def _build_output_for_pipeline( - self, name: str, data: Optional[Union[Output, NodeOutput]] - ) -> "PipelineOutput": + def _build_output_for_pipeline(self, name: str, data: Optional[Union[Output, NodeOutput]]) -> "PipelineOutput": """Build an output object for pipeline and copy settings from source output. :param name: Output name. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py index b301279007d1..22f6091f2ccd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py @@ -64,13 +64,9 @@ def process_sdk_component_job_io( # add mode to literal value for binding input if mode: if isinstance(io_value, Input): - io_bindings[io_name].update( - {"mode": INPUT_MOUNT_MAPPING_TO_REST[mode]} - ) + io_bindings[io_name].update({"mode": INPUT_MOUNT_MAPPING_TO_REST[mode]}) else: - io_bindings[io_name].update( - {"mode": OUTPUT_MOUNT_MAPPING_TO_REST[mode]} - ) + io_bindings[io_name].update({"mode": OUTPUT_MOUNT_MAPPING_TO_REST[mode]}) if name or version: assert isinstance(io_value, Output) if name: @@ -86,9 +82,7 @@ def process_sdk_component_job_io( msg = "{} has changed to {}, please change to use new format." raise ValidationException( message=msg.format(path, new_format), - no_personal_data_message=msg.format( - "[io_value]", "[io_value_new_format]" - ), + no_personal_data_message=msg.format("[io_value]", "[io_value_new_format]"), target=ErrorTarget.PIPELINE, error_category=ErrorCategory.USER_ERROR, ) @@ -143,13 +137,9 @@ def from_dict_to_rest_io( io_mode = DIRTY_MODE_MAPPING[io_mode] val["mode"] = io_mode if io_mode in OUTPUT_MOUNT_MAPPING_FROM_REST: - io_bindings[key].update( - {"mode": OUTPUT_MOUNT_MAPPING_FROM_REST[io_mode]} - ) + io_bindings[key].update({"mode": OUTPUT_MOUNT_MAPPING_FROM_REST[io_mode]}) else: - io_bindings[key].update( - {"mode": INPUT_MOUNT_MAPPING_FROM_REST[io_mode]} - ) + io_bindings[key].update({"mode": INPUT_MOUNT_MAPPING_FROM_REST[io_mode]}) # add name and version for binding input if io_name or io_version: assert rest_object_class.__name__ == "JobOutput" @@ -177,9 +167,7 @@ def from_dict_to_rest_io( # camelCase wire keys, so convert the snake_case ``val`` first. This rebuilds the # correct discriminated subtype (e.g. UriFileJobInput) just like msrest did. camel_val = {snake_to_camel(k): v for k, v in val.items()} - rest_obj = rest_object_class._deserialize( - camel_val, [] - ) # pylint: disable=protected-access + rest_obj = rest_object_class._deserialize(camel_val, []) # pylint: disable=protected-access rest_io_objects[key] = rest_obj else: msg = "Got unsupported type of input/output: {}:" + f"{type(val)}" @@ -204,9 +192,7 @@ def from_dict_to_rest_distribution( return TensorFlow(**distribution_dict) if target_type == "ray": return Ray(**distribution_dict) - msg = "Distribution type must be pytorch, mpi, tensorflow or ray: {}".format( - target_type - ) + msg = "Distribution type must be pytorch, mpi, tensorflow or ray: {}".format(target_type) raise ValidationException( message=msg, no_personal_data_message=msg, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py index 121e908df7a3..c0627438cdb9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/resource_configuration.py @@ -42,9 +42,7 @@ def __init__( if properties is not None: for key, value in properties.items(): if key == JobComputePropertyFields.AISUPERCOMPUTER: - self.properties[JobComputePropertyFields.SINGULARITY.lower()] = ( - value - ) + self.properties[JobComputePropertyFields.SINGULARITY.lower()] = value else: self.properties[key] = value @@ -55,8 +53,7 @@ def _to_rest_object(self) -> RestResourceConfiguration: try: if ( key.lower() == JobComputePropertyFields.SINGULARITY.lower() - or key.lower() - == JobComputePropertyFields.AISUPERCOMPUTER.lower() + or key.lower() == JobComputePropertyFields.AISUPERCOMPUTER.lower() ): # Map Singularity -> AISupercomputer in SDK until MFE does mapping key = JobComputePropertyFields.AISUPERCOMPUTER @@ -86,10 +83,7 @@ def _from_rest_object( # pylint: disable=arguments-renamed def __eq__(self, other: object) -> bool: if not isinstance(other, ResourceConfiguration): return NotImplemented - return ( - self.instance_count == other.instance_count - and self.instance_type == other.instance_type - ) + return self.instance_count == other.instance_count and self.instance_type == other.instance_type def __ne__(self, other: object) -> bool: if not isinstance(other, ResourceConfiguration): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py index e3f52a0dde63..333c9a74d96a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py @@ -195,12 +195,8 @@ def __init__( if endpoint is None: raise ValueError("If target is unset, then endpoint must be set") if one_lake_workspace_name is None: - raise ValueError( - "If target is unset, then one_lake_workspace_name must be set" - ) - target = MicrosoftOneLakeConnection._construct_target( - endpoint, one_lake_workspace_name, artifact - ) + raise ValueError("If target is unset, then one_lake_workspace_name must be set") + target = MicrosoftOneLakeConnection._construct_target(endpoint, one_lake_workspace_name, artifact) super().__init__( target=target, type=camel_to_snake(ConnectionCategory.AZURE_ONE_LAKE), @@ -216,9 +212,7 @@ def _get_schema_class(cls) -> Type: # Target is constructed from user inputs, because it's apparently very difficult for users to # directly access a One Lake's target URL. @classmethod - def _construct_target( - cls, endpoint: str, workspace: str, artifact: OneLakeConnectionArtifact - ) -> str: + def _construct_target(cls, endpoint: str, workspace: str, artifact: OneLakeConnectionArtifact) -> str: artifact_name = artifact.name # If an id is supplied, the format is different if re.match(".{7}-.{4}-.{4}-.{4}.{12}", artifact_name): @@ -262,8 +256,8 @@ def __init__( **kwargs: Any, ): # See if credentials directly inputted via kwargs - credentials: Union[AadCredentialConfiguration, ApiKeyConfiguration] = ( - kwargs.pop("credentials", AadCredentialConfiguration()) + credentials: Union[AadCredentialConfiguration, ApiKeyConfiguration] = kwargs.pop( + "credentials", AadCredentialConfiguration() ) # Replace anything that isn't an API credential with an AAD credential. # Importantly, this replaced the None credential default from the parent YAML schema. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py index 267164e39412..06ddcd677d61 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py @@ -194,9 +194,7 @@ def __init__( ) else: metadata = tags - warnings.warn( - "Tags are a deprecated field for connections, use metadata instead." - ) + warnings.warn("Tags are a deprecated field for connections, use metadata instead.") super().__init__(**kwargs) @@ -219,17 +217,13 @@ def _validate_cred_for_conn_cat(self) -> None: # so I will endeavor to smooth over that inconsistency here. converted_type = _snake_to_camel(self.type).lower() if self._credentials == NoneCredentialConfiguration() and any( - converted_type == _snake_to_camel(item).lower() - for item in DATASTORE_CONNECTIONS + converted_type == _snake_to_camel(item).lower() for item in DATASTORE_CONNECTIONS ): self._credentials = AadCredentialConfiguration() if self.type in CONNECTION_CATEGORY_TO_CREDENTIAL_MAP: allowed_credentials = CONNECTION_CATEGORY_TO_CREDENTIAL_MAP[self.type] - if ( - self.credentials is None - and NoneCredentialConfiguration not in allowed_credentials - ): + if self.credentials is None and NoneCredentialConfiguration not in allowed_credentials: raise ValueError( f"Cannot instantiate a Connection with a type of {self.type} and no credentials." f"Please supply credentials from one of the following types: {allowed_credentials}." @@ -419,9 +413,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file( - dest, yaml_serialized, default_flow_style=False, path=path, **kwargs - ) + dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) @classmethod def _load( @@ -440,14 +432,10 @@ def _load( return cls._load_from_dict(data=data, context=context, **kwargs) @classmethod - def _load_from_dict( - cls, data: Dict, context: Dict, **kwargs: Any - ) -> "WorkspaceConnection": + def _load_from_dict(cls, data: Dict, context: Dict, **kwargs: Any) -> "WorkspaceConnection": conn_type = data["type"] if "type" in data else None schema_class = cls._get_schema_class_from_type(conn_type) - loaded_data: WorkspaceConnection = load_from_dict( - schema_class, data, context, **kwargs - ) + loaded_data: WorkspaceConnection = load_from_dict(schema_class, data, context, **kwargs) return loaded_data def _to_dict(self) -> Dict: @@ -458,26 +446,16 @@ def _to_dict(self) -> Dict: return res @classmethod - def _from_rest_object( - cls, rest_obj: RestWorkspaceConnection - ) -> "WorkspaceConnection": + def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> "WorkspaceConnection": conn_class = cls._get_entity_class_from_rest_obj(rest_obj) popped_metadata = conn_class._get_required_metadata_fields() - rest_kwargs = cls._extract_kwargs_from_rest_obj( - rest_obj=rest_obj, popped_metadata=popped_metadata - ) + rest_kwargs = cls._extract_kwargs_from_rest_obj(rest_obj=rest_obj, popped_metadata=popped_metadata) # Check for alternative name for custom connection type (added for client clarity). - if ( - rest_kwargs["type"].lower() - == camel_to_snake(ConnectionCategory.CUSTOM_KEYS).lower() - ): + if rest_kwargs["type"].lower() == camel_to_snake(ConnectionCategory.CUSTOM_KEYS).lower(): rest_kwargs["type"] = ConnectionTypes.CUSTOM - if ( - rest_kwargs["type"].lower() - == camel_to_snake(ConnectionCategory.ADLS_GEN2).lower() - ): + if rest_kwargs["type"].lower() == camel_to_snake(ConnectionCategory.ADLS_GEN2).lower(): rest_kwargs["type"] = ConnectionTypes.AZURE_DATA_LAKE_GEN_2 target = rest_kwargs.get("target", "") # This dumb code accomplishes 2 things. @@ -497,9 +475,7 @@ def _from_rest_object( # AI Services renames it's metadata field when surfaced to users and inputted # into it's initializer for clarity. ResourceId doesn't really tell much on its own. # No default in pop, this should fail if we somehow don't get a resource ID - rest_kwargs["ai_services_resource_id"] = rest_kwargs.pop( - camel_to_snake(CONNECTION_RESOURCE_ID_KEY) - ) + rest_kwargs["ai_services_resource_id"] = rest_kwargs.pop(camel_to_snake(CONNECTION_RESOURCE_ID_KEY)) connection = conn_class(**rest_kwargs) return cast(WorkspaceConnection, connection) @@ -540,11 +516,7 @@ def _to_rest_object(self) -> RestWorkspaceConnection: else: properties = connection_properties_class( target=self.target, - credentials=( - self.credentials._to_workspace_connection_rest_object() - if self._credentials - else None - ), + credentials=(self.credentials._to_workspace_connection_rest_object() if self._credentials else None), metadata=self.metadata, category=_snake_to_camel(conn_type), is_shared_to_all=self.is_shared, @@ -574,39 +546,25 @@ def _extract_kwargs_from_rest_obj( properties = rest_obj.properties credentials: Any = NoneCredentialConfiguration() - credentials_class = ( - _BaseIdentityConfiguration._get_credential_class_from_rest_type( - properties.auth_type - ) - ) + credentials_class = _BaseIdentityConfiguration._get_credential_class_from_rest_type(properties.auth_type) # None and AAD auth types have a property bag class, but no credentials inside that. # Thankfully they both have no inputs. if credentials_class is AadCredentialConfiguration: credentials = AadCredentialConfiguration() elif credentials_class is not NoneCredentialConfiguration: - credentials = credentials_class._from_workspace_connection_rest_object( - properties.credentials - ) + credentials = credentials_class._from_workspace_connection_rest_object(properties.credentials) metadata = properties.metadata if hasattr(properties, "metadata") else {} rest_kwargs = { "id": rest_obj.id, "name": rest_obj.name, "target": properties.target, - "creation_context": ( - SystemData._from_rest_object(rest_obj.system_data) - if rest_obj.system_data - else None - ), + "creation_context": (SystemData._from_rest_object(rest_obj.system_data) if rest_obj.system_data else None), "type": camel_to_snake(properties.category), "credentials": credentials, "metadata": metadata, - "is_shared": ( - properties.is_shared_to_all - if hasattr(properties, "is_shared_to_all") - else True - ), + "is_shared": (properties.is_shared_to_all if hasattr(properties, "is_shared_to_all") else True), } for name in popped_metadata: @@ -658,19 +616,11 @@ def _get_entity_class_from_type(cls, type: str) -> Type: ConnectionCategory.OPEN_AI.lower(): OpenAIConnection, ConnectionCategory.SERP.lower(): SerpConnection, ConnectionCategory.SERVERLESS.lower(): ServerlessConnection, - _snake_to_camel( - ConnectionTypes.AZURE_CONTENT_SAFETY - ).lower(): AzureContentSafetyConnection, - _snake_to_camel( - ConnectionTypes.AZURE_SPEECH_SERVICES - ).lower(): AzureSpeechServicesConnection, + _snake_to_camel(ConnectionTypes.AZURE_CONTENT_SAFETY).lower(): AzureContentSafetyConnection, + _snake_to_camel(ConnectionTypes.AZURE_SPEECH_SERVICES).lower(): AzureSpeechServicesConnection, ConnectionCategory.COGNITIVE_SEARCH.lower(): AzureAISearchConnection, - _snake_to_camel( - ConnectionTypes.AZURE_SEARCH - ).lower(): AzureAISearchConnection, - _snake_to_camel( - ConnectionTypes.AZURE_AI_SERVICES - ).lower(): AzureAIServicesConnection, + _snake_to_camel(ConnectionTypes.AZURE_SEARCH).lower(): AzureAISearchConnection, + _snake_to_camel(ConnectionTypes.AZURE_AI_SERVICES).lower(): AzureAIServicesConnection, ConnectionTypes.AI_SERVICES_REST_PLACEHOLDER.lower(): AzureAIServicesConnection, } return CONNECTION_CATEGORY_TO_SUBCLASS_MAP.get(conn_type, WorkspaceConnection) diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py index d9e2fd2a4ccd..ae58fb582293 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py @@ -59,19 +59,13 @@ class AdditionalIncludesCheckFunc(enum.Enum): class TestCommandComponentEntity: def test_component_load(self): # code is specified in yaml, value is respected - component_yaml = ( - "./tests/test_configs/components/basic_component_code_local_path.yml" - ) + component_yaml = "./tests/test_configs/components/basic_component_code_local_path.yml" def simple_component_validation(command_component): assert command_component.code == "./helloworld_components_with_env" - command_component = verify_entity_load_and_dump( - load_component, simple_component_validation, component_yaml - )[0] - component_yaml = ( - "./tests/test_configs/components/basic_component_code_arm_id.yml" - ) + command_component = verify_entity_load_and_dump(load_component, simple_component_validation, component_yaml)[0] + component_yaml = "./tests/test_configs/components/basic_component_code_arm_id.yml" command_component = load_component( source=component_yaml, ) @@ -88,10 +82,7 @@ def test_command_component_to_dict(self): yaml_dict = load_yaml(yaml_path) yaml_dict["mock_option_param"] = {"mock_key": "mock_val"} command_component = CommandComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert ( - command_component._other_parameter.get("mock_option_param") - == yaml_dict["mock_option_param"] - ) + assert command_component._other_parameter.get("mock_option_param") == yaml_dict["mock_option_param"] yaml_dict["version"] = str(yaml_dict["version"]) component_dict = command_component._to_dict() @@ -184,9 +175,7 @@ def test_command_component_entity_with_io_class(self): "data_1": Input(type="uri_file", optional=True), "param_float0": Input(type="number", default=1.1, min=0, max=5), "param_float1": Input(type="number"), - "param_integer": Input( - type="integer", default=2, min=-1, max=4, optional=True - ), + "param_integer": Input(type="integer", default=2, min=-1, max=4, optional=True), "param_string": Input(type="string", default="default_str"), "param_boolean": Input(type="boolean", default=False), }, @@ -258,9 +247,7 @@ def test_command_component_instance_count(self): ) component_dict = as_attribute_dict(component._to_rest_object()) - yaml_path = ( - "./tests/test_configs/components/helloworld_component_tensorflow.yml" - ) + yaml_path = "./tests/test_configs/components/helloworld_component_tensorflow.yml" yaml_component = load_component(source=yaml_path) yaml_component_dict = as_attribute_dict(yaml_component._to_rest_object()) @@ -295,9 +282,7 @@ def test_command_component_code(self): code="./helloworld_components_with_env", ) - yaml_path = ( - "./tests/test_configs/components/basic_component_code_local_path.yml" - ) + yaml_path = "./tests/test_configs/components/basic_component_code_local_path.yml" yaml_component = load_component(source=yaml_path) assert component.code == yaml_component.code @@ -339,9 +324,7 @@ def test_command_component_version_as_a_function(self): "_source": "YAML.COMPONENT", } - yaml_path = ( - "./tests/test_configs/components/basic_component_code_local_path.yml" - ) + yaml_path = "./tests/test_configs/components/basic_component_code_local_path.yml" yaml_component_version = load_component(source=yaml_path) assert isinstance(yaml_component_version, CommandComponent) @@ -360,10 +343,7 @@ def test_command_component_version_as_a_function(self): # unknown kw arg with pytest.raises(UnexpectedKeywordError) as error_info: yaml_component_version(unknown=1) - assert ( - "[component] CommandComponentBasic() got an unexpected keyword argument 'unknown'." - in str(error_info) - ) + assert "[component] CommandComponentBasic() got an unexpected keyword argument 'unknown'." in str(error_info) def test_command_component_version_as_a_function_with_inputs(self): expected_rest_component = { @@ -381,12 +361,8 @@ def test_command_component_version_as_a_function_with_inputs(self): yaml_path = "./tests/test_configs/components/helloworld_component.yml" yaml_component_version = load_component(source=yaml_path) - pipeline_input = PipelineInput( - name="pipeline_input", owner="pipeline", meta=None - ) - yaml_component = yaml_component_version( - component_in_number=10, component_in_path=pipeline_input - ) + pipeline_input = PipelineInput(name="pipeline_input", owner="pipeline", meta=None) + yaml_component = yaml_component_version(component_in_number=10, component_in_path=pipeline_input) yaml_component._component = "fake_component" rest_yaml_component = yaml_component._to_rest_object() @@ -412,12 +388,8 @@ def test_command_component_help_function(self): # we're using a curated environment environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", ) - basic_component = load_component( - source="./tests/test_configs/components/basic_component_code_local_path.yml" - ) - sweep_component = load_component( - source="./tests/test_configs/components/helloworld_component_for_sweep.yml" - ) + basic_component = load_component(source="./tests/test_configs/components/basic_component_code_local_path.yml") + sweep_component = load_component(source="./tests/test_configs/components/helloworld_component_for_sweep.yml") with patch("sys.stdout", new=StringIO()) as std_out: help(download_unzip_component._func) @@ -425,10 +397,7 @@ def test_command_component_help_function(self): help(sweep_component._func) assert "name: download_and_unzip" in std_out.getvalue() assert "name: sample_command_component_basic" in std_out.getvalue() - assert ( - "name: microsoftsamples_command_component_for_sweep" - in std_out.getvalue() - ) + assert "name: microsoftsamples_command_component_for_sweep" in std_out.getvalue() with patch("sys.stdout", new=StringIO()) as std_out: print(basic_component) @@ -442,10 +411,7 @@ def test_command_component_help_function(self): "name: download_and_unzip\nversion: 0.0.1\ntype: command\ninputs:\n url:\n type: string\n" in std_out.getvalue() ) - assert ( - "name: microsoftsamples_command_component_for_sweep\nversion: 0.0.1\n" - in std_out.getvalue() - ) + assert "name: microsoftsamples_command_component_for_sweep\nversion: 0.0.1\n" in std_out.getvalue() def test_command_help_function(self): test_command = command( @@ -460,9 +426,7 @@ def test_command_help_function(self): distribution=MpiDistribution(process_count_per_instance=4), environment_variables=dict(foo="bar"), # Customers can still do this: - resources=JobResourceConfiguration( - instance_count=2, instance_type="STANDARD_D2" - ), + resources=JobResourceConfiguration(instance_count=2, instance_type="STANDARD_D2"), limits=CommandJobLimits(timeout=300), inputs={ "float": 0.01, @@ -552,18 +516,11 @@ def test_invalid_component_inputs(self) -> None: component = load_component(yaml_path) with pytest.raises(ValidationException) as e: component._validate(raise_error=True) - assert ( - "Invalid component input names 'COMPONENT_IN_NUMBER' and 'component_in_number'" - in str(e.value) - ) + assert "Invalid component input names 'COMPONENT_IN_NUMBER' and 'component_in_number'" in str(e.value) component = load_component( yaml_path, params_override=[ - { - "inputs": { - "component_in_number": {"description": "1", "type": "number"} - } - }, + {"inputs": {"component_in_number": {"description": "1", "type": "number"}}}, ], ) validation_result = component._validate() @@ -610,14 +567,10 @@ def test_primitive_output(self): omits = ["$schema", "_source", "code"] # from YAML - yaml_path = ( - "./tests/test_configs/components/helloworld_component_primitive_outputs.yml" - ) + yaml_path = "./tests/test_configs/components/helloworld_component_primitive_outputs.yml" component1 = load_component(yaml_path) actual_component_dict1 = pydash.omit( - as_attribute_dict(component1._to_rest_object())["properties"][ - "component_spec" - ], + as_attribute_dict(component1._to_rest_object())["properties"]["component_spec"], *omits, ) assert actual_component_dict1 == expected_rest_component @@ -657,9 +610,7 @@ def test_primitive_output(self): code="./helloworld_components_with_env", ) actual_component_dict2 = pydash.omit( - as_attribute_dict(component2._to_rest_object())["properties"][ - "component_spec" - ], + as_attribute_dict(component2._to_rest_object())["properties"]["component_spec"], *omits, ) assert actual_component_dict2 == expected_rest_component @@ -703,9 +654,7 @@ def test_component_code_asset_ignoring_pycache(self) -> None: # use samefile to avoid windows path auto shortening issue assert len(excluded) == 1 assert os.path.isabs(excluded[0]) - assert Path(excluded[0]).samefile( - (Path(temp_dir) / "__pycache__/a.pyc") - ) + assert Path(excluded[0]).samefile((Path(temp_dir) / "__pycache__/a.pyc")) def test_normalized_arm_id_in_component_dict(self): component_dict = { @@ -757,14 +706,9 @@ def test_component_with_ipp_fields(self): "publisher": "contoso", "protectionLevel": "all", } - assert ( - rest_component.properties.component_spec["outputs"] == expected_output_dict - ) + assert rest_component.properties.component_spec["outputs"] == expected_output_dict - assert ( - rest_component.properties.component_spec["inputs"]["training_data"] - == expected_training_data_input_dict - ) + assert rest_component.properties.component_spec["inputs"]["training_data"] == expected_training_data_input_dict # because there's a mismatch between what the service accepts for IPP fields and what it returns # (accepts camelCase for IPP, returns snake_case IPP), mock out the service response @@ -780,13 +724,12 @@ def test_component_with_ipp_fields(self): assert from_rest_dict["intellectual_property"] assert from_rest_dict["intellectual_property"] == yaml_dict assert from_rest_dict["outputs"] == expected_output_dict - assert ( - from_rest_dict["inputs"]["training_data"] - == expected_training_data_input_dict - ) + assert from_rest_dict["inputs"]["training_data"] == expected_training_data_input_dict def test_additional_includes(self) -> None: - yaml_path = "./tests/test_configs/components/component_with_additional_includes/helloworld_additional_includes.yml" + yaml_path = ( + "./tests/test_configs/components/component_with_additional_includes/helloworld_additional_includes.yml" + ) component = load_component(source=yaml_path) assert component._validate().passed, repr(component._validate()) with component._build_code() as code: @@ -946,34 +889,26 @@ def test_additional_includes_with_ignore_file(self, test_files) -> None: for file, content, check_func in test_files: # original file is based on test_configs_dir, need to remove the leading # "component_with_additional_includes" or "additional_includes" to get the relative path - resolved_file_path = Path( - os.path.join(code.path, *Path(file).parts[1:]) - ) + resolved_file_path = Path(os.path.join(code.path, *Path(file).parts[1:])) if check_func == AdditionalIncludesCheckFunc.NO_PARENT: - assert ( - not resolved_file_path.parent.exists() - ), f"{file} should not have parent" + assert not resolved_file_path.parent.exists(), f"{file} should not have parent" elif check_func == AdditionalIncludesCheckFunc.SELF_IS_FILE: assert resolved_file_path.is_file(), f"{file} is not a file" if content is not None: - assert ( - resolved_file_path.read_text() == content - ), f"{file} content is not expected" + assert resolved_file_path.read_text() == content, f"{file} content is not expected" elif check_func == AdditionalIncludesCheckFunc.PARENT_EXISTS: - assert ( - resolved_file_path.parent.is_dir() - ), f"{file} should have parent" + assert resolved_file_path.parent.is_dir(), f"{file} should have parent" elif check_func == AdditionalIncludesCheckFunc.NOT_EXISTS: - assert ( - not resolved_file_path.exists() - ), f"{file} should not exist" + assert not resolved_file_path.exists(), f"{file} should not exist" elif check_func == AdditionalIncludesCheckFunc.SKIP: pass else: raise ValueError(f"Unknown check func: {check_func}") def test_additional_includes_merge_folder(self) -> None: - yaml_path = "./tests/test_configs/components/component_with_additional_includes/additional_includes_merge_folder.yml" + yaml_path = ( + "./tests/test_configs/components/component_with_additional_includes/additional_includes_merge_folder.yml" + ) component = load_component(source=yaml_path) assert component._validate().passed, repr(component._validate()) with component._build_code() as code: @@ -993,9 +928,7 @@ def test_additional_includes_merge_folder(self) -> None: ("code_and_additional_includes/component_spec.yml", True), ], ) - def test_additional_includes_with_code_specified( - self, yaml_path: str, has_additional_includes: bool - ) -> None: + def test_additional_includes_with_code_specified(self, yaml_path: str, has_additional_includes: bool) -> None: yaml_path = os.path.join( "./tests/test_configs/components/component_with_additional_includes/", yaml_path, @@ -1018,18 +951,12 @@ def test_additional_includes_with_code_specified( "helloworld_invalid_additional_includes_root_directory.yml", "helloworld_invalid_additional_includes_zip_file_not_found.yml", ]: - assert ( - (code_path / path).is_file() - if ".yml" in path - else (code_path / path).is_dir() - ) + assert (code_path / path).is_file() if ".yml" in path else (code_path / path).is_dir() assert (code_path / "LICENSE").is_file() else: # additional includes not specified, code should be specified path (default yaml folder) yaml_dict = load_yaml(yaml_path) - specified_code_path = Path(yaml_path).parent / yaml_dict.get( - "code", "./" - ) + specified_code_path = Path(yaml_path).parent / yaml_dict.get("code", "./") assert code_path.resolve() == specified_code_path.resolve() def test_artifacts_in_additional_includes(self): @@ -1085,9 +1012,7 @@ def test_artifacts_in_additional_includes(self): ), ], ) - def test_invalid_additional_includes( - self, yaml_path: str, expected_error_msg_prefix: str - ) -> None: + def test_invalid_additional_includes(self, yaml_path: str, expected_error_msg_prefix: str) -> None: component = load_component( os.path.join( "./tests/test_configs/components/component_with_additional_includes", @@ -1096,6 +1021,4 @@ def test_invalid_additional_includes( ) validation_result = component._validate() assert validation_result.passed is False - assert validation_result.error_messages["additional_includes"].startswith( - expected_error_msg_prefix - ) + assert validation_result.error_messages["additional_includes"].startswith(expected_error_msg_prefix) diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py index 7aacb82c8855..a96040eaee69 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_data_transfer_component_entity.py @@ -21,9 +21,7 @@ @pytest.mark.unittest @pytest.mark.pipeline_test class TestDataTransferComponentEntity: - def test_serialize_deserialize_copy_task_component( - self, mock_machinelearning_client: MLClient - ): + def test_serialize_deserialize_copy_task_component(self, mock_machinelearning_client: MLClient): test_path = "./tests/test_configs/components/data_transfer/copy_files.yaml" component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" @@ -53,15 +51,11 @@ def test_serialize_deserialize_copy_task_component( ] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) rest_dict = pydash.omit(dict(rest_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit( - dict(data_transfer_copy_component._to_dict()), *omit_fields - ) + sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) assert yaml_dict == rest_dict assert sdk_dict == yaml_dict - def test_serialize_deserialize_merge_task_component( - self, mock_machinelearning_client: MLClient - ): + def test_serialize_deserialize_merge_task_component(self, mock_machinelearning_client: MLClient): test_path = "./tests/test_configs/components/data_transfer/merge_files.yaml" component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" @@ -95,18 +89,12 @@ def test_serialize_deserialize_merge_task_component( ] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) rest_dict = pydash.omit(dict(rest_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit( - dict(data_transfer_copy_component._to_dict()), *omit_fields - ) + sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) assert yaml_dict == rest_dict assert sdk_dict == yaml_dict - def test_serialize_deserialize_import_task_component( - self, mock_machinelearning_client: MLClient - ): - test_path = ( - "./tests/test_configs/components/data_transfer/import_file_to_blob.yaml" - ) + def test_serialize_deserialize_import_task_component(self, mock_machinelearning_client: MLClient): + test_path = "./tests/test_configs/components/data_transfer/import_file_to_blob.yaml" component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" ) @@ -122,17 +110,11 @@ def test_serialize_deserialize_import_task_component( omit_fields = ["name", "id", "$schema"] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit( - dict(data_transfer_copy_component._to_dict()), *omit_fields - ) + sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) assert sdk_dict == yaml_dict - def test_serialize_deserialize_export_task_component( - self, mock_machinelearning_client: MLClient - ): - test_path = ( - "./tests/test_configs/components/data_transfer/export_blob_to_database.yaml" - ) + def test_serialize_deserialize_export_task_component(self, mock_machinelearning_client: MLClient): + test_path = "./tests/test_configs/components/data_transfer/export_blob_to_database.yaml" component_entity = load_component_entity_from_yaml( test_path, mock_machinelearning_client, _type="data_transfer" ) @@ -148,9 +130,7 @@ def test_serialize_deserialize_export_task_component( omit_fields = ["name", "id", "$schema"] yaml_dict = pydash.omit(dict(component_entity._to_dict()), *omit_fields) - sdk_dict = pydash.omit( - dict(data_transfer_copy_component._to_dict()), *omit_fields - ) + sdk_dict = pydash.omit(dict(data_transfer_copy_component._to_dict()), *omit_fields) assert sdk_dict == yaml_dict def test_copy_task_component_entity(self): diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py index 5465d1a98d62..b7f3c56db83c 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_flow_component.py @@ -21,9 +21,7 @@ def test_component_load_from_dag(self): target_path = "./tests/test_configs/flows/basic/flow.dag.yaml" component = load_component(target_path) - component._fill_back_code_value( - "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" - ) + component._fill_back_code_value("/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1") component.version = "2" component.description = "test load component from flow" @@ -73,9 +71,7 @@ def test_component_load_from_dag(self): "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" ) - assert ( - as_attribute_dict(named_component._to_rest_object()) == expected_rest_dict - ) + assert as_attribute_dict(named_component._to_rest_object()) == expected_rest_dict def test_component_normalize_folder_name(self): target_path = "./tests/test_configs/flows/basic/" @@ -123,16 +119,12 @@ def test_component_load_from_run(self): "description": "A run of the basic flow", "is_anonymous": False, "is_archived": False, - "properties": { - "client_component_hash": "f060820c-7fb3-56a8-790c-ae2969a7b544" - }, + "properties": {"client_component_hash": "f060820c-7fb3-56a8-790c-ae2969a7b544"}, "tags": {}, }, } - component._fill_back_code_value( - "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" - ) + component._fill_back_code_value("/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1") assert as_attribute_dict(component._to_rest_object()) == expected_rest_dict @@ -155,15 +147,11 @@ def test_component_load_fail(self): pass def test_flow_component_load_with_additional_includes(self): - flow_dir_path = ( - "./tests/test_configs/flows/web_classification_with_additional_includes" - ) + flow_dir_path = "./tests/test_configs/flows/web_classification_with_additional_includes" component = load_component(f"{flow_dir_path}/flow.dag.yaml") with component._build_code() as code: assert Path(code.path, "convert_to_dict.py").is_file() - flow_dag = yaml.safe_load( - Path(code.path, "flow.dag.yaml").read_text(encoding="utf-8") - ) + flow_dag = yaml.safe_load(Path(code.path, "flow.dag.yaml").read_text(encoding="utf-8")) # we won't update the flow.dag.yaml for now. user may use `mldesigner compile` if they want to update it assert "additional_includes" in flow_dag @@ -174,21 +162,15 @@ def test_flow_component_load_from_run_with_additional_includes(self): assert Path(code.path, "convert_to_dict.py").is_file() def test_flow_component_entity(self): - component: FlowComponent = load_component( - "./tests/test_configs/flows/basic/flow.dag.yaml" - ) + component: FlowComponent = load_component("./tests/test_configs/flows/basic/flow.dag.yaml") assert component.type == NodeType.FLOW_PARALLEL input_port_dict = component.inputs - with pytest.raises( - RuntimeError, match="Ports of flow component are not editable." - ): + with pytest.raises(RuntimeError, match="Ports of flow component are not editable."): input_port_dict["text"] = None - with pytest.raises( - RuntimeError, match="Ports of flow component are not editable." - ): + with pytest.raises(RuntimeError, match="Ports of flow component are not editable."): del input_port_dict["text"] with pytest.raises(AttributeError): @@ -206,9 +188,7 @@ def test_flow_component_entity(self): "AZURE_OPENAI_API_BASE": "${azure_open_ai_connection.api_base}", } - component._fill_back_code_value( - "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1" - ) + component._fill_back_code_value("/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1") assert as_attribute_dict(component._to_rest_object()) == { "name": "basic", @@ -216,9 +196,7 @@ def test_flow_component_entity(self): "component_spec": { "_source": "YAML.COMPONENT", "code": "/subscriptions/xxx/resourceGroups/xxx/workspaces/xxx/codes/xxx/versions/1", - "environment_variables": { - "AZURE_OPENAI_API_BASE": "${azure_open_ai_connection.api_base}" - }, + "environment_variables": {"AZURE_OPENAI_API_BASE": "${azure_open_ai_connection.api_base}"}, "flow_file_name": "flow.dag.yaml", "is_deterministic": True, "name": "basic", @@ -228,9 +206,7 @@ def test_flow_component_entity(self): "is_anonymous": False, "is_archived": False, # note that this won't take effect actually - "properties": { - "client_component_hash": "07cdc416-c6ee-0beb-3d1b-4e5a5c4b44ec" - }, + "properties": {"client_component_hash": "07cdc416-c6ee-0beb-3d1b-4e5a5c4b44ec"}, "tags": {}, }, } @@ -331,13 +307,9 @@ def test_flow_component_entity(self): ), ], ) - def test_component_connection_inputs( - self, input_values: dict, expected_rest_objects: dict - ): + def test_component_connection_inputs(self, input_values: dict, expected_rest_objects: dict): component = load_component("./tests/test_configs/flows/basic/flow.dag.yaml") - data_input = Input( - path="./tests/test_configs/flows/data/basic.jsonl", type=AssetTypes.URI_FILE - ) + data_input = Input(path="./tests/test_configs/flows/data/basic.jsonl", type=AssetTypes.URI_FILE) # validation_result = component()._validate() # assert validation_result.passed is False diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py index 40d2f1e548a1..dbea9b612123 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_parallel_component_entity.py @@ -20,9 +20,7 @@ class TestParallelComponentEntity: def test_component_load(self): # code is specified in yaml, value is respected - component_yaml = ( - "./tests/test_configs/components/basic_parallel_component_score.yml" - ) + component_yaml = "./tests/test_configs/components/basic_parallel_component_score.yml" parallel_component = load_component( source=component_yaml, ) @@ -34,13 +32,8 @@ def test_command_component_to_dict(self): yaml_path = "./tests/test_configs/components/basic_parallel_component_score.yml" yaml_dict = load_yaml(yaml_path) yaml_dict["mock_option_param"] = {"mock_key": "mock_val"} - parallel_component = ParallelComponent._load( - data=yaml_dict, yaml_path=yaml_path - ) - assert ( - parallel_component._other_parameter.get("mock_option_param") - == yaml_dict["mock_option_param"] - ) + parallel_component = ParallelComponent._load(data=yaml_dict, yaml_path=yaml_path) + assert parallel_component._other_parameter.get("mock_option_param") == yaml_dict["mock_option_param"] def test_parallel_component_entity(self): task = { @@ -115,12 +108,8 @@ def test_parallel_component_version_as_a_function_with_inputs(self): "type": "run_function", }, } - pipeline_input = PipelineInput( - name="pipeline_input", owner="pipeline", meta=None - ) - yaml_component = yaml_component_version( - model="SVM", label="test", component_in_path=pipeline_input - ) + pipeline_input = PipelineInput(name="pipeline_input", owner="pipeline", meta=None) + yaml_component = yaml_component_version(model="SVM", label="test", component_in_path=pipeline_input) yaml_component._component = "fake_component" rest_yaml_component = yaml_component._to_rest_object() @@ -128,21 +117,11 @@ def test_parallel_component_version_as_a_function_with_inputs(self): assert rest_yaml_component == expected_rest_component def test_parallel_component_run_settings_picked_up(self): - yaml_path = ( - "./tests/test_configs/components/parallel_component_with_run_settings.yml" - ) + yaml_path = "./tests/test_configs/components/parallel_component_with_run_settings.yml" parallel_component = load_component(source=yaml_path) parallel_node = parallel_component() # Normally, during initiation of nodes, the settings from the yaml file shouldn't be changed - assert ( - parallel_component.resources.instance_count - == parallel_node.resources.instance_count - == 1 - ) - assert ( - parallel_component.max_concurrency_per_instance - == parallel_node.max_concurrency_per_instance - == 16 - ) + assert parallel_component.resources.instance_count == parallel_node.resources.instance_count == 1 + assert parallel_component.max_concurrency_per_instance == parallel_node.max_concurrency_per_instance == 16 assert parallel_component.retry_settings == parallel_node.retry_settings assert parallel_component.retry_settings.timeout == 12345 diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py index 63209bfb99ff..eaba157f7c90 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py @@ -21,10 +21,7 @@ def test_component_load(self): component_yaml, ) - assert ( - isinstance(spark_component.py_files, list) - and spark_component.py_files[0] == "utils.zip" - ) + assert isinstance(spark_component.py_files, list) and spark_component.py_files[0] == "utils.zip" assert spark_component.code == "./src" assert as_attribute_dict(spark_component.entry._to_rest_object()) == { "spark_job_entry_type": "SparkJobPythonEntry", @@ -50,10 +47,7 @@ def test_spark_component_to_dict(self): yaml_dict = load_yaml(yaml_path) yaml_dict["mock_option_param"] = {"mock_key": "mock_val"} spark_component = SparkComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert ( - spark_component._other_parameter.get("mock_option_param") - == yaml_dict["mock_option_param"] - ) + assert spark_component._other_parameter.get("mock_option_param") == yaml_dict["mock_option_param"] def test_spark_component_to_dict_additional_include(self): # Test optional params exists in component dict @@ -61,10 +55,7 @@ def test_spark_component_to_dict_additional_include(self): yaml_dict = load_yaml(yaml_path) yaml_dict["additional_includes"] = ["common_src"] spark_component = SparkComponent._load(data=yaml_dict, yaml_path=yaml_path) - assert ( - spark_component.additional_includes[0] - == yaml_dict["additional_includes"][0] - ) + assert spark_component.additional_includes[0] == yaml_dict["additional_includes"][0] def test_spark_component_entity(self): component = SparkComponent( @@ -168,9 +159,7 @@ def test_spark_component_version_as_a_function_with_inputs(self): } yaml_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/add_greeting_column_component.yml" yaml_component_version = load_component(yaml_path) - pipeline_input = PipelineInput( - name="pipeline_input", owner="pipeline", meta=None - ) + pipeline_input = PipelineInput(name="pipeline_input", owner="pipeline", meta=None) yaml_component = yaml_component_version(file_input=pipeline_input) yaml_component.resources = { "instance_type": "Standard_E8S_V3", diff --git a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py index d7c3f65a132b..e609e7052519 100644 --- a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py +++ b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_conversion.py @@ -74,17 +74,13 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): validation_data=Input(type=AssetTypes.URI_FILE, path="bar.jsonl"), teacher_model_settings=TeacherModelSettings( inference_parameters={"temperature": 0.1}, - endpoint_request_settings=EndpointRequestSettings( - request_batch_size=2, min_endpoint_success_ratio=0.8 - ), + endpoint_request_settings=EndpointRequestSettings(request_batch_size=2, min_endpoint_success_ratio=0.8), ), prompt_settings=PromptSettings(enable_chain_of_thought=True), hyperparameters={"bar": "baz"}, name="llama-distillation", experiment_name="bar_experiment", - outputs={ - "registered_model": Output(type="mlflow_model", name="llama-distilled") - }, + outputs={"registered_model": Output(type="mlflow_model", name="llama-distilled")}, ) rest_object = distillation_job._to_rest_object() @@ -97,8 +93,7 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): original_object = DistillationJob._from_rest_object(rest_object) assert ( - original_object.data_generation_task_type.lower() - == data_generation_task_type.lower() + original_object.data_generation_task_type.lower() == data_generation_task_type.lower() ), "Data Generation Task Type not set correctly" assert ( original_object.data_generation_type == DataGenerationType.LABEL_GENERATION @@ -111,57 +106,35 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): original_object.teacher_model_endpoint_connection, ServerlessConnection ), "Teacher model endpoint connection is not ServerlessConnection" assert ( - original_object.teacher_model_endpoint_connection.name - == "Llama-3-1-405B-Instruct-BASE" + original_object.teacher_model_endpoint_connection.name == "Llama-3-1-405B-Instruct-BASE" ), "Teacher model endpoint connection name not set correctly" assert ( - original_object.teacher_model_endpoint_connection.endpoint - == "http://foo.com" + original_object.teacher_model_endpoint_connection.endpoint == "http://foo.com" ), "Teacher model endpoint connection endpoint url not set correctly" assert ( original_object.teacher_model_endpoint_connection.api_key == "TESTKEY" ), "Teacher model endpoint connection api_key not set correctly" - assert isinstance( - original_object.student_model, Input - ), "Student model is not Input" - assert ( - original_object.student_model.type == AssetTypes.MLFLOW_MODEL - ), "Student model type is not mlflow_model" + assert isinstance(original_object.student_model, Input), "Student model is not Input" + assert original_object.student_model.type == AssetTypes.MLFLOW_MODEL, "Student model type is not mlflow_model" assert ( original_object.student_model.path == "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1" ), "Student model path not set correctly" - assert isinstance( - original_object.training_data, Input - ), "Training data is not Input" - assert ( - original_object.training_data.type == AssetTypes.URI_FILE - ), "Training data type not set correctly" - assert ( - original_object.training_data.path == "foo.jsonl" - ), "Training data path not set correctly" - assert isinstance( - original_object.validation_data, Input - ), "Validation data is not Input" - assert ( - original_object.validation_data.type == AssetTypes.URI_FILE - ), "Validation data type not set correctly" - assert ( - original_object.validation_data.path == "bar.jsonl" - ), "Validation data path not set correctly" + assert isinstance(original_object.training_data, Input), "Training data is not Input" + assert original_object.training_data.type == AssetTypes.URI_FILE, "Training data type not set correctly" + assert original_object.training_data.path == "foo.jsonl", "Training data path not set correctly" + assert isinstance(original_object.validation_data, Input), "Validation data is not Input" + assert original_object.validation_data.type == AssetTypes.URI_FILE, "Validation data type not set correctly" + assert original_object.validation_data.path == "bar.jsonl", "Validation data path not set correctly" assert original_object.teacher_model_settings.inference_parameters == { "temperature": 0.1 }, "Inference parameters not set correctly" - assert original_object._hyperparameters == { - "bar": "baz" - }, "Hyperparameters not set correctly" + assert original_object._hyperparameters == {"bar": "baz"}, "Hyperparameters not set correctly" assert original_object.name == "llama-distillation", "Name not set correctly" - assert ( - original_object.experiment_name == "bar_experiment" - ), "Experiment name not set correctly" + assert original_object.experiment_name == "bar_experiment", "Experiment name not set correctly" assert isinstance( original_object.teacher_model_settings, TeacherModelSettings @@ -171,30 +144,20 @@ def test_distillation_job_conversion(self, data_generation_task_type: str): EndpointRequestSettings, ), "Endpoint request settings is not EndpointRequestSettings" assert ( - original_object.teacher_model_settings.endpoint_request_settings.request_batch_size - == 2 + original_object.teacher_model_settings.endpoint_request_settings.request_batch_size == 2 ), "Request batch size not set correctly" assert ( - original_object.teacher_model_settings.endpoint_request_settings.min_endpoint_success_ratio - == 0.8 + original_object.teacher_model_settings.endpoint_request_settings.min_endpoint_success_ratio == 0.8 ), "Min endpoint success ration not set correctly" assert isinstance( original_object._prompt_settings, PromptSettings ), "Prompt settings is not DistillationPromptSettings" - assert ( - original_object._prompt_settings.enable_chain_of_thought - ), "Chain of thought not set correctly" - assert ( - not original_object._prompt_settings.enable_chain_of_density - ), "Chain of density not set correctly" - assert ( - original_object._prompt_settings.max_len_summary is None - ), "Max len summary not set correctly" + assert original_object._prompt_settings.enable_chain_of_thought, "Chain of thought not set correctly" + assert not original_object._prompt_settings.enable_chain_of_density, "Chain of density not set correctly" + assert original_object._prompt_settings.max_len_summary is None, "Max len summary not set correctly" - assert ( - distillation_job == original_object - ), "Conversion to/from rest object failed" + assert distillation_job == original_object, "Conversion to/from rest object failed" @pytest.mark.parametrize( "data_generation_task_type", @@ -217,12 +180,8 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): type=AssetTypes.MLFLOW_MODEL, path="azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B/versions/1", ), - training_data=Input( - type=AssetTypes.URI_FILE, path="./alex_dataset/math_train.json1" - ), - validation_data=Input( - type=AssetTypes.URI_FILE, path="./alex_dataset/math_val.json1" - ), + training_data=Input(type=AssetTypes.URI_FILE, path="./alex_dataset/math_train.json1"), + validation_data=Input(type=AssetTypes.URI_FILE, path="./alex_dataset/math_val.json1"), teacher_model_settings=TeacherModelSettings( inference_parameters={"max_tokens": 248}, endpoint_request_settings=None ), @@ -233,9 +192,7 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): experiment_name="llama-experiment", tags={"bar": "baz"}, properties={"foo": "baz"}, - outputs={ - "registered_model": Output(type="mlflow_model", name="llama-distilled") - }, + outputs={"registered_model": Output(type="mlflow_model", name="llama-distilled")}, ) dict_object = distillation_job._to_dict() @@ -246,9 +203,7 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): dict_object["data_generation_task_type"] == data_generation_task_type ), "Data Generation Task Type not set correctly" assert dict_object["name"] == "llama-distillation", "Name not set correctly" - assert ( - dict_object["experiment_name"] == "llama-experiment" - ), "Experiment name not set correctly" + assert dict_object["experiment_name"] == "llama-experiment", "Experiment name not set correctly" assert dict_object["tags"] == {"bar": "baz"}, "Tags not set correctly" assert dict_object["properties"]["foo"] == "baz", "Properties not set correctly" @@ -256,41 +211,30 @@ def test_distillation_job_read_from_wire(self, data_generation_task_type: str): dict_object["teacher_model_endpoint_connection"]["name"] == "llama-teacher" ), "Teacher model endpoint connection name not set correctly" assert ( - dict_object["teacher_model_endpoint_connection"]["endpoint"] - == "http://bar.com" + dict_object["teacher_model_endpoint_connection"]["endpoint"] == "http://bar.com" ), "Teacher model endpoint connection endpoint url not set correctly" assert ( dict_object["teacher_model_endpoint_connection"]["api_key"] == "TESTKEY" ), "Teacher model endpoint connection api_key not set correctly" - assert ( - dict_object["student_model"]["type"] == "mlflow_model" - ), "Student model type not set correctly" + assert dict_object["student_model"]["type"] == "mlflow_model", "Student model type not set correctly" assert ( dict_object["student_model"]["path"] == "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B/versions/1" ), "Student model path not set correctly" + assert dict_object["training_data"]["type"] == AssetTypes.URI_FILE, "Training data type not set correctly" assert ( - dict_object["training_data"]["type"] == AssetTypes.URI_FILE - ), "Training data type not set correctly" - assert ( - dict_object["training_data"]["path"] - == "azureml:./alex_dataset/math_train.json1" + dict_object["training_data"]["path"] == "azureml:./alex_dataset/math_train.json1" ), "Training data path not set correctly" + assert dict_object["validation_data"]["type"] == AssetTypes.URI_FILE, "Validation data type not set correctly" assert ( - dict_object["validation_data"]["type"] == AssetTypes.URI_FILE - ), "Validation data type not set correctly" - assert ( - dict_object["validation_data"]["path"] - == "azureml:./alex_dataset/math_val.json1" + dict_object["validation_data"]["path"] == "azureml:./alex_dataset/math_val.json1" ), "Validation data path not set correctly" assert dict_object["teacher_model_settings"]["inference_parameters"] == { "max_tokens": 248 }, "Inference parameters not set correctly" - assert dict_object["prompt_settings"][ - "enable_chain_of_thought" - ], "Enable chain of thought not set correctly" + assert dict_object["prompt_settings"]["enable_chain_of_thought"], "Enable chain of thought not set correctly" assert not dict_object["prompt_settings"][ "enable_chain_of_density" ], "Enable chain of density not set correctly" diff --git a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py index 72e5f9fa5ea5..ad1d2fececf1 100644 --- a/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/distillation_job/unittests/test_distillation_job_schema.py @@ -43,25 +43,17 @@ def test_distillation_job_full_rest_transform(self): type="mlflow_model", path="azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1", ), - training_data=Input( - type="uri_file", path="./samsum_dataset/small_train.jsonl" - ), - validation_data=Input( - type="uri_file", path="./samsum_dataset/small_validation.jsonl" - ), + training_data=Input(type="uri_file", path="./samsum_dataset/small_train.jsonl"), + validation_data=Input(type="uri_file", path="./samsum_dataset/small_validation.jsonl"), teacher_model_settings=TeacherModelSettings( inference_parameters={ "temperature": 0.1, "max_tokens": 100, "top_p": 0.95, }, - endpoint_request_settings=EndpointRequestSettings( - request_batch_size=5, min_endpoint_success_ratio=0.7 - ), - ), - prompt_settings=PromptSettings( - enable_chain_of_thought=False, enable_chain_of_density=False + endpoint_request_settings=EndpointRequestSettings(request_batch_size=5, min_endpoint_success_ratio=0.7), ), + prompt_settings=PromptSettings(enable_chain_of_thought=False, enable_chain_of_density=False), hyperparameters={ "learning_rate": "0.00002", "num_train_epochs": "1", @@ -70,11 +62,7 @@ def test_distillation_job_full_rest_transform(self): experiment_name="Distillation-Math-Test-1234", name="distillation_job_test", description="Distill Llama 3.1 8b model using Llama 3.1 405B teacher model", - outputs={ - "registered_model": Output( - type="mlflow_model", name="llama-3-1-8b-distilled-1234" - ) - }, + outputs={"registered_model": Output(type="mlflow_model", name="llama-3-1-8b-distilled-1234")}, resources=ResourceConfiguration(instance_type="Standard_D2_v2"), ) sdk_rest_object = DistillationJob._to_rest_object(distillation_job) @@ -100,9 +88,7 @@ def test_distillation_job_input_rest_transform(self): validation_data=Input(type="uri_file", path="validation_data:1"), teacher_model_settings=TeacherModelSettings( inference_parameters={"frequency_penalty": 1, "presence_penalty": 1}, - endpoint_request_settings=EndpointRequestSettings( - min_endpoint_success_ratio=0.9 - ), + endpoint_request_settings=EndpointRequestSettings(min_endpoint_success_ratio=0.9), ), prompt_settings=PromptSettings( enable_chain_of_thought=False, @@ -113,11 +99,7 @@ def test_distillation_job_input_rest_transform(self): experiment_name="Distillation-Math-Test-1234", name="distillation_job_test", description="Distill Llama 3.1 8b model using Llama 3.1 405B teacher model", - outputs={ - "registered_model": Output( - type="mlflow_model", name="llama-3-1-8b-distilled-1234" - ) - }, + outputs={"registered_model": Output(type="mlflow_model", name="llama-3-1-8b-distilled-1234")}, resources=ResourceConfiguration(instance_type="Standard_D2_v3"), ) sdk_rest_object = DistillationJob._to_rest_object(distillation_job) diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py index 3e840bcb685e..f76f5d5cabab 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py @@ -182,9 +182,7 @@ def test_command_function(self, test_command): "_source": "BUILDER", "code": parse_local_path("./tests"), "description": "This is a fancy job", - "command": "python train.py --input-data " - "${{inputs.uri_folder}} --lr " - "${{inputs.float}}", + "command": "python train.py --input-data " "${{inputs.uri_folder}} --lr " "${{inputs.float}}", "display_name": "my-fancy-job", "distribution": {"process_count_per_instance": 4, "type": "mpi"}, "environment": "azureml:my-env:1", @@ -197,9 +195,7 @@ def test_command_function(self, test_command): "uri_folder": {"type": "uri_folder", "mode": "ro_mount"}, }, "is_deterministic": True, - "outputs": { - "my_model": {"type": "mlflow_model", "mode": "rw_mount"} - }, + "outputs": {"my_model": {"type": "mlflow_model", "mode": "rw_mount"}}, "type": "command", }, "description": "This is a fancy job", @@ -227,9 +223,7 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): "_source": "BUILDER", "code": parse_local_path("./tests"), "description": "This is a fancy job", - "command": "python train.py --input-data " - "${{inputs.uri_folder}} --lr " - "${{inputs.float}}", + "command": "python train.py --input-data " "${{inputs.uri_folder}} --lr " "${{inputs.float}}", "display_name": "my-fancy-job", "distribution": {"process_count_per_instance": 4, "type": "mpi"}, "environment": "azureml:my-env:1", @@ -242,9 +236,7 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): "uri_folder": {"type": "uri_folder", "mode": "ro_mount"}, }, "is_deterministic": False, - "outputs": { - "my_model": {"type": "mlflow_model", "mode": "rw_mount"} - }, + "outputs": {"my_model": {"type": "mlflow_model", "mode": "rw_mount"}}, "type": "command", }, "description": "This is a fancy job", @@ -255,9 +247,7 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): } } actual_component = pydash.omit( - as_attribute_dict( - test_no_deterministic_command._component._to_rest_object() - ), + as_attribute_dict(test_no_deterministic_command._component._to_rest_object()), "name", "properties.component_spec.name", "properties.properties.client_component_hash", @@ -265,9 +255,7 @@ def test_no_deterministic_command_function(self, test_no_deterministic_command): assert actual_component == expected_component def test_command_function_set_inputs(self, test_command): - test_data = Input( - type="uri_folder", path="https://my-blob/path/to/data", mode="download" - ) + test_data = Input(type="uri_folder", path="https://my-blob/path/to/data", mode="download") # Command can be called as a function, returning a new Component instance node1 = test_command(uri_folder=test_data, float=0.02) node2 = test_command(uri_folder=test_data, float=0.02) @@ -469,9 +457,7 @@ def test_command_with_artifact_inputs(self, command_with_artifact_inputs): "_source": "BUILDER", "description": "This is a fancy job", "code": parse_local_path("./tests"), - "command": "python train.py --input-data " - "${{inputs.uri_folder}} --lr " - "${{inputs.float}}", + "command": "python train.py --input-data " "${{inputs.uri_folder}} --lr " "${{inputs.float}}", "display_name": "my-fancy-job", "distribution": {"process_count_per_instance": 4, "type": "mpi"}, "environment": "azureml:my-env:1", @@ -554,9 +540,7 @@ def test_set_resources(self, test_command): def test_inputs_binding(self, test_command): node1 = test_command() node2 = test_command() - node3 = test_command( - uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model - ) + node3 = test_command(uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model) node1.name = "new_name1" node2.name = "new_name2" @@ -583,9 +567,7 @@ def test_inputs_binding(self, test_command): node1 = test_command() node2 = node1() - node3 = node2( - uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model - ) + node3 = node2(uri_file=node1.outputs.my_model, uri_folder=node2.outputs.my_model) node1.name = "new_node1" node2.name = "new_node2" @@ -676,9 +658,7 @@ def test_invalid_command_params(self, test_command_params): assert re.match(pattern, str(e.value)), str(e.value) def test_command_unprovided_inputs_outputs(self, test_command_params): - test_command_params.update( - {"inputs": None, "outputs": None, "command": "echo hello"} - ) + test_command_params.update({"inputs": None, "outputs": None, "command": "echo hello"}) node1 = command(**test_command_params) actual_component = pydash.omit( @@ -818,9 +798,7 @@ def test_distribution_resources_default_val(self, test_command_params): test_command_params.update( { "distribution": MpiDistribution(process_count_per_instance=2), - "resources": JobResourceConfiguration( - instance_count=2, instance_type="STANDARD_D2" - ), + "resources": JobResourceConfiguration(instance_count=2, instance_type="STANDARD_D2"), } ) command_func = command(**test_command_params) @@ -844,9 +822,7 @@ def test_resources_from_dict(self, test_command_params): expected_resources = {"instance_count": 4, "instance_type": "STANDARD_D2"} test_command_params.update( { - "resources": JobResourceConfiguration( - instance_count=4, instance_type="STANDARD_D2" - ), + "resources": JobResourceConfiguration(instance_count=4, instance_type="STANDARD_D2"), } ) command_node = command(**test_command_params) @@ -864,9 +840,7 @@ def test_resources_from_dict(self, test_command_params): test_command_params.update( { - "resources": dict( - instance_count=4, instance_type="STANDARD_D2", unknown_field=1 - ), + "resources": dict(instance_count=4, instance_type="STANDARD_D2", unknown_field=1), } ) command_node = command(**test_command_params) @@ -920,19 +894,16 @@ def test_to_component_input(self): "str": {"default": "str", "type": "string"}, } for job_input, input_type in literal_input_2_expected_type.items(): - assert ( - ComponentTranslatableMixin._to_input(job_input, {})._to_dict() - == input_type - ) + assert ComponentTranslatableMixin._to_input(job_input, {})._to_dict() == input_type with pytest.raises(JobException) as err_info: ComponentTranslatableMixin._to_input(None, {}) - assert "'' is not supported as component input" in str( - err_info.value - ) + assert "'' is not supported as component input" in str(err_info.value) # test input binding - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" + ) job_dict = load_job(source=test_path)._to_dict() binding_2_expected_type = { "${{parent.inputs.job_data}}": {"type": "uri_folder"}, @@ -941,10 +912,7 @@ def test_to_component_input(self): } for job_input, input_type in binding_2_expected_type.items(): - assert ( - ComponentTranslatableMixin._to_input(job_input, job_dict)._to_dict() - == input_type - ) + assert ComponentTranslatableMixin._to_input(job_input, job_dict)._to_dict() == input_type def test_to_component_output(self): # test output binding @@ -958,10 +926,7 @@ def test_to_component_output(self): } for job_output, input_type in binding_2_expected_type.items(): - assert ( - ComponentTranslatableMixin._to_output(job_output, job_dict)._to_dict() - == input_type - ) + assert ComponentTranslatableMixin._to_output(job_output, job_dict)._to_dict() == input_type def test_spark_job_with_dynamic_allocation_disabled(self): node = spark( @@ -978,9 +943,7 @@ def test_spark_job_with_dynamic_allocation_disabled(self): ) result = node._validate() message = "Should not specify min or max executors when dynamic allocation is disabled." - assert ( - "conf" in result.error_messages and message == result.error_messages["conf"] - ) + assert "conf" in result.error_messages and message == result.error_messages["conf"] def test_executor_instances_is_mandatory_when_dynamic_allocation_disabled(self): node = spark( @@ -997,9 +960,7 @@ def test_executor_instances_is_mandatory_when_dynamic_allocation_disabled(self): "spark.driver.cores, spark.driver.memory, spark.executor.cores, spark.executor.memory and " "spark.executor.instances are mandatory fields." ) - assert ( - "conf" in result.error_messages and message == result.error_messages["conf"] - ) + assert "conf" in result.error_messages and message == result.error_messages["conf"] def test_executor_instances_is_specified_as_min_executor_if_unset(self): node = spark( @@ -1036,9 +997,7 @@ def test_excutor_instances_throw_error_when_out_of_range(self): "Executor instances must be a valid non-negative integer and must be between " "spark.dynamicAllocation.minExecutors and spark.dynamicAllocation.maxExecutors" ) - assert ( - "conf" in result.error_messages and message == result.error_messages["conf"] - ) + assert "conf" in result.error_messages and message == result.error_messages["conf"] def test_spark_job_with_additional_conf(self): node = spark( @@ -1088,14 +1047,10 @@ def test_command_services_nodes(self) -> None: ) rest_obj = command_obj._to_rest_object() - assert rest_obj["services"]["my_jupyterlab"].get("nodes") == { - "nodes_value_type": "All" - } + assert rest_obj["services"]["my_jupyterlab"].get("nodes") == {"nodes_value_type": "All"} assert rest_obj["services"]["my_tensorboard"].get("nodes") == None - with pytest.raises( - ValidationException, match="nodes should be either 'all' or None" - ): + with pytest.raises(ValidationException, match="nodes should be either 'all' or None"): services_invalid_nodes = {"my_service": JobService(nodes="All")} def test_command_services(self) -> None: @@ -1213,12 +1168,8 @@ def test_command_services_subtypes(self) -> None: command_job_services = node._to_job().services assert isinstance(command_job_services.get("my_ssh"), SshJobService) - assert isinstance( - command_job_services.get("my_tensorboard"), TensorBoardJobService - ) - assert isinstance( - command_job_services.get("my_jupyterlab"), JupyterLabJobService - ) + assert isinstance(command_job_services.get("my_tensorboard"), TensorBoardJobService) + assert isinstance(command_job_services.get("my_jupyterlab"), JupyterLabJobService) assert isinstance(command_job_services.get("my_vscode"), VsCodeJobService) node_rest_obj = node._to_rest_object() @@ -1230,9 +1181,7 @@ def test_command_hash(self, test_command_params): assert hash(node1) == hash(node2) assert node1 == node2 - component_func = load_component( - "./tests/test_configs/components/helloworld_component_no_paths.yml" - ) + component_func = load_component("./tests/test_configs/components/helloworld_component_no_paths.yml") node3 = component_func() node4 = component_func() assert hash(node3) == hash(node4) @@ -1253,9 +1202,7 @@ def my_pipeline(): pipeline_job = my_pipeline() omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard( - pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields - ) + actual_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields) assert actual_dict["jobs"] == { "my_job": { @@ -1314,9 +1261,7 @@ def test_sweep_set_search_space(self, test_command): goal="maximize", sampling_algorithm="random", ) - sweep_node_1.search_space = { - "batch_size": {"type": "choice", "values": [25, 35]} - } + sweep_node_1.search_space = {"batch_size": {"type": "choice", "values": [25, 35]}} command_node_to_sweep_2 = node1() sweep_node_2 = command_node_to_sweep_2.sweep( diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index d77ffc5dc419..c5f791d6a1ea 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -59,19 +59,13 @@ def load_pipeline_entity_from_rest_json(job_dict) -> PipelineJob: @pytest.mark.unittest @pytest.mark.pipeline_test class TestPipelineJobEntity: - def test_automl_node_in_pipeline_regression( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_automl_node_in_pipeline_regression(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_regression.yml" # overwrite some fields to data bindings to make sure it's supported params_override = [ - { - "jobs.hello_automl_regression.primary_metric": "${{parent.inputs.primary_metric}}" - }, - { - "jobs.hello_automl_regression.limits.max_trials": "${{parent.inputs.max_trials}}" - }, + {"jobs.hello_automl_regression.primary_metric": "${{parent.inputs.primary_metric}}"}, + {"jobs.hello_automl_regression.limits.max_trials": "${{parent.inputs.max_trials}}"}, ] def simple_job_validation(job): @@ -79,9 +73,9 @@ def simple_job_validation(job): node = next(iter(job.jobs.values())) assert isinstance(node, RegressionJob) - job = verify_entity_load_and_dump( - load_job, simple_job_validation, test_path, params_override=params_override - )[0] + job = verify_entity_load_and_dump(load_job, simple_job_validation, test_path, params_override=params_override)[ + 0 + ] mocker.patch( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", @@ -95,9 +89,7 @@ def simple_job_validation(job): rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["hello_automl_regression"], omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["hello_automl_regression"], omit_fields) expected_dict = { "featurization": {"mode": "off"}, @@ -122,13 +114,9 @@ def simple_job_validation(job): # same regression node won't load as AutoMLRegressionSchema since there's data binding with pytest.raises(ValidationError) as e: AutoMLRegressionSchema(context={"base_path": "./"}).load(expected_dict) - assert "Value '${{parent.inputs.primary_metric}}' passed is not in set" in str( - e.value - ) + assert "Value '${{parent.inputs.primary_metric}}' passed is not in set" in str(e.value) - def test_automl_node_in_pipeline_classification( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_automl_node_in_pipeline_classification(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_classification.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) @@ -167,9 +155,7 @@ def test_automl_node_in_pipeline_classification( "validation_data": "${{parent.inputs.classification_validate_data}}", } - def test_automl_node_in_pipeline_forecasting( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_automl_node_in_pipeline_forecasting(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_forecasting.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) @@ -187,9 +173,7 @@ def test_automl_node_in_pipeline_forecasting( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["hello_automl_forecasting"], omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["hello_automl_forecasting"], omit_fields) assert actual_dict == { "limits": {"max_concurrent_trials": 1, "max_trials": 1}, @@ -234,9 +218,7 @@ def test_automl_job_in_pipeline_deserialize(self, rest_job_file, node_name): pipeline = load_pipeline_entity_from_rest_json(job_dict) assert isinstance(pipeline, PipelineJob) expected_automl_job = job_dict["properties"]["jobs"][node_name] - actual_automl_job = pipeline._to_rest_object().as_dict()["properties"]["jobs"][ - node_name - ] + actual_automl_job = pipeline._to_rest_object().as_dict()["properties"]["jobs"][node_name] assert actual_automl_job == expected_automl_job @pytest.mark.parametrize( @@ -245,9 +227,7 @@ def test_automl_job_in_pipeline_deserialize(self, rest_job_file, node_name): "./tests/test_configs/pipeline_jobs/invalid_pipeline_job_without_jobs.json", ], ) - def test_invalid_pipeline_jobs_descerialize( - self, invalid_pipeline_job_without_jobs - ): + def test_invalid_pipeline_jobs_descerialize(self, invalid_pipeline_job_without_jobs): with open(invalid_pipeline_job_without_jobs, "r") as f: job_dict = yaml.safe_load(f) pipeline = load_pipeline_entity_from_rest_json(job_dict) @@ -262,9 +242,7 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): rest_obj = RestJob.from_dict(json.loads(json.dumps(job_dict))) pipeline = PipelineJob._from_rest_object(rest_obj) pipeline_dict = pipeline._to_dict() - assert pydash.omit( - pipeline_dict["jobs"], *["properties", "hello_python_world_job.properties"] - ) == { + assert pydash.omit(pipeline_dict["jobs"], *["properties", "hello_python_world_job.properties"]) == { "hello_python_world_job": { "inputs": { "sample_input_data": { @@ -277,20 +255,14 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): "path": "${{parent.inputs.pipeline_sample_input_string}}", }, }, - "outputs": { - "sample_output_data": "${{parent.outputs.pipeline_sample_output_data}}" - }, + "outputs": {"sample_output_data": "${{parent.outputs.pipeline_sample_output_data}}"}, "component": "azureml:/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli/components/azureml_anonymous/versions/9904ff48-9cb2-4733-ad1c-eb1eb9940a19", "type": "command", "compute": "azureml:cpu-cluster", } } - assert pipeline_dict["inputs"] == { - "pipeline_sample_input_string": "Hello_Pipeline_World" - } - assert pipeline_dict["outputs"] == { - "pipeline_sample_output_data": {"mode": "upload", "type": "uri_folder"} - } + assert pipeline_dict["inputs"] == {"pipeline_sample_input_string": "Hello_Pipeline_World"} + assert pipeline_dict["outputs"] == {"pipeline_sample_output_data": {"mode": "upload", "type": "uri_folder"}} pipeline_rest_dict = pipeline._to_rest_object().as_dict() pipeline_rest_dict["properties"]["inputs"] == { @@ -335,14 +307,10 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): def test_automl_node_in_pipeline_with_binding(self): # classification node automl_classif_job = classification( - training_data=PipelineInput( - name="main_data_input", owner="pipeline", meta=None - ), + training_data=PipelineInput(name="main_data_input", owner="pipeline", meta=None), # validation_data_size=PipelineInput(name="validation_data_size", owner="pipeline", meta=None), # test_data = test_data_input # Optional, since testing is explicit below with TEST COMPONENT - target_column_name=PipelineInput( - name="target_column_name_input", owner="pipeline", meta=None - ), + target_column_name=PipelineInput(name="target_column_name_input", owner="pipeline", meta=None), # primary_metric=PipelineInput(name="primary_metric", owner="pipeline", meta=None), enable_model_explainability=True, ) @@ -364,9 +332,7 @@ def test_automl_node_in_pipeline_with_binding(self): "type": "automl", } - def test_pipeline_job_automl_regression_output( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_pipeline_job_automl_regression_output(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/automl_regression_with_command_node.yml" pipeline: PipelineJob = load_job(source=test_path) @@ -378,9 +344,7 @@ def test_pipeline_job_automl_regression_output( "azure.ai.ml.operations._job_operations._upload_and_generate_remote_uri", return_value="yyy", ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( - pipeline - ) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline) pipeline_dict = pipeline._to_rest_object().as_dict() @@ -393,9 +357,7 @@ def test_pipeline_job_automl_regression_output( "properties", ] - automl_actual_dict = pydash.omit( - pipeline_dict["properties"]["jobs"]["regression_node"], fields_to_omit - ) + automl_actual_dict = pydash.omit(pipeline_dict["properties"]["jobs"]["regression_node"], fields_to_omit) assert automl_actual_dict == { "featurization": {"mode": "off"}, @@ -411,9 +373,7 @@ def test_pipeline_job_automl_regression_output( "type": "automl", } - command_actual_dict = pydash.omit( - pipeline_dict["properties"]["jobs"]["command_node"], fields_to_omit - ) + command_actual_dict = pydash.omit(pipeline_dict["properties"]["jobs"]["command_node"], fields_to_omit) assert command_actual_dict == { "_source": "YAML.JOB", @@ -470,7 +430,9 @@ def test_automl_node_in_pipeline_text_classification( def test_automl_node_in_pipeline_text_classification_multilabel( self, mock_machinelearning_client: MLClient, mocker: MockFixture ): - test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_text_classification_multilabel.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_text_classification_multilabel.yml" + ) job = load_job(source=test_path) assert isinstance(job, PipelineJob) node = next(iter(job.jobs.values())) @@ -488,9 +450,7 @@ def test_automl_node_in_pipeline_text_classification_multilabel( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"][ - "automl_text_classification_multilabel" - ], + rest_job_dict["properties"]["jobs"]["automl_text_classification_multilabel"], omit_fields, ) @@ -507,9 +467,7 @@ def test_automl_node_in_pipeline_text_classification_multilabel( "type": "automl", } - def test_automl_node_in_pipeline_text_ner( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_automl_node_in_pipeline_text_ner(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_text_ner.yml" job = load_job(source=test_path) assert isinstance(job, PipelineJob) @@ -527,9 +485,7 @@ def test_automl_node_in_pipeline_text_ner( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["automl_text_ner"], omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["automl_text_ner"], omit_fields) assert actual_dict == { "limits": {"max_trials": 1, "timeout_minutes": 60, "max_nodes": 1}, @@ -556,12 +512,8 @@ def test_automl_node_in_pipeline_image_multiclass_classification( test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_multiclass_classification"][ - "search_space" - ] - del test_config["jobs"]["hello_automl_image_multiclass_classification"][ - "sweep" - ] + del test_config["jobs"]["hello_automl_image_multiclass_classification"]["search_space"] + del test_config["jobs"]["hello_automl_image_multiclass_classification"]["sweep"] test_yaml_file = tmp_path / "job.yml" dump_yaml_to_file(test_yaml_file, test_config) @@ -582,9 +534,7 @@ def test_automl_node_in_pipeline_image_multiclass_classification( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"][ - "hello_automl_image_multiclass_classification" - ], + rest_job_dict["properties"]["jobs"]["hello_automl_image_multiclass_classification"], omit_fields, ) @@ -647,12 +597,8 @@ def test_automl_node_in_pipeline_image_multilabel_classification( test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_multilabel_classification"][ - "search_space" - ] - del test_config["jobs"]["hello_automl_image_multilabel_classification"][ - "sweep" - ] + del test_config["jobs"]["hello_automl_image_multilabel_classification"]["search_space"] + del test_config["jobs"]["hello_automl_image_multilabel_classification"]["sweep"] test_yaml_file = tmp_path / "job.yml" dump_yaml_to_file(test_yaml_file, test_config) @@ -673,9 +619,7 @@ def test_automl_node_in_pipeline_image_multilabel_classification( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"][ - "hello_automl_image_multilabel_classification" - ], + rest_job_dict["properties"]["jobs"]["hello_automl_image_multilabel_classification"], omit_fields, ) @@ -738,9 +682,7 @@ def test_automl_node_in_pipeline_image_object_detection( test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_object_detection"][ - "search_space" - ] + del test_config["jobs"]["hello_automl_image_object_detection"]["search_space"] del test_config["jobs"]["hello_automl_image_object_detection"]["sweep"] test_yaml_file = tmp_path / "job.yml" @@ -821,14 +763,14 @@ def test_automl_node_in_pipeline_image_instance_segmentation( run_type: str, tmp_path: Path, ): - test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_image_instance_segmentation.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_image_instance_segmentation.yml" + ) test_config = load_yaml(test_path) if (run_type == "single") or (run_type == "automode"): # Remove search_space and sweep sections from the config - del test_config["jobs"]["hello_automl_image_instance_segmentation"][ - "search_space" - ] + del test_config["jobs"]["hello_automl_image_instance_segmentation"]["search_space"] del test_config["jobs"]["hello_automl_image_instance_segmentation"]["sweep"] test_yaml_file = tmp_path / "job.yml" @@ -850,9 +792,7 @@ def test_automl_node_in_pipeline_image_instance_segmentation( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["name", "display_name", "experiment_name", "properties"] actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"][ - "hello_automl_image_instance_segmentation" - ], + rest_job_dict["properties"]["jobs"]["hello_automl_image_instance_segmentation"], omit_fields, ) @@ -903,12 +843,8 @@ def test_automl_node_in_pipeline_image_instance_segmentation( del expected_dict["sweep"] assert actual_dict == expected_dict - def test_spark_node_in_pipeline( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): - test_path = ( - "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" - ) + def test_spark_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + test_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" job = load_job(test_path) assert isinstance(job, PipelineJob) @@ -926,12 +862,8 @@ def test_spark_node_in_pipeline( mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(job) rest_job_dict = job._to_rest_object().as_dict() - omit_fields = [ - "properties" - ] # "name", "display_name", "experiment_name", "properties" - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["add_greeting_column"], omit_fields - ) + omit_fields = ["properties"] # "name", "display_name", "experiment_name", "properties" + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["add_greeting_column"], omit_fields) expected_dict = { "_source": "YAML.COMPONENT", @@ -967,9 +899,7 @@ def test_spark_node_in_pipeline( } assert actual_dict == expected_dict - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["count_by_row"], omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["count_by_row"], omit_fields) expected_dict = { "_source": "YAML.COMPONENT", @@ -997,9 +927,7 @@ def test_spark_node_in_pipeline( }, "jars": ["scalaproj.jar"], "name": "count_by_row", - "outputs": { - "output": {"type": "literal", "value": "${{parent.outputs.output}}"} - }, + "outputs": {"output": {"type": "literal", "value": "${{parent.outputs.output}}"}}, "resources": { "instance_type": "standard_e4s_v3", "runtime_version": "3.4.0", @@ -1008,9 +936,7 @@ def test_spark_node_in_pipeline( } assert actual_dict == expected_dict - def test_data_transfer_copy_node_in_pipeline( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_data_transfer_copy_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/data_transfer/copy_files.yaml" job = load_job(test_path) @@ -1033,9 +959,7 @@ def test_data_transfer_copy_node_in_pipeline( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["properties"] - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["copy_files"], *omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["copy_files"], *omit_fields) expected_dict = { "_source": "YAML.COMPONENT", @@ -1060,9 +984,7 @@ def test_data_transfer_copy_node_in_pipeline( } assert actual_dict == expected_dict - def test_data_transfer_merge_node_in_pipeline( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_data_transfer_merge_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/data_transfer/merge_files.yaml" job = load_job(test_path) @@ -1085,9 +1007,7 @@ def test_data_transfer_merge_node_in_pipeline( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["properties"] - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["merge_files"], *omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["merge_files"], *omit_fields) expected_dict = { "_source": "YAML.COMPONENT", @@ -1119,9 +1039,7 @@ def test_data_transfer_merge_node_in_pipeline( def test_inline_data_transfer_merge_node_in_pipeline( self, mock_machinelearning_client: MLClient, mocker: MockFixture ): - test_path = ( - "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" - ) + test_path = "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" job = load_job(test_path) assert isinstance(job, PipelineJob) @@ -1143,9 +1061,7 @@ def test_inline_data_transfer_merge_node_in_pipeline( rest_job_dict = job._to_rest_object().as_dict() omit_fields = ["properties"] - actual_dict = pydash.omit( - rest_job_dict["properties"]["jobs"]["merge_files_job"], *omit_fields - ) + actual_dict = pydash.omit(rest_job_dict["properties"]["jobs"]["merge_files_job"], *omit_fields) expected_dict = { "data_copy_mode": "merge_with_overwrite", @@ -1201,9 +1117,7 @@ def test_inline_data_transfer_import_database_node_in_pipeline( "properties.jobs.snowflake_blob.componentId", "properties.jobs.snowflake_blob_node_input.componentId", ] - rest_job_dict = pydash.omit( - as_attribute_dict(job._to_rest_object()), *omit_fields - ) + rest_job_dict = pydash.omit(as_attribute_dict(job._to_rest_object()), *omit_fields) assert rest_job_dict == { "properties": { @@ -1292,9 +1206,7 @@ def test_inline_data_transfer_import_stored_database_node_in_pipeline( omit_fields = [ "properties.jobs.snowflake_blob.componentId", ] - rest_job_dict = pydash.omit( - as_attribute_dict(job._to_rest_object()), *omit_fields - ) + rest_job_dict = pydash.omit(as_attribute_dict(job._to_rest_object()), *omit_fields) assert rest_job_dict == { "properties": { @@ -1364,9 +1276,7 @@ def test_inline_data_transfer_import_file_system_node_in_pipeline( "properties.jobs.s3_blob.componentId", "properties.jobs.s3_blob_input.componentId", ] - rest_job_dict = pydash.omit( - as_attribute_dict(job._to_rest_object()), *omit_fields - ) + rest_job_dict = pydash.omit(as_attribute_dict(job._to_rest_object()), *omit_fields) assert rest_job_dict == { "properties": { @@ -1457,9 +1367,7 @@ def test_inline_data_transfer_export_database_node_in_pipeline( "properties.jobs.blob_azuresql.componentId", "properties.jobs.blob_azuresql_node_input.componentId", ] - rest_job_dict = pydash.omit( - as_attribute_dict(job._to_rest_object()), *omit_fields - ) + rest_job_dict = pydash.omit(as_attribute_dict(job._to_rest_object()), *omit_fields) assert rest_job_dict == { "properties": { @@ -1497,9 +1405,7 @@ def test_inline_data_transfer_export_database_node_in_pipeline( "blob_azuresql_node_input": { "_source": "BUILTIN", "computeId": "", - "inputs": { - "source": {"job_input_type": "uri_file", "uri": "yyy"} - }, + "inputs": {"source": {"job_input_type": "uri_file", "uri": "yyy"}}, "name": "blob_azuresql_node_input", "sink": { "connection": "azureml:my_export_azuresqldb_connection", @@ -1521,9 +1427,7 @@ def test_inline_data_transfer_export_database_node_in_pipeline( } } - def test_data_transfer_multi_node_in_pipeline( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_data_transfer_multi_node_in_pipeline(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/data_transfer/pipeline_with_mutil_task.yaml" job = load_job(test_path) @@ -1558,9 +1462,7 @@ def test_data_transfer_multi_node_in_pipeline( "path_source_s3": {"job_input_type": "literal", "value": "test1/*"}, "query_source_sql": { "job_input_type": "literal", - "value": "select top(10) Name " - "from " - "SalesLT.ProductCategory", + "value": "select top(10) Name " "from " "SalesLT.ProductCategory", }, }, "is_archived": False, @@ -1569,9 +1471,7 @@ def test_data_transfer_multi_node_in_pipeline( "blob_azuresql": { "_source": "BUILTIN", "computeId": "", - "inputs": { - "source": {"job_input_type": "uri_file", "uri": "yyy"} - }, + "inputs": {"source": {"job_input_type": "uri_file", "uri": "yyy"}}, "name": "blob_azuresql", "sink": { "connection": "azureml:my_export_azuresqldb_connection", @@ -1652,9 +1552,7 @@ def test_default_user_identity_if_empty_identity_input(self): "jobs.sample_word.properties", "jobs.count_word.properties", ] - actual_job = pydash.omit( - as_attribute_dict(job._to_rest_object().properties), *omit_fields - ) + actual_job = pydash.omit(as_attribute_dict(job._to_rest_object().properties), *omit_fields) assert actual_job == { "description": "submit a shakespear sample and word spark job in pipeline", "inputs": { @@ -1753,8 +1651,7 @@ def test_spark_node_in_pipeline_with_dynamic_allocation_disabled( job: PipelineJob = load_job(test_path) result = job._validate() assert ( - result.error_messages["jobs.hello_world.conf"] - == "Should not specify min or max executors when " + result.error_messages["jobs.hello_world.conf"] == "Should not specify min or max executors when " "dynamic allocation is disabled." ) @@ -1809,9 +1706,7 @@ def test_spark_node_with_remote_component_in_pipeline( } }, "name": "kmeans_cluster", - "outputs": { - "output": {"type": "literal", "value": "${{parent.outputs.output}}"} - }, + "outputs": {"output": {"type": "literal", "value": "${{parent.outputs.output}}"}}, "resources": { "instance_type": "standard_e4s_v3", "runtime_version": "3.4.0", @@ -1857,9 +1752,7 @@ def test_spark_node_with_remote_component_in_pipeline( ), ], ) - def test_spark_node_in_pipeline_with_invalid_input_outputs_mode( - self, test_path: str, error_messages: dict - ): + def test_spark_node_in_pipeline_with_invalid_input_outputs_mode(self, test_path: str, error_messages: dict): job = load_job(test_path) result = job._validate() for key, value in error_messages.items(): @@ -1873,9 +1766,7 @@ def test_infer_pipeline_output_type_as_node_type( source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_with_parallel_job_tabular_input_e2e.yml", ) assert ( - pipeline_job.jobs["hello_world_inline_parallel_tabular_job_1"] - .outputs["job_output_file"] - .type + pipeline_job.jobs["hello_world_inline_parallel_tabular_job_1"].outputs["job_output_file"].type == AssetTypes.URI_FILE ) @@ -1953,28 +1844,20 @@ def test_pipeline_job_with_inline_command_job_input_binding_to_registered_compon ) actual_type = pipeline_job.jobs["score_job"].inputs.model_input.type assert actual_type == expected_type - actual_type = ( - pipeline_job.jobs["score_job"].component.inputs["model_input"].type - ) + actual_type = pipeline_job.jobs["score_job"].component.inputs["model_input"].type assert actual_type == expected_type # check component of pipeline job is expected for name, expected_dict in expected_components.items(): - actual_dict = as_attribute_dict( - pipeline_job.jobs[name].component._to_rest_object() - ) + actual_dict = as_attribute_dict(pipeline_job.jobs[name].component._to_rest_object()) omit_fields = [ "name", ] - actual_dict = pydash.omit( - actual_dict["properties"]["component_spec"], omit_fields - ) + actual_dict = pydash.omit(actual_dict["properties"]["component_spec"], omit_fields) assert actual_dict == expected_dict - def test_pipeline_without_setting_binding_node( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_pipeline_without_setting_binding_node(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/dsl_pipeline/pipeline_with_set_binding_output_input/pipeline_without_setting_binding_node.yml" job = load_job(source=test_path) @@ -2112,17 +1995,13 @@ def test_pipeline_with_only_setting_pipeline_level( "componentId": "xxx", } }, - "outputs": { - "trained_model": {"job_output_type": "uri_folder", "mode": "Upload"} - }, + "outputs": {"trained_model": {"job_output_type": "uri_folder", "mode": "Upload"}}, "settings": { "_source": "YAML.JOB", }, } - def test_pipeline_with_only_setting_binding_node( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): + def test_pipeline_with_only_setting_binding_node(self, mock_machinelearning_client: MLClient, mocker: MockFixture): test_path = "./tests/test_configs/dsl_pipeline/pipeline_with_set_binding_output_input/pipeline_with_only_setting_binding_node.yml" job = load_job(source=test_path) @@ -2138,9 +2017,7 @@ def test_pipeline_with_only_setting_binding_node( actual_dict = as_attribute_dict(job._to_rest_object())["properties"] - assert pydash.omit( - actual_dict, *["properties", "jobs.train_job.properties"] - ) == { + assert pydash.omit(actual_dict, *["properties", "jobs.train_job.properties"]) == { "tags": {}, "is_archived": False, "compute_id": "xxx", @@ -2215,9 +2092,7 @@ def test_pipeline_with_setting_binding_node_and_pipeline_level( actual_dict = as_attribute_dict(job._to_rest_object())["properties"] - assert pydash.omit( - actual_dict, *["properties", "jobs.train_job.properties"] - ) == { + assert pydash.omit(actual_dict, *["properties", "jobs.train_job.properties"]) == { "tags": {}, "is_archived": False, "compute_id": "xxx", @@ -2298,9 +2173,7 @@ def test_pipeline_with_inline_job_setting_binding_node_and_pipeline_level( actual_dict = as_attribute_dict(job._to_rest_object())["properties"] - assert pydash.omit( - actual_dict, *["properties", "jobs.train_job.properties"] - ) == { + assert pydash.omit(actual_dict, *["properties", "jobs.train_job.properties"]) == { "tags": {}, "is_archived": False, "compute_id": "xxx", @@ -2364,9 +2237,7 @@ def test_pipeline_with_inline_job_setting_binding_node_and_pipeline_level( } def test_pipeline_job_with_parameter_group(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/pipeline_job_with_parameter_group.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/pipeline_job_with_parameter_group.yml" job: PipelineJob = load_job(test_path) assert isinstance(job.inputs.group, _GroupAttrDict) job.inputs.group.int_param = 5 @@ -2380,19 +2251,11 @@ def test_pipeline_job_with_parameter_group(self): "group.sub_group.bool_param": 1, } assert job_dict["jobs"]["hello_world_component_1"]["inputs"] == { - "component_in_string": { - "path": "${{parent.inputs.group.sub_group.str_param}}" - }, - "component_in_ranged_integer": { - "path": "${{parent.inputs.group.int_param}}" - }, + "component_in_string": {"path": "${{parent.inputs.group.sub_group.str_param}}"}, + "component_in_ranged_integer": {"path": "${{parent.inputs.group.int_param}}"}, "component_in_enum": {"path": "${{parent.inputs.group.enum_param}}"}, - "component_in_boolean": { - "path": "${{parent.inputs.group.sub_group.bool_param}}" - }, - "component_in_ranged_number": { - "path": "${{parent.inputs.group.number_param}}" - }, + "component_in_boolean": {"path": "${{parent.inputs.group.sub_group.bool_param}}"}, + "component_in_ranged_number": {"path": "${{parent.inputs.group.number_param}}"}, } rest_job = as_attribute_dict(job._to_rest_object())["properties"] assert rest_job["inputs"] == { @@ -2429,9 +2292,7 @@ def test_pipeline_job_with_parameter_group(self): } def test_non_string_pipeline_node_input(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/rest_non_string_input_pipeline.json" - ) + test_path = "./tests/test_configs/pipeline_jobs/rest_non_string_input_pipeline.json" with open(test_path, "r") as f: job_dict = yaml.safe_load(f) pipeline = load_pipeline_entity_from_rest_json(job_dict) @@ -2442,9 +2303,7 @@ def test_non_string_pipeline_node_input(self): "max_depth": "3", "min_child_samples": "20", "num_leaves": "31", - "rai_insights_dashboard": { - "path": "${{parent.jobs.create_rai_job.outputs.rai_insights_dashboard}}" - }, + "rai_insights_dashboard": {"path": "${{parent.jobs.create_rai_job.outputs.rai_insights_dashboard}}"}, } rest_pipeline_dict = pipeline._to_rest_object().as_dict() rest_node_dict = pydash.omit_by( @@ -2473,9 +2332,7 @@ def test_job_properties(self): ) pipeline_dict = pipeline_job._to_dict() rest_pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] - assert pipeline_dict["properties"] == { - "AZURE_ML_PathOnCompute_input_data": "/tmp/test" - } + assert pipeline_dict["properties"] == {"AZURE_ML_PathOnCompute_input_data": "/tmp/test"} assert rest_pipeline_dict["properties"] == pipeline_dict["properties"] for name, node_dict in pipeline_dict["jobs"].items(): rest_node_dict = rest_pipeline_dict["jobs"][name] @@ -2484,19 +2341,11 @@ def test_job_properties(self): assert node_dict["properties"] == rest_node_dict["properties"] def test_comment_in_pipeline(self) -> None: - pipeline_job = load_job( - source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_comment.yml" - ) + pipeline_job = load_job(source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_comment.yml") pipeline_dict = pipeline_job._to_dict() rest_pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] - assert ( - pipeline_dict["jobs"]["hello_world_component"]["comment"] - == "arbitrary string" - ) - assert ( - rest_pipeline_dict["jobs"]["hello_world_component"]["comment"] - == "arbitrary string" - ) + assert pipeline_dict["jobs"]["hello_world_component"]["comment"] == "arbitrary string" + assert rest_pipeline_dict["jobs"]["hello_world_component"]["comment"] == "arbitrary string" def test_pipeline_node_default_output(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_component_output.yml" @@ -2509,21 +2358,15 @@ def test_pipeline_node_default_output(self): # other node level output tests can be found in # dsl/unittests/test_component_func.py::TestComponentFunc::test_component_outputs # data-binding-expression - with pytest.raises( - ValidationException, match=" does not support setting path." - ): - pipeline.jobs["merge_component_outputs"].outputs[ - "component_out_path_1" - ].path = "xxx" + with pytest.raises(ValidationException, match=" does not support setting path."): + pipeline.jobs["merge_component_outputs"].outputs["component_out_path_1"].path = "xxx" def test_pipeline_node_with_identity(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_identity.yml" pipeline_job: PipelineJob = load_job(source=test_path) omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard( - pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields - ) + actual_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict()["properties"], *omit_fields) assert actual_dict["jobs"] == { "hello_world_component": { "computeId": "cpu-cluster", @@ -2580,9 +2423,7 @@ def test_pipeline_node_with_identity(self): reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes", ) def test_pipeline_parameter_with_empty_value(self, client: MLClient) -> None: - input_types_func = load_component( - source="./tests/test_configs/components/input_types_component.yml" - ) + input_types_func = load_component(source="./tests/test_configs/components/input_types_component.yml") @group class InputGroup: @@ -2633,17 +2474,13 @@ def empty_value_pipeline( reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes", ) def test_pipeline_input_as_runsettings_value(self, client: MLClient) -> None: - input_types_func = load_component( - source="./tests/test_configs/components/input_types_component.yml" - ) + input_types_func = load_component(source="./tests/test_configs/components/input_types_component.yml") @dsl.pipeline( default_compute="cpu-cluster", description="Set pipeline input to runsettings", ) - def empty_value_pipeline( - integer: int, boolean: bool, number: float, str_param: str, shm_size: str - ): + def empty_value_pipeline(integer: int, boolean: bool, number: float, str_param: str, shm_size: str): component = input_types_func( component_in_string=str_param, component_in_ranged_integer=integer, @@ -2655,9 +2492,7 @@ def empty_value_pipeline( shm_size=shm_size, ) - pipeline = empty_value_pipeline( - integer=0, boolean=False, number=0, str_param="str_param", shm_size="20g" - ) + pipeline = empty_value_pipeline(integer=0, boolean=False, number=0, str_param="str_param", shm_size="20g") rest_obj = pipeline._to_rest_object() expect_resource = { "instance_count": "${{parent.inputs.integer}}", @@ -2669,12 +2504,8 @@ def test_pipeline_job_serverless_compute_with_job_tier(self) -> None: yaml_path = "./tests/test_configs/pipeline_jobs/serverless_compute/job_tier/pipeline_with_job_tier.yml" pipeline_job = load_job(yaml_path) rest_obj = pipeline_job._to_rest_object() - assert rest_obj.properties.jobs["spot_job_tier"]["queue_settings"] == { - "job_tier": "Spot" - } - assert rest_obj.properties.jobs["standard_job_tier"]["queue_settings"] == { - "job_tier": "Standard" - } + assert rest_obj.properties.jobs["spot_job_tier"]["queue_settings"] == {"job_tier": "Spot"} + assert rest_obj.properties.jobs["standard_job_tier"]["queue_settings"] == {"job_tier": "Standard"} def test_pipeline_job_sweep_with_job_tier_in_pipeline(self) -> None: yaml_path = "./tests/test_configs/pipeline_jobs/serverless_compute/job_tier/sweep_in_pipeline/pipeline.yml" @@ -2682,18 +2513,14 @@ def test_pipeline_job_sweep_with_job_tier_in_pipeline(self) -> None: # for sweep job, its job_tier value will be lowercase due to its implementation, # and service side shall accept both capital and lowercase, so it is expected for now. rest_obj = pipeline_job._to_rest_object() - assert rest_obj.properties.jobs["node"]["queue_settings"] == { - "job_tier": "standard" - } + assert rest_obj.properties.jobs["node"]["queue_settings"] == {"job_tier": "standard"} def test_pipeline_job_automl_with_job_tier_in_pipeline(self) -> None: yaml_path = "./tests/test_configs/pipeline_jobs/serverless_compute/job_tier/automl_in_pipeline/pipeline.yml" pipeline_job = load_job(yaml_path) # similar to sweep job, automl job job_tier value is also lowercase. rest_obj = pipeline_job._to_rest_object() - assert rest_obj.properties.jobs["text_ner_node"]["queue_settings"] == { - "job_tier": "spot" - } + assert rest_obj.properties.jobs["text_ner_node"]["queue_settings"] == {"job_tier": "spot"} @pytest.mark.skipif( platform.python_implementation() == "PyPy", @@ -2714,9 +2541,7 @@ def pipeline_with_duplicate_output(dataset: Input, str_param: str): "output2": component.outputs.component_out_path, } - pipeline_job = pipeline_with_duplicate_output( - str_param=1, dataset=Input(path=component_path) - ) + pipeline_job = pipeline_with_duplicate_output(str_param=1, dataset=Input(path=component_path)) assert "output1" in pipeline_job.outputs assert "output2" in pipeline_job.outputs @@ -2732,20 +2557,14 @@ def test_pipeline_job_with_flow(self) -> None: test_path = "./tests/test_configs/pipeline_jobs/pipeline_job_with_flow.yml" pipeline: PipelineJob = load_job(source=test_path) - assert isinstance( - pipeline.jobs["anonymous_parallel_flow"].component, FlowComponent - ) - assert pipeline.jobs[ - "anonymous_parallel_flow" - ].component.additional_includes == [ + assert isinstance(pipeline.jobs["anonymous_parallel_flow"].component, FlowComponent) + assert pipeline.jobs["anonymous_parallel_flow"].component.additional_includes == [ "../additional_includes/convert_to_dict.py", "../additional_includes/fetch_text_content_from_url.py", "../additional_includes/summarize_text_content.jinja2", ] - assert isinstance( - pipeline.jobs["anonymous_parallel_flow_from_run"].component, FlowComponent - ) + assert isinstance(pipeline.jobs["anonymous_parallel_flow_from_run"].component, FlowComponent) dummy_component_arm_id = ( "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.MachineLearningServices/" @@ -2799,17 +2618,13 @@ def test_pipeline_job_with_flow(self) -> None: }, } - def test_pipeline_job_with_data_binding_expression_on_spark_resource( - self, mock_machinelearning_client - ): + def test_pipeline_job_with_data_binding_expression_on_spark_resource(self, mock_machinelearning_client): test_path = "tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline_with_data_binding_expression.yml" pipeline_job: PipelineJob = load_job(source=test_path) assert mock_machinelearning_client.jobs.validate(pipeline_job).passed pipeline_job_rest_object = pipeline_job._to_rest_object() - assert pipeline_job_rest_object.properties.jobs["count_by_row"][ - "resources" - ] == { + assert pipeline_job_rest_object.properties.jobs["count_by_row"]["resources"] == { "instance_type": "${{parent.inputs.instance_type}}", "runtime_version": "3.4.0", } diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py index 4caa4980b380..d02eeadee04f 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py @@ -95,9 +95,7 @@ def validator(key, assert_valid=True): validator("a.b.c0") def test_simple_deserialize(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" yaml_obj = load_yaml(test_path) job: PipelineJob = load_job(test_path) # Expected REST overrides and settings are in a JSON file "settings_overrides.json" @@ -113,19 +111,14 @@ def test_simple_deserialize(self): } assert job._build_inputs() == expected_inputs settings = job.settings._to_dict() - settings = { - k: v for k, v in settings.items() if v is not None and k != "force_rerun" - } + settings = {k: v for k, v in settings.items() if v is not None and k != "force_rerun"} assert settings == yaml_obj["settings"] # check that components were loaded correctly hello_world_component = job.jobs["hello_world_component"] rest_hello_world_component = hello_world_component._to_rest_object() hello_world_component_yaml = yaml_obj["jobs"]["hello_world_component"] assert hello_world_component_yaml["type"] == hello_world_component.type - assert ( - hello_world_component_yaml["component"][len(ARM_ID_PREFIX) :] - == hello_world_component.component - ) + assert hello_world_component_yaml["component"][len(ARM_ID_PREFIX) :] == hello_world_component.component assert rest_hello_world_component["inputs"] == { "component_in_number": { "job_input_type": "literal", @@ -136,19 +129,16 @@ def test_simple_deserialize(self): rest_hello_world_component_2 = hello_world_component_2._to_rest_object() hello_world_component_2_yaml = yaml_obj["jobs"]["hello_world_component_2"] assert hello_world_component_2_yaml["type"] == hello_world_component_2.type - assert ( - hello_world_component_2_yaml["component"][len(ARM_ID_PREFIX) :] - == hello_world_component_2.component - ) + assert hello_world_component_2_yaml["component"][len(ARM_ID_PREFIX) :] == hello_world_component_2.component assert rest_hello_world_component_2["inputs"] == { "component_in_number": { "job_input_type": "literal", "value": "${{parent.inputs.job_in_other_number}}", } } - assert expected_rest_settings_overrides["expected_rest_overrides"][ - "distribution" - ] == (as_attribute_dict(hello_world_component_2.distribution._to_rest_object())) + assert expected_rest_settings_overrides["expected_rest_overrides"]["distribution"] == ( + as_attribute_dict(hello_world_component_2.distribution._to_rest_object()) + ) assert {"FOO": "bar"} == hello_world_component_2.environment_variables assert {"nested_override": 5} == hello_world_component_2.additional_override @@ -173,17 +163,12 @@ def test_simple_deserialize(self): rest_pipeline_properties.inputs[input_name], (MLTableJobInput, UriFolderJobInput), ): - assert ( - str(input_value) - == rest_pipeline_properties.inputs[input_name].value - ) + assert str(input_value) == rest_pipeline_properties.inputs[input_name].value # Check settings assert ( rest_pipeline_properties.settings["continue_on_step_failure"] - == expected_rest_settings_overrides["expected_rest_settings"][ - "continue_on_step_failure" - ] + == expected_rest_settings_overrides["expected_rest_settings"]["continue_on_step_failure"] ) # Check that components were properly serialized: @@ -193,10 +178,7 @@ def test_simple_deserialize(self): assert job_name in rest_pipeline_properties.jobs rest_component_job = rest_pipeline_properties.jobs[job_name] if "component" in rest_pipeline_properties.jobs[job_name]: - assert ( - component_job["component"][len(ARM_ID_PREFIX) :] - == rest_component_job["componentId"] - ) + assert component_job["component"][len(ARM_ID_PREFIX) :] == rest_component_job["componentId"] # Check the inputs are properly placed rest_component_job_inputs = rest_component_job["inputs"] for input_name, input_value in component_job["inputs"].items(): @@ -205,30 +187,18 @@ def test_simple_deserialize(self): # If given input is a literal assert input_name in rest_component_job_inputs # If the given input is a literal value - assert rest_component_job_inputs[input_name].data.value == str( - input_value - ) + assert rest_component_job_inputs[input_name].data.value == str(input_value) overrides = component_job.get("overrides", None) if overrides: assert rest_component_job["overrides"] - assert ( - expected_rest_settings_overrides["expected_rest_overrides"] - == rest_component_job["overrides"] - ) + assert expected_rest_settings_overrides["expected_rest_overrides"] == rest_component_job["overrides"] # Check that the compute is properly serialized if "component" in rest_component_job: assert rest_component_job["computeId"] - assert ( - rest_component_job["computeId"] - == component_job["compute"][len(ARM_ID_PREFIX) :] - ) + assert rest_component_job["computeId"] == component_job["compute"][len(ARM_ID_PREFIX) :] - def test_pipeline_job_settings_compute_dump( - self, mock_machinelearning_client: MLClient - ): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" - ) + def test_pipeline_job_settings_compute_dump(self, mock_machinelearning_client: MLClient): + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" job = load_job(test_path) job.settings.default_compute = "cpu-cluster" dump_str = StringIO() @@ -261,22 +231,16 @@ def test_sweep_node(self): ), ]: loaded_value = pydash.get(pipeline_dict, key, None) - assert ( - loaded_value == expected_value - ), f"{key} isn't as expected: {loaded_value} != {expected_value}" + assert loaded_value == expected_value, f"{key} isn't as expected: {loaded_value} != {expected_value}" def test_literal_inputs_fidelity_in_yaml_dump(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" job = load_job(test_path) reconstructed_yaml = job._to_dict() assert reconstructed_yaml["inputs"] == job._build_inputs() - def test_pipeline_job_with_inputs( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ) -> None: + def test_pipeline_job_with_inputs(self, mock_machinelearning_client: MLClient, mocker: MockFixture) -> None: test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_data_options_no_outputs.yml" yaml_obj = load_yaml(test_path) job = load_job(test_path) @@ -328,14 +292,9 @@ def test_pipeline_job_with_inputs( if from_rest_input.mode is None: assert input_value.mode is None else: - assert ( - from_rest_input.mode - == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] - ) + assert from_rest_input.mode == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] - def test_pipeline_job_with_inputs_dataset( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ) -> None: + def test_pipeline_job_with_inputs_dataset(self, mock_machinelearning_client: MLClient, mocker: MockFixture) -> None: test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_dataset_options_no_outputs.yml" yaml_obj = load_yaml(test_path) job = load_job(test_path) # type: PipelineJob @@ -345,9 +304,7 @@ def test_pipeline_job_with_inputs_dataset( job_obj_input = job.inputs.get(input_name, None) assert job_obj_input is not None assert isinstance(job_obj_input, PipelineInput) - assert isinstance(job_obj_input._data, Input) or isinstance( - job_obj_input._data, Input - ) + assert isinstance(job_obj_input._data, Input) or isinstance(job_obj_input._data, Input) # "Upload" the depedencies so that the dataset serialization behavior can be verified mocker.patch( @@ -366,10 +323,7 @@ def test_pipeline_job_with_inputs_dataset( # TODO: https://msdata.visualstudio.com/Vienna/_workitems/edit/1318153/ For now, check that mode is present until new delivery types are supported. # yaml_input_mode = input_value.get("mode", InputDataDeliveryMode.READ_WRITE_MOUNT) if rest_input.mode: - assert ( - INPUT_MOUNT_MAPPING_FROM_REST[rest_input.mode] - == job.inputs[input_name]._data.mode - ) + assert INPUT_MOUNT_MAPPING_FROM_REST[rest_input.mode] == job.inputs[input_name]._data.mode else: assert job.inputs[input_name]._data.mode is None @@ -390,10 +344,7 @@ def test_pipeline_job_with_inputs_dataset( if from_rest_input.mode is None: assert input_value.mode is None else: - assert ( - from_rest_input.mode - == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] - ) + assert from_rest_input.mode == INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] def test_pipeline_job_components_with_inputs( self, mock_machinelearning_client: MLClient, mocker: MockFixture @@ -409,9 +360,7 @@ def test_pipeline_job_components_with_inputs( for input_name, input_value in job_value["inputs"].items(): job_input = job_obj.inputs[input_name]._to_job_input() if isinstance(input_value, str): - if isinstance(job_input, Input) and is_data_binding_expression( - job_input.path - ): + if isinstance(job_input, Input) and is_data_binding_expression(job_input.path): job_input = job_input.path assert isinstance(job_input, str) else: @@ -432,10 +381,7 @@ def test_pipeline_job_components_with_inputs( "value": "${{parent.inputs.inputvalue}}", } } - assert ( - rest_job.properties.jobs["multiple_data_component"]["inputs"] - == expected_inputs - ) + assert rest_job.properties.jobs["multiple_data_component"]["inputs"] == expected_inputs # Test that translating from REST preserves the inputs for each job. In this case, they are all bindings from_rest_job = PipelineJob._from_rest_object(rest_job) @@ -454,9 +400,7 @@ def test_pipeline_job_components_with_inline_dataset( for input_name, input_value in job_value["inputs"].items(): job_input = job_obj.inputs[input_name]._to_job_input() if isinstance(input_value, str): - if isinstance(job_input, Input) and is_data_binding_expression( - job_input.path - ): + if isinstance(job_input, Input) and is_data_binding_expression(job_input.path): job_input = job_input.path assert isinstance(job_input, str) else: @@ -612,13 +556,8 @@ def test_pipeline_component_job_with_outputs( "value": "${{parent.inputs.job_in_data_uri}}", }, } - assert ( - rest_component_jobs["multiple_data_component"]["outputs"] - == expected_outputs - ) - assert ( - rest_component_jobs["multiple_data_component"]["inputs"] == expected_inputs - ) + assert rest_component_jobs["multiple_data_component"]["outputs"] == expected_outputs + assert rest_component_jobs["multiple_data_component"]["inputs"] == expected_inputs # Check the from REST behavior from_rest_job = PipelineJob._from_rest_object(rest_job) @@ -632,18 +571,14 @@ def test_pipeline_component_job_with_outputs( assert isinstance(from_rest_output, Output) # Check that outputs were properly converted from REST format to SDK format for each ComponentJob - from_rest_component_job = from_rest_job.jobs.get( - "multiple_data_component", None - ) + from_rest_component_job = from_rest_job.jobs.get("multiple_data_component", None) assert from_rest_component_job is not None from_rest_component_job = from_rest_component_job._to_rest_object() assert from_rest_component_job["outputs"] == expected_outputs assert from_rest_component_job["inputs"] == expected_inputs - def _check_data_output_rest_formatting( - self, rest_output: RestJobOutput, yaml_output: Dict[str, Any] - ) -> None: + def _check_data_output_rest_formatting(self, rest_output: RestJobOutput, yaml_output: Dict[str, Any]) -> None: rest_output_data = rest_output.data assert rest_output_data yaml_output_data = yaml_output["data"] @@ -662,9 +597,7 @@ def _check_data_output_rest_formatting( if mode: assert rest_output_data.mode.lower() == mode.lower() - def _check_data_output_from_rest_formatting( - self, rest_output_data: RestJobOutput, from_rest_output: Input - ) -> None: + def _check_data_output_from_rest_formatting(self, rest_output_data: RestJobOutput, from_rest_output: Input) -> None: from_rest_output_data = from_rest_output.data assert from_rest_output_data assert from_rest_output_data.path == rest_output_data.datapath @@ -693,21 +626,15 @@ def assert_inline_component(self, component_job, component_dict): component = component_job.component or component_job.trial assert component._is_anonymous # hash will be generated before create_or_update, so can't check it in unit tests - assert list(component.inputs.keys()) == list( - component_dict.get("inputs", {}).keys() - ) - assert list(component.outputs.keys()) == list( - component_dict.get("outputs", {}).keys() - ) + assert list(component.inputs.keys()) == list(component_dict.get("inputs", {}).keys()) + assert list(component.outputs.keys()) == list(component_dict.get("outputs", {}).keys()) def test_pipeline_job_inline_component(self): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_inline_comps.yml" job = load_job(test_path) # make sure inline component is parsed into component entity hello_world_component = job.jobs["hello_world_component_inline"] - component_dict = load_yaml(test_path)["jobs"]["hello_world_component_inline"][ - "component" - ] + component_dict = load_yaml(test_path)["jobs"]["hello_world_component_inline"]["component"] self.assert_inline_component(hello_world_component, component_dict) def test_pipeline_job_inline_component_file(self): @@ -715,14 +642,10 @@ def test_pipeline_job_inline_component_file(self): job = load_job(test_path) # make sure inline component is parsed into component entity hello_world_component = job.jobs["hello_world_component_inline_file"] - component_dict = load_yaml( - "./tests/test_configs/components/helloworld_component.yml" - ) + component_dict = load_yaml("./tests/test_configs/components/helloworld_component.yml") self.assert_inline_component(hello_world_component, component_dict) - test_path = ( - "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" - ) + test_path = "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/pipeline.yml" job = load_job(test_path) # make sure inline component is parsed into component entity spark_component = job.jobs["add_greeting_column"] @@ -731,24 +654,18 @@ def test_pipeline_job_inline_component_file(self): ) self.assert_inline_component(spark_component, component_dict) - test_path = ( - "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" - ) + test_path = "./tests/test_configs/pipeline_jobs/data_transfer/merge_files_job.yaml" job = load_job(test_path) # make sure inline component is parsed into component entity spark_component = job.jobs["merge_files_job"] - component_dict = load_yaml( - "./tests/test_configs/components/data_transfer/merge_files.yaml" - ) + component_dict = load_yaml("./tests/test_configs/components/data_transfer/merge_files.yaml") self.assert_inline_component(spark_component, component_dict) test_path = "./tests/test_configs/pipeline_jobs/data_transfer/copy_files.yaml" job = load_job(test_path) # make sure inline component is parsed into component entity spark_component = job.jobs["copy_files"] - component_dict = load_yaml( - "./tests/test_configs/components/data_transfer/copy_files.yaml" - ) + component_dict = load_yaml("./tests/test_configs/components/data_transfer/copy_files.yaml") self.assert_inline_component(spark_component, component_dict) def test_pipeline_job_inline_component_file_with_complex_path(self): @@ -757,9 +674,7 @@ def test_pipeline_job_inline_component_file_with_complex_path(self): job = load_job(test_path) # make sure inline component is parsed into component entity hello_world_component = job.jobs["hello_world_inline_paralleljob"] - component_dict = load_yaml( - "./tests/test_configs/dsl_pipeline/parallel_component_with_file_input/score.yml" - ) + component_dict = load_yaml("./tests/test_configs/dsl_pipeline/parallel_component_with_file_input/score.yml") self.assert_inline_component(hello_world_component, component_dict) def test_pipeline_job_inline_component_file_parallel_with_user_identity(self): @@ -793,9 +708,7 @@ def mock_get_asset_arm_id(*args, **kwargs): "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", side_effect=mock_get_asset_arm_id, ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( - pipeline_job - ) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline_job) # Check that if compute was specified, it was resolved # Otherwise, it should be left unset since the backend will apply the default @@ -812,9 +725,7 @@ def mock_get_asset_arm_id(*args, **kwargs): def assert_setting(rest_job, key, value): assert rest_job.properties.settings.get(key, None) == value - assert_setting( - rest_job, PipelineConstants.DEFAULT_DATASTORE, "workspacefilestore" - ) + assert_setting(rest_job, PipelineConstants.DEFAULT_DATASTORE, "workspacefilestore") assert_setting(rest_job, PipelineConstants.DEFAULT_COMPUTE, "cpu-cluster-1") assert_setting(rest_job, PipelineConstants.CONTINUE_ON_STEP_FAILURE, True) @@ -825,12 +736,8 @@ def assert_setting(rest_job, key, value): assert from_rest_job.settings.default_compute == "cpu-cluster-1" assert from_rest_job.settings.continue_on_step_failure is True - def test_pipeline_job_settings_field( - self, mock_machinelearning_client: MLClient, mocker: MockFixture - ): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" - ) + def test_pipeline_job_settings_field(self, mock_machinelearning_client: MLClient, mocker: MockFixture): + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" job = load_job(test_path) self.assert_settings_field(job, mock_machinelearning_client, mocker) @@ -840,9 +747,7 @@ def test_pipeline_job_settings_field( assert rest_job.properties.compute_id == job.compute def test_set_unknown_pipeline_job_settings(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults.yml" job: PipelineJob = load_job( test_path, @@ -894,9 +799,7 @@ def mock_get_asset_arm_id(*args, **kwargs): "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", side_effect=mock_get_asset_arm_id, ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( - pipeline_job - ) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline_job) # Check that if compute was specified, it was resolved # Otherwise, it should be left unset since the backend will apply the default @@ -1004,22 +907,14 @@ def test_pipeline_job_with_input_bindings( with pytest.raises(Exception) as e: load_job( test_path, - params_override=[ - { - "jobs.hello_world.inputs.test1": "${{parent.inputs.not_found}}" - } - ], + params_override=[{"jobs.hello_world.inputs.test1": "${{parent.inputs.not_found}}"}], ) - assert "Failed to find top level definition for input binding" in str( - e.value - ) + assert "Failed to find top level definition for input binding" in str(e.value) # Check that all inputs are present and are of type Input or are literals for input_name, input_yaml in yaml_obj["inputs"].items(): job_obj_input = job.inputs.get(input_name, None) - assert ( - job_obj_input is not None - ), f"Input {input_name} not found in loaded job" + assert job_obj_input is not None, f"Input {input_name} not found in loaded job" assert isinstance(job_obj_input, PipelineInput) job_obj_input = job_obj_input._to_job_input() if isinstance(input_yaml, dict): @@ -1250,10 +1145,7 @@ def test_pipeline_job_command_job_with_input_outputs( for job_name, job_value in yaml_obj["jobs"].items(): for io_type in ["inputs", "outputs"]: - if ( - job_name not in expected_input_outputs - or io_type not in expected_input_outputs[job_name] - ): + if job_name not in expected_input_outputs or io_type not in expected_input_outputs[job_name]: continue expected_values = expected_input_outputs[job_name][io_type] @@ -1268,7 +1160,9 @@ def test_pipeline_job_command_job_with_input_outputs( assert expected_values == rest_component[io_type] def test_pipeline_job_str(self): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_inputs_outputs.yml" + ) pipeline_entity = load_job(source=test_path) pipeline_str = str(pipeline_entity) assert pipeline_entity.name in pipeline_str @@ -1279,13 +1173,8 @@ def test_pipeline_job_with_environment_variables(self) -> None: ) pipeline_job_dict = pipeline_job._to_rest_object().as_dict() - assert ( - "environment_variables" - in pipeline_job_dict["properties"]["jobs"]["world_job"] - ) - assert pipeline_job_dict["properties"]["jobs"]["world_job"][ - "environment_variables" - ] == { + assert "environment_variables" in pipeline_job_dict["properties"]["jobs"]["world_job"] + assert pipeline_job_dict["properties"]["jobs"]["world_job"]["environment_variables"] == { "AZUREML_COMPUTE_USE_COMMON_RUNTIME": "false", "abc": "def", } @@ -1311,26 +1200,18 @@ def test_dump_distribution(self): ValidationError, match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema", ): - _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump( - distribution_dict - ) + _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump(distribution_dict) with pytest.raises( ValidationError, match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema", ): - _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump( - distribution_obj - ) + _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump(distribution_obj) - after_dump_correct = TensorFlowDistributionSchema( - context={"base_path": "./"} - ).dump(distribution_obj) + after_dump_correct = TensorFlowDistributionSchema(context={"base_path": "./"}).dump(distribution_obj) assert after_dump_correct == distribution_dict def test_job_defaults(self, mocker: MockFixture): - pipeline_job = load_job( - source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_e2e.yml" - ) + pipeline_job = load_job(source="./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_defaults_e2e.yml") mocker.patch( "azure.ai.ml.operations._operation_orchestrator.OperationOrchestrator.get_asset_arm_id", return_value="xxx", @@ -1443,22 +1324,20 @@ def test_command_job_in_pipeline_to_component(self, test_path, expected_componen pipeline_entity = load_job(source=test_path) # check component of pipeline job is expected for name, expected_dict in expected_components.items(): - actual_dict = as_attribute_dict( - pipeline_entity.jobs[name].component._to_rest_object() - ) + actual_dict = as_attribute_dict(pipeline_entity.jobs[name].component._to_rest_object()) omit_fields = [ "name", # dumped code will be an absolute path, tested in other tests "code", ] - actual_dict = pydash.omit( - actual_dict["properties"]["component_spec"], omit_fields - ) + actual_dict = pydash.omit(actual_dict["properties"]["component_spec"], omit_fields) assert actual_dict == expected_dict def test_command_job_in_pipeline_deep_reference(self): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" + ) pipeline_entity = load_job(source=test_path) expected_components = { "hello_world_inline_commandjob_1": { @@ -1504,25 +1383,19 @@ def test_command_job_in_pipeline_deep_reference(self): }, } for name, expected_dict in expected_components.items(): - actual_dict = as_attribute_dict( - pipeline_entity.jobs[name].component._to_rest_object() - ) + actual_dict = as_attribute_dict(pipeline_entity.jobs[name].component._to_rest_object()) omit_fields = [ "name", ] - actual_dict = pydash.omit( - actual_dict["properties"]["component_spec"], omit_fields - ) + actual_dict = pydash.omit(actual_dict["properties"]["component_spec"], omit_fields) assert actual_dict == expected_dict def test_command_job_referenced_component_no_meta(self): - test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" - params_override = [ - { - "jobs.hello_world_component_before.component": "azureml:fake_component_arm_id:1" - } - ] + test_path = ( + "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_with_command_job_with_deep_reference.yml" + ) + params_override = [{"jobs.hello_world_component_before.component": "azureml:fake_component_arm_id:1"}] # when component is provided as arm id, won't able to get referenced component input/output type with pytest.raises(Exception) as e: load_job(source=test_path, params_override=params_override) @@ -1606,9 +1479,7 @@ def test_automl_node_in_pipeline_load_dump( "azure.mgmt.core.policies._authentication.ARMChallengeAuthenticationPolicy._need_new_token", return_value=False, ) - mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies( - pipeline - ) + mock_machinelearning_client.jobs._resolve_arm_id_or_upload_dependencies(pipeline) automl_job = pipeline.jobs[job_key] automl_job_dict = automl_job._to_dict(inside_pipeline=True) @@ -1633,22 +1504,14 @@ def test_automl_node_in_pipeline_load_dump( pipeline_job_dict = pydash.omit(pipeline_job_dict, ["sweep"]) original_job_dict = pydash.omit(original_job_dict, ["sweep"]) - for i, search_space_item in enumerate( - original_job_dict.get("search_space", []) - ): - original_job_dict["search_space"][i] = ( - _convert_sweep_dist_dict_to_str_dict(search_space_item) - ) + for i, search_space_item in enumerate(original_job_dict.get("search_space", [])): + original_job_dict["search_space"][i] = _convert_sweep_dist_dict_to_str_dict(search_space_item) assert pipeline_job_dict == original_job_dict - def _raise_error_on_wrong_schema( - self, test_path, original_dict, job_key, mock_machinelearning_client, mocker - ): + def _raise_error_on_wrong_schema(self, test_path, original_dict, job_key, mock_machinelearning_client, mocker): dump_yaml_to_file(test_path, original_dict) with pytest.raises(ValidationError): - self.test_automl_node_in_pipeline_load_dump( - test_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_path, job_key, mock_machinelearning_client, mocker) @pytest.mark.parametrize( "test_path, job_key", @@ -1715,15 +1578,11 @@ def test_automl_image_node_in_pipeline_load_dump( original_dict_copy["jobs"][job_key]["search_space"][0]["ams_gradient"] = True dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) # test LRSChedular Enum original_dict_copy = deepcopy(original_dict) - original_dict_copy["jobs"][job_key]["search_space"][0][ - "learning_rate_scheduler" - ] = { + original_dict_copy["jobs"][job_key]["search_space"][0]["learning_rate_scheduler"] = { "type": "choice", "values": ["random_lr_scheduler1", "random_lr_scheduler2"], } @@ -1735,17 +1594,13 @@ def test_automl_image_node_in_pipeline_load_dump( mocker, ) - original_dict_copy["jobs"][job_key]["search_space"][0][ - "learning_rate_scheduler" - ] = camel_to_snake(LearningRateScheduler.WARMUP_COSINE) - dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker + original_dict_copy["jobs"][job_key]["search_space"][0]["learning_rate_scheduler"] = camel_to_snake( + LearningRateScheduler.WARMUP_COSINE ) + dump_yaml_to_file(test_yaml_path, original_dict_copy) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) - original_dict_copy["jobs"][job_key]["search_space"][0][ - "learning_rate_scheduler" - ] = { + original_dict_copy["jobs"][job_key]["search_space"][0]["learning_rate_scheduler"] = { "type": "choice", "values": [ camel_to_snake(LearningRateScheduler.WARMUP_COSINE), @@ -1753,9 +1608,7 @@ def test_automl_image_node_in_pipeline_load_dump( ], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) # test Optimizer original_dict_copy = deepcopy(original_dict) @@ -1771,13 +1624,9 @@ def test_automl_image_node_in_pipeline_load_dump( mocker, ) - original_dict_copy["jobs"][job_key]["search_space"][0]["optimizer"] = ( - camel_to_snake(StochasticOptimizer.ADAM) - ) + original_dict_copy["jobs"][job_key]["search_space"][0]["optimizer"] = camel_to_snake(StochasticOptimizer.ADAM) dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) original_dict_copy["jobs"][job_key]["search_space"][0]["optimizer"] = { "type": "choice", @@ -1787,9 +1636,7 @@ def test_automl_image_node_in_pipeline_load_dump( ], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) # Test Model Name original_dict_copy = deepcopy(original_dict) @@ -1826,17 +1673,11 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["vitb16r224"], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) - original_dict_copy["jobs"][job_key]["search_space"][0][ - "model_name" - ] = "vitb16r224" + original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = "vitb16r224" dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) elif "object_detection" in job_key: original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = { @@ -1844,17 +1685,11 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["yolov5", "fasterrcnn_resnet50_fpn"], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) - original_dict_copy["jobs"][job_key]["search_space"][0][ - "model_name" - ] = "fasterrcnn_resnet50_fpn" + original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = "fasterrcnn_resnet50_fpn" dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) elif "instance_segmentation" in job_key: original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = { @@ -1862,53 +1697,33 @@ def test_automl_image_node_in_pipeline_load_dump( "values": ["maskrcnn_resnet152_fpn", "maskrcnn_resnet18_fpn"], } dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) - original_dict_copy["jobs"][job_key]["search_space"][0][ - "model_name" - ] = "maskrcnn_resnet18_fpn" + original_dict_copy["jobs"][job_key]["search_space"][0]["model_name"] = "maskrcnn_resnet18_fpn" dump_yaml_to_file(test_yaml_path, original_dict_copy) - self.test_automl_node_in_pipeline_load_dump( - test_yaml_path, job_key, mock_machinelearning_client, mocker - ) + self.test_automl_node_in_pipeline_load_dump(test_yaml_path, job_key, mock_machinelearning_client, mocker) @pytest.mark.parametrize( "params_override, error_field, expecting_field", [ ( - [ - { - "jobs.train_job.inputs.training_data": "${{inputs.pipeline_job_training_input}}" - } - ], + [{"jobs.train_job.inputs.training_data": "${{inputs.pipeline_job_training_input}}"}], "${{inputs.pipeline_job_training_input}}", "${{parent.inputs.pipeline_job_training_input}}", ), ( - [ - { - "jobs.score_job.inputs.model_input": "${{jobs.train_job.outputs.model_output}}" - } - ], + [{"jobs.score_job.inputs.model_input": "${{jobs.train_job.outputs.model_output}}"}], "${{jobs.train_job.outputs.model_output}}", "${{parent.jobs.train_job.outputs.model_output}}", ), ], ) - def test_legacy_data_binding_error_msg( - self, params_override, error_field, expecting_field - ): - test_path = ( - "./tests/test_configs/dsl_pipeline/e2e_local_components/pipeline.yml" - ) + def test_legacy_data_binding_error_msg(self, params_override, error_field, expecting_field): + test_path = "./tests/test_configs/dsl_pipeline/e2e_local_components/pipeline.yml" job: PipelineJob = load_job(source=test_path, params_override=params_override) with pytest.raises(ValidationException) as e: job._to_rest_object() - err_msg = "{} has changed to {}, please change to use new format.".format( - error_field, expecting_field - ) + err_msg = "{} has changed to {}, please change to use new format.".format(error_field, expecting_field) assert err_msg in str(e.value) @pytest.mark.parametrize( @@ -1917,9 +1732,7 @@ def test_legacy_data_binding_error_msg( "./tests/test_configs/pipeline_jobs/pipeline_job_with_parallel_job_with_input_bindings.yml", ], ) - def test_parallel_pipeline_not_private_preview_features( - self, test_path, mocker: MockFixture - ): + def test_parallel_pipeline_not_private_preview_features(self, test_path, mocker: MockFixture): mocker.patch( "azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", return_value=False, @@ -1928,9 +1741,7 @@ def test_parallel_pipeline_not_private_preview_features( try: job._to_rest_object() except UserErrorException as e: - assert ( - False - ), f"parallel in pipeline is public preview feature, but raised exception {e.value}" + assert False, f"parallel in pipeline is public preview feature, but raised exception {e.value}" def test_pipeline_yaml_job_node_source(self, mocker: MockFixture): test_path = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job.yml" @@ -1954,9 +1765,7 @@ def test_command_job_node_services_in_pipeline_with_properties(self): assert isinstance(node_services.get("my_vscode"), VsCodeJobService) job_rest_obj = job._to_rest_object() - rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"][ - "services" - ] + rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] # rest object of node in pipeline should be pure dict assert rest_services == { "my_ssh": { @@ -1989,9 +1798,7 @@ def test_command_job_node_services_in_pipeline(self): assert node_services.get("my_tensorboard").log_dir == "~/tblog" job_rest_obj = job._to_rest_object() - rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"][ - "services" - ] + rest_services = job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] # rest object of node in pipeline should be pure dict assert rest_services == { "my_ssh": { @@ -2023,9 +1830,7 @@ def test_command_job_node_services_in_pipeline_with_no_component(self): job_rest_obj = job._to_rest_object() # rest object of node in pipeline should be pure dict - assert job_rest_obj.properties.jobs["hello_world_component_inline"][ - "services" - ] == { + assert job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] == { "my_ssh": { "job_service_type": "SSH", "properties": {"sshPublicKeys": "xyz123"}, @@ -2057,9 +1862,7 @@ def test_command_job_node_services_in_pipeline_with_no_component_with_properties job_rest_obj = job._to_rest_object() # rest object of node in pipeline should be pure dict - assert job_rest_obj.properties.jobs["hello_world_component_inline"][ - "services" - ] == { + assert job_rest_obj.properties.jobs["hello_world_component_inline"]["services"] == { "my_ssh": { "job_service_type": "SSH", "properties": {"sshPublicKeys": "xyz123"}, @@ -2114,9 +1917,7 @@ def test_pipeline_job_with_pipeline_component(self): assert nodes["node3"]["inputs"] == expected_node3_input_dict def test_pipeline_component_job(self): - test_path = ( - "./tests/test_configs/pipeline_jobs/remote_pipeline_component_job.yml" - ) + test_path = "./tests/test_configs/pipeline_jobs/remote_pipeline_component_job.yml" job: PipelineJob = load_job(source=test_path) assert job._validate().passed expected_job_dict = { @@ -2175,10 +1976,7 @@ def test_invalid_pipeline_component_job(self): test_path = "./tests/test_configs/pipeline_jobs/invalid/invalid_pipeline_component_job.yml" with pytest.raises(Exception) as e: load_job(source=test_path) - assert ( - "'jobs' and 'component' are mutually exclusive fields in pipeline job" - in str(e.value) - ) + assert "'jobs' and 'component' are mutually exclusive fields in pipeline job" in str(e.value) @pytest.mark.parametrize( "pipeline_job_path, expected_error", From ed6342d4a5cdb602f378eacfce164c442dd138b1 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 10:42:24 +0530 Subject: [PATCH 039/146] Migrate ListViewType/ComponentVersion enum+annotation imports in operations to arm_ml_service Flip the ListViewType enum imports (identical ACTIVE_ONLY/ALL/ARCHIVED_ONLY values in arm, v2023_08 and v2024_01) in the component, evaluator and model operations, and the ComponentVersion annotation in the component operation (the component entity already produces arm ComponentVersion objects). These are enum-value and type-hint usages only, so there is no wire or runtime behavior change. ModelVersion stays on v2023_08 (still in a Union with the v2021_10 registry ModelVersionData read model). Validated: component+model+evaluator 197 passed. --- .../azure/ai/ml/operations/_component_operations.py | 2 +- .../azure/ai/ml/operations/_evaluator_operations.py | 2 +- sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index 40bed4d45feb..712d5378aa35 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -18,7 +18,7 @@ AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024 -from azure.ai.ml._restclient.v2024_01_01_preview.models import ComponentVersion, ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ComponentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 47167947e9b9..0f116d3ed1d3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -11,7 +11,7 @@ AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview -from azure.ai.ml._restclient.v2023_08_01_preview.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 2d6a04ce9afc..166766266494 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -28,7 +28,8 @@ ) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData -from azure.ai.ml._restclient.v2023_08_01_preview.models import ListViewType, ModelVersion +from azure.ai.ml._restclient.arm_ml_service.models import ListViewType +from azure.ai.ml._restclient.v2023_08_01_preview.models import ModelVersion from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, From 95ae6e667103c4da2a9e3a49983b92297fa0ccef Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 10:47:46 +0530 Subject: [PATCH 040/146] Migrate RestJobType enum import in job operations to arm_ml_service Flip 'JobType as RestJobType' from v2023_08 to arm_ml_service. It is used only for job_type value comparisons (AUTO_ML/PIPELINE/SWEEP/COMMAND/PIPELINE) whose values are identical across arm and v2023_08, so there is no wire or runtime behavior change. JobBase_2401 stays on v2024_01 (tied to the v2024_01-specific _get_job_2401 path). Validated: command_job+pipeline_job 226 passed. --- sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index 5b2799f3e867..4fd88c42ab10 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -30,7 +30,7 @@ from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022023Preview from azure.ai.ml._restclient.arm_ml_service.models import JobBase, ListViewType, UserIdentity from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as UserIdentityArm -from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType +from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 from azure.ai.ml._restclient.arm_ml_service.models import JobBase as RestJobBaseArm From f7e349719b06d24a64579a8032a6d0b775ee84e5 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 11:05:02 +0530 Subject: [PATCH 041/146] Repoint marketplace + serverless endpoint operations to arm_ml_service client Migrate the marketplace subscription and serverless endpoint operations onto a shared arm_ml_service client pinned to the 2024-01-01-preview wire api-version. Their entity _to_rest_object bodies now build arm_ml_service models (MarketplaceSubscription, ServerlessEndpoint + Properties/ModelSettings/Sku) and the serverless key operations use arm KeyType/RegenerateEndpointKeysRequest. All bodies verified byte-identical to the old v2024_01 msrest wire; all used operation-group methods have matching arm signatures. Dropped the bogus auth_mode='key' kwarg from the serverless _to_rest_object: it is not a top-level attribute of the ServerlessEndpoint resource model, so the old msrest client silently ignored it and it never reached the wire (arm rejects unknown kwargs). Validated: online_services + batch_online_common 154 passed; smoke_serialization 146/146. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 22 +++++++++++++++++-- .../_autogen_entities/models/_patch.py | 13 +++++------ .../_marketplace_subscription_operations.py | 4 ++-- .../_serverless_endpoint_operations.py | 6 ++--- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 48778315f74e..2e610c1b3ad5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -112,6 +112,10 @@ # the arm client). The separate v2024_04_01_preview msrest client is still required by the compute # (update_sso_settings) and Azure OpenAI deployment (.connection group) operations, which have no arm equivalent. ServiceClient042024PreviewArm = partial(MachineLearningServicesMgmtClient, api_version="2024-04-01-preview") +# arm_ml_service-backed client pinned to the 2024-01-01-preview wire api-version. Operations whose entities now +# build arm_ml_service bodies are being repointed onto this shared arm client (marketplace subscriptions, +# serverless endpoints, ...) so their responses deserialize into the arm_ml_service models. +ServiceClient012024PreviewArm = partial(MachineLearningServicesMgmtClient, api_version="2024-01-01-preview") module_logger = logging.getLogger(__name__) @@ -511,6 +515,20 @@ def __init__( **kwargs, ) + # arm_ml_service-backed client at the 2024-01-01-preview wire api-version. Operations whose entities now + # build arm_ml_service bodies (marketplace subscriptions, serverless endpoints, ...) use this so their + # responses deserialize into the arm_ml_service models. + self._service_client_01_2024_preview_arm = ServiceClient012024PreviewArm( + credential=self._credential, + subscription_id=( + self._ws_operation_scope._subscription_id + if registry_reference + else self._operation_scope._subscription_id + ), + base_url=base_url, + **kwargs, + ) + self._workspaces = WorkspaceOperations( self._ws_operation_scope if registry_reference else self._operation_scope, self._service_client_10_2024_preview_tsp, @@ -789,13 +807,13 @@ def __init__( self._serverless_endpoints = ServerlessEndpointOperations( self._operation_scope, self._operation_config, - self._service_client_01_2024_preview, + self._service_client_01_2024_preview_arm, self._operation_container, ) self._marketplace_subscriptions = MarketplaceSubscriptionOperations( self._operation_scope, self._operation_config, - self._service_client_01_2024_preview, + self._service_client_01_2024_preview_arm, ) self._operation_container.add(AzureMLResourceType.FEATURE_STORE, self._featurestores) # type: ignore[arg-type] self._operation_container.add(AzureMLResourceType.FEATURE_SET, self._featuresets) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py index da29aeb3012a..4d5878d01f01 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py @@ -12,16 +12,16 @@ import json from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2024_01_01_preview.models import MarketplaceSubscription as RestMarketplaceSubscription -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import MarketplaceSubscription as RestMarketplaceSubscription +from azure.ai.ml._restclient.arm_ml_service.models import ( MarketplaceSubscriptionProperties as RestMarketplaceSubscriptionProperties, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models import ModelSettings as RestModelSettings -from azure.ai.ml._restclient.v2024_01_01_preview.models import ServerlessEndpoint as RestServerlessEndpoint -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ModelSettings as RestModelSettings +from azure.ai.ml._restclient.arm_ml_service.models import ServerlessEndpoint as RestServerlessEndpoint +from azure.ai.ml._restclient.arm_ml_service.models import ( ServerlessEndpointProperties as RestServerlessEndpointProperties, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models import Sku as RestSku +from azure.ai.ml._restclient.arm_ml_service.models import Sku as RestSku from azure.ai.ml._restclient.v2024_04_01_preview.models import ( EndpointDeploymentResourcePropertiesBasicResource, OpenAIEndpointDeploymentResourceProperties, @@ -136,7 +136,6 @@ def _to_rest_object(self) -> RestServerlessEndpoint: properties=RestServerlessEndpointProperties( model_settings=RestModelSettings(model_id=self.model_id), ), - auth_mode="key", # only key is supported for now tags=self.tags, sku=RestSku(name="Consumption"), location=self.location, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_marketplace_subscription_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_marketplace_subscription_operations.py index 36683e3ad8c6..376884784bdc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_marketplace_subscription_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_marketplace_subscription_operations.py @@ -6,8 +6,8 @@ from typing import Iterable -from azure.ai.ml._restclient.v2024_01_01_preview import ( - AzureMachineLearningWorkspaces as ServiceClient202401Preview, +from azure.ai.ml._restclient.arm_ml_service import ( + MachineLearningServicesMgmtClient as ServiceClient202401Preview, ) from azure.ai.ml._scope_dependent_operations import ( OperationConfig, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_serverless_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_serverless_endpoint_operations.py index 5efec117221b..2d7cfa007562 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_serverless_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_serverless_endpoint_operations.py @@ -7,10 +7,10 @@ import re from typing import Iterable -from azure.ai.ml._restclient.v2024_01_01_preview import ( - AzureMachineLearningWorkspaces as ServiceClient202401Preview, +from azure.ai.ml._restclient.arm_ml_service import ( + MachineLearningServicesMgmtClient as ServiceClient202401Preview, ) -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( KeyType, RegenerateEndpointKeysRequest, ) From 9bb6dc40aba5fa66c2912d8301ca0b349c19c333 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 11:23:59 +0530 Subject: [PATCH 042/146] Repoint batch deployment operation to arm_ml_service client Wire BatchDeploymentOperations' primary client (batch_deployments + batch_endpoints groups) to the shared arm_ml_service 2024-01-01-preview client. The BatchDeployment and ModelBatchDeployment entities already build arm_ml_service BatchDeployment bodies (byte-verified in the smoke suite), and all used batch_deployments/batch_endpoints methods have matching arm signatures. PipelineComponentBatchDeployment still routes through the separate 2023-02-preview client, and the dataplane batch_job_deployment client is unchanged. Validated: batch_online_common + batch_services 121 passed. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../azure/ai/ml/operations/_batch_deployment_operations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 2e610c1b3ad5..66acbb482309 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -682,7 +682,7 @@ def __init__( self._batch_deployments = BatchDeploymentOperations( self._operation_scope, self._operation_config, - self._service_client_01_2024_preview, + self._service_client_01_2024_preview_arm, self._operation_container, credentials=self._credential, requests_pipeline=self._requests_pipeline, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py index 70bc39299f25..5733d7db263f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py @@ -7,7 +7,7 @@ import re from typing import Any, Optional, TypeVar, Union -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient012024Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, From 4dd10d84b1428ac88288ce9516984f1ac9997041 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 11:26:53 +0530 Subject: [PATCH 043/146] Repoint component operation (workspace path) to arm_ml_service client Wire the workspace-path ComponentOperations client (component_versions + component_containers groups) to the shared arm_ml_service 2024-01-01-preview client. The Component entity already builds arm_ml_service ComponentVersion bodies (byte-verified in smoke), and the workspace create_or_update/list/get paths have matching arm signatures (the workspace list passes list_view_type, not the msrest-only stage param). The registry path still uses the 2021-10-dataplanepreview client (arm has no registry component begin_create_or_update). Validated: component 122 passed. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 6 +++++- .../azure/ai/ml/operations/_component_operations.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 66acbb482309..aa65adf9f04b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -715,7 +715,11 @@ def __init__( self._components = ComponentOperations( self._operation_scope, self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_01_2024_preview), + ( + self._service_client_10_2021_dataplanepreview + if registry_name + else self._service_client_01_2024_preview_arm + ), self._operation_container, self._preflight, **ops_kwargs, # type: ignore[arg-type] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index 712d5378aa35..2146203bbbb1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -17,7 +17,7 @@ from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024 +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient012024 from azure.ai.ml._restclient.arm_ml_service.models import ComponentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, From e23fc4ac70b0b5c8fe8a534ea4e1c8e231ab9546 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 11:39:31 +0530 Subject: [PATCH 044/146] Route pipeline/automl/sweep job create to arm_ml_service client Send the pipeline, automl and sweep job create_or_update requests through a shared arm_ml_service client pinned to the 2024-01-01-preview wire api-version, mirroring the command (2025) and fine-tuning (2024-10) job paths that already route through the arm client. Each body is normalized to an arm hybrid JobBase via the existing _ensure_arm_job_base helper (wire-identical round-trip), and the result is normalized back to msrest via _ensure_msrest_job_base for the snake_case entity readers. jobs.list/get reads stay on the v2024_01 msrest client (arm jobs.list lacks the scheduled/schedule_id/ asset_name query params). Validated: command_job + pipeline_job + sweep_job 302 passed; automl + smoke_serialization 408 passed. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 1 + .../azure/ai/ml/operations/_job_operations.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index aa65adf9f04b..1202ea010a05 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -734,6 +734,7 @@ def __init__( _service_client_kwargs=kwargs, requests_pipeline=self._requests_pipeline, service_client_01_2024_preview=self._service_client_01_2024_preview, + service_client_01_2024_preview_arm=self._service_client_01_2024_preview_arm, service_client_10_2024_preview=self._service_client_10_2024_preview_tsp, service_client_01_2025_preview=self._service_client_01_2025_preview, **ops_kwargs, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index 4fd88c42ab10..d7df128eb11e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -239,6 +239,7 @@ def __init__( self._orchestrators = OperationOrchestrator(self._all_operations, self._operation_scope, self._operation_config) self.service_client_01_2024_preview = kwargs.pop("service_client_01_2024_preview", None) + self.service_client_01_2024_preview_arm = kwargs.pop("service_client_01_2024_preview_arm", None) self.service_client_10_2024_preview = kwargs.pop("service_client_10_2024_preview", None) self.service_client_01_2025_preview = kwargs.pop("service_client_01_2025_preview", None) self._kwargs = kwargs @@ -811,11 +812,16 @@ def _create_or_update_with_different_version_api(self, rest_job_resource: JobBas # (the local-run re-submit path passes a msrest JobBase fetched via GET). rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.PIPELINE: - service_client_operation = self.service_client_01_2024_preview.jobs + # The 2024-01 arm_ml_service client preserves the pipeline wire api-version while using the + # shared hybrid client; ensure the body is a hybrid model (SdkJSONEncoder only serializes those). + service_client_operation = self.service_client_01_2024_preview_arm.jobs + rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.AUTO_ML: - service_client_operation = self.service_client_01_2024_preview.jobs + service_client_operation = self.service_client_01_2024_preview_arm.jobs + rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.SWEEP: - service_client_operation = self.service_client_01_2024_preview.jobs + service_client_operation = self.service_client_01_2024_preview_arm.jobs + rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.COMMAND: service_client_operation = self.service_client_01_2025_preview.jobs # The 2025 client is the shared arm_ml_service client; ensure the body is a hybrid model From c22751d22eb3a573e085800727b03e9fb66c44bf Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 13:09:50 +0530 Subject: [PATCH 045/146] Migrate schedule trigger off v2024_01; fix arm job result deserialization Issue the schedule trigger-once request directly against the 2024-01-01-preview wire api-version via the shared arm_ml_service client's send_request (the arm client has no generated schedules.trigger method). The URL, query and body match the generated v2024_01 build_trigger_request byte-for-byte; ScheduleTriggerResult._from_rest_object now also accepts the raw camelCase JSON dict (submissionId/scheduleActionType). This drops the last v2024_01 dependency from the schedule operation and entity. Also fix _ensure_msrest_job_base to deserialize via the v2024_01 msrest JobBase instead of the arm hybrid JobBase (which has no .deserialize, only ._deserialize). This bug affected every job type routed through the arm client (command/fine-tuning already, now also pipeline/automl/sweep) on the real create/update path; unit tests mock the client so it only surfaced in the recorded schedule tests. Validated: schedule cron arm-id recorded tests pass; command_job + pipeline_job + schedule 242 passed. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 1 - .../ai/ml/entities/_schedule/schedule.py | 57 +++++++------------ .../azure/ai/ml/operations/_job_operations.py | 9 +-- .../ai/ml/operations/_schedule_operations.py | 44 +++++++++----- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 1202ea010a05..4573f4048d3d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -744,7 +744,6 @@ def __init__( self._operation_scope, self._operation_config, self._service_client_06_2023_preview, - self._service_client_01_2024_preview, self._operation_container, self._credential, _service_client_kwargs=kwargs, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py index b2b989225b21..e92c2990f488 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py @@ -19,9 +19,6 @@ ScheduleActionType as RestScheduleActionType, ) from azure.ai.ml._restclient.arm_ml_service.models import ScheduleProperties -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( - TriggerRunSubmissionDto as RestTriggerRunSubmissionDto, -) from azure.ai.ml._schema.schedule.schedule import JobScheduleSchema from azure.ai.ml._utils.utils import ( camel_to_snake, @@ -121,14 +118,10 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: """ path = kwargs.pop("path", None) yaml_serialized = self._to_dict() - dump_yaml_to_file( - dest, yaml_serialized, default_flow_style=False, path=path, **kwargs - ) + dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) @classmethod - def _create_validation_error( - cls, message: str, no_personal_data_message: str - ) -> ValidationException: + def _create_validation_error(cls, message: str, no_personal_data_message: str) -> ValidationException: return ValidationException( message=message, no_personal_data_message=no_personal_data_message, @@ -136,9 +129,7 @@ def _create_validation_error( ) @classmethod - def _resolve_cls_and_type( - cls, data: Dict, params_override: Optional[List[Dict]] = None - ) -> Tuple: + def _resolve_cls_and_type(cls, data: Dict, params_override: Optional[List[Dict]] = None) -> Tuple: from azure.ai.ml.entities._data_import.schedule import ImportDataSchedule from azure.ai.ml.entities._monitoring.schedule import MonitorSchedule @@ -151,9 +142,7 @@ def _resolve_cls_and_type( @property def create_job(self) -> Any: # pylint: disable=useless-return """The create_job entity associated with the schedule if exists.""" - module_logger.warning( - "create_job is not a valid property of %s", str(type(self)) - ) + module_logger.warning("create_job is not a valid property of %s", str(type(self))) # return None here just to be explicit return None @@ -164,9 +153,7 @@ def create_job(self, value: Any) -> None: # pylint: disable=unused-argument :param value: The create_job entity associated with the schedule if exists. :type value: Any """ - module_logger.warning( - "create_job is not a valid property of %s", str(type(self)) - ) + module_logger.warning("create_job is not a valid property of %s", str(type(self))) @property def is_enabled(self) -> bool: @@ -484,9 +471,7 @@ def _to_rest_object(self) -> RestSchedule: # TODO: Update this after source job id move to JobBaseProperties # Rest pipeline job will hold a 'Default' as experiment_name, # MFE will add default if None, so pass an empty string here. - job_definition = RestPipelineJob( - source_job_id=self.create_job, experiment_name="" - ) + job_definition = RestPipelineJob(source_job_id=self.create_job, experiment_name="") job_definition["isArchived"] = False else: msg = "Unsupported job type '{}' in schedule {}." @@ -500,18 +485,14 @@ def _to_rest_object(self) -> RestSchedule: # branch builds a msrest RestPipelineJob; CommandJob already builds the shared arm_ml_service hybrid. # Convert any msrest job_definition to its camelCase wire dict so it fits inside the arm_ml_service # schedule envelope without changing the wire body. - if getattr(job_definition, "_is_model", False) is not True and hasattr( - job_definition, "serialize" - ): + if getattr(job_definition, "_is_model", False) is not True and hasattr(job_definition, "serialize"): job_definition = job_definition.serialize() elif isinstance(self.create_job, PipelineJob): # The arm_ml_service PipelineJob may still carry unresolved inline components in ``jobs`` # (e.g. an offline entity whose component id has not been uploaded yet). The legacy msrest # ``serialize`` stringified those; reproduce that with an ``as_dict`` + ``json`` round-trip # using ``default=str`` so the arm hybrid ``SdkJSONEncoder`` never sees a non-model object. - job_definition = json.loads( - json.dumps(job_definition.as_dict(), default=str) - ) + job_definition = json.loads(json.dumps(job_definition.as_dict(), default=str)) return RestSchedule( properties=ScheduleProperties( description=self.description, @@ -520,9 +501,7 @@ def _to_rest_object(self) -> RestSchedule: action=JobScheduleAction(job_definition=job_definition), display_name=self.display_name, is_enabled=self._is_enabled, - trigger=( - self.trigger._to_rest_object() if self.trigger is not None else None - ), + trigger=(self.trigger._to_rest_object() if self.trigger is not None else None), ) ) @@ -535,9 +514,7 @@ def __str__(self) -> str: return res_jobSchedule # pylint: disable-next=docstring-missing-param - def _get_telemetry_values( - self, *args: Any, **kwargs: Any - ) -> Dict[Literal["trigger_type"], str]: + def _get_telemetry_values(self, *args: Any, **kwargs: Any) -> Dict[Literal["trigger_type"], str]: """Return the telemetry values of schedule. :return: A dictionary with telemetry values @@ -560,16 +537,20 @@ def __init__(self, **kwargs): self.schedule_action_type = kwargs.get("schedule_action_type", None) @classmethod - def _from_rest_object( - cls, obj: RestTriggerRunSubmissionDto - ) -> "ScheduleTriggerResult": + def _from_rest_object(cls, obj: Any) -> "ScheduleTriggerResult": """Construct a ScheduleJob from a rest object. - :param obj: The rest object to construct from. - :type obj: ~azure.ai.ml._restclient.v2024_01_01_preview.models.TriggerRunSubmissionDto + :param obj: The trigger response, either a rest ``TriggerRunSubmissionDto`` object or the raw + deserialized JSON dict (camelCase keys ``submissionId``/``scheduleActionType``). + :type obj: Any :return: The constructed ScheduleJob. :rtype: ScheduleTriggerResult """ + if isinstance(obj, dict): + return cls( + schedule_action_type=obj.get("scheduleActionType"), + job_name=obj.get("submissionId"), + ) return cls( schedule_action_type=obj.schedule_action_type, job_name=obj.submission_id, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index d7df128eb11e..a7fb8a8af0a2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -172,10 +172,11 @@ def _ensure_arm_job_base(rest_job_resource: Any) -> Any: def _ensure_msrest_job_base(result: Any) -> Any: - """Return the create/update result as a msrest ``JobBase`` (v2023_04) for entity parsing. + """Return the create/update result as a msrest ``JobBase`` (v2024_01) for entity parsing. - Command and fine-tuning jobs route to the shared arm_ml_service client, whose ``create_or_update`` - returns an arm hybrid ``JobBase``. The entity readers (``Job._from_rest_object`` and the nested + Command and fine-tuning jobs (and, since the operations-layer migration, pipeline/automl/sweep jobs) + route to the shared arm_ml_service client, whose ``create_or_update`` returns an arm hybrid + ``JobBase``. The entity readers (``Job._from_rest_object`` and the nested ``DistributionConfiguration._from_rest_object`` etc.) were authored against msrest ``.as_dict()``, which emits snake_case keys; the hybrid ``.as_dict()`` emits camelCase, so a hybrid result makes those readers pop ``None`` (e.g. ``distribution_type``) and crash. Round-trip the hybrid result @@ -190,7 +191,7 @@ def _ensure_msrest_job_base(result: Any) -> Any: """ if not getattr(result, "_is_model", False) is True: # already a msrest model (or a test mock) return result - return JobBase.deserialize(result.as_dict()) + return JobBase_2401.deserialize(result.as_dict()) class JobOperations(_ScopeDependentOperations): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py index 0511fe061025..33689f4f80a4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py @@ -4,9 +4,9 @@ # pylint: disable=protected-access from datetime import datetime, timezone from typing import Any, Iterable, List, Optional, Tuple, cast +from urllib.parse import quote from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient062023Preview -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -29,11 +29,12 @@ from azure.ai.ml.entities._monitoring.target import MonitoringTarget from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ScheduleException from azure.core.credentials import TokenCredential +from azure.core.exceptions import HttpResponseError from azure.core.polling import LROPoller +from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from .._restclient.arm_ml_service.models import ScheduleListViewType -from .._restclient.v2024_01_01_preview.models import TriggerOnceRequest from .._utils._arm_id_utils import AMLNamedArmId, AMLVersionedArmId, is_ARM_id_for_parented_resource from .._utils._azureml_polling import AzureMLPolling from .._utils.utils import snake_to_camel @@ -77,7 +78,6 @@ def __init__( operation_scope: OperationScope, operation_config: OperationConfig, service_client_06_2023_preview: ServiceClient062023Preview, - service_client_01_2024_preview: ServiceClient012024Preview, all_operations: OperationsContainer, credential: TokenCredential, **kwargs: Any, @@ -85,9 +85,12 @@ def __init__( super(ScheduleOperations, self).__init__(operation_scope, operation_config) ops_logger.update_filter() self.service_client = service_client_06_2023_preview.schedules - # Note: Trigger once is supported since 24_01, we don't upgrade other operations' client because there are - # some breaking changes, for example: AzMonMonitoringAlertNotificationSettings is removed. - self.schedule_trigger_service_client = service_client_01_2024_preview.schedules + # Trigger-once is only available from the 2024-01-01-preview wire api-version. The shared + # arm_ml_service client has no generated ``schedules.trigger`` method, so the trigger request is + # issued directly against that api-version via ``send_request`` (see ``trigger`` below). Other + # schedule operations stay on the 2023-06-preview wire (upgrading them has breaking changes, e.g. + # AzMonMonitoringAlertNotificationSettings was removed). + self._service_client = service_client_06_2023_preview self._all_operations = all_operations self._stream_logs_until_completion = stream_logs_until_completion # Dataplane service clients are lazily created as they are needed @@ -322,14 +325,29 @@ def trigger( :rtype: ~azure.ai.ml.entities.ScheduleTriggerResult """ schedule_time = kwargs.pop("schedule_time", datetime.now(timezone.utc).isoformat()) - return self.schedule_trigger_service_client.trigger( - name=name, - resource_group_name=self._operation_scope.resource_group_name, - workspace_name=self._workspace_name, - body=TriggerOnceRequest(schedule_time=schedule_time), - cls=lambda _, obj, __: ScheduleTriggerResult._from_rest_object(obj), - **kwargs, + # The shared arm_ml_service client has no generated ``schedules.trigger`` method (trigger-once is + # only modeled on the 2024-01-01-preview wire), so issue the request directly against that + # api-version. The URL/body match the generated 2024-01-01-preview ``build_trigger_request``. + url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/" + "Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger" + ).format( + subscriptionId=quote(self._subscription_id, safe=""), + resourceGroupName=quote(self._operation_scope.resource_group_name, safe=""), + workspaceName=quote(self._workspace_name, safe=""), + name=quote(name, safe=""), + ) + request = HttpRequest( + method="POST", + url=url, + params={"api-version": "2024-01-01-preview"}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + json={"scheduleTime": schedule_time}, ) + response = self._service_client.send_request(request, **kwargs) + if response.status_code != 200: + raise HttpResponseError(response=response) + return ScheduleTriggerResult._from_rest_object(response.json()) def _resolve_monitor_schedule_arm_id( # pylint:disable=too-many-branches,too-many-statements,too-many-locals self, schedule: MonitorSchedule From 58eb4488b8b334a2f52c6c7fc5bed05edad62165 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 15:10:01 +0530 Subject: [PATCH 046/146] Migrate data/datastore compute-mount off v2024_01 via arm client send_request Issue the persistent compute-instance data-mount request (updateDataMounts) and the mount status poll directly through the shared arm_ml_service client's send_request, dropping the v2024_01 msrest client + ComputeInstanceDataMount model from the data and datastore operations. The arm client has no generated compute.update_data_mounts (that endpoint is pinned to the 2021-01-01 data-plane api-version); the raw request URL/body match the generated 2024-01-01-preview build_update_data_mounts_request byte-for-byte, and the status poll reads the raw dataMounts JSON. Updated the mount unit tests + fixtures to mock send_request instead of the removed compute operation. Offline-verified: ComputeInstanceDataMount wire byte-identical; imports + test syntax OK. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 - .../ai/ml/operations/_data_operations.py | 74 +++++++++++------- .../ai/ml/operations/_datastore_operations.py | 76 ++++++++++++------- .../dataset/unittests/test_data_operations.py | 17 +++-- .../unittests/test_datastore_operations.py | 16 ++-- 5 files changed, 116 insertions(+), 69 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 4573f4048d3d..7bec8553f420 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -590,7 +590,6 @@ def __init__( operation_scope=self._operation_scope, operation_config=self._operation_config, serviceclient_2024_10_01_preview=self._service_client_10_2024_preview_tsp, - serviceclient_2024_01_01_preview=self._service_client_01_2024_preview, **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.DATASTORE, self._datastores) @@ -705,7 +704,6 @@ def __init__( self._ws_operation_scope if registry_reference else self._operation_scope, self._operation_config, (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023_preview), - self._service_client_01_2024_preview, self._datastores, requests_pipeline=self._requests_pipeline, all_operations=self._operation_container, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 06450398ef95..6703e7a8e762 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -10,6 +10,7 @@ from contextlib import contextmanager from pathlib import Path from typing import Any, Dict, Generator, Iterable, List, Optional, Union, cast +from urllib.parse import quote from marshmallow.exceptions import ValidationError as SchemaValidationError @@ -25,8 +26,6 @@ ) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023_preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024_preview -from azure.ai.ml._restclient.v2024_01_01_preview.models import ComputeInstanceDataMount from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -82,6 +81,7 @@ from azure.ai.ml.operations._datastore_operations import DatastoreOperations from azure.core.exceptions import HttpResponseError, ResourceNotFoundError from azure.core.paging import ItemPaged +from azure.core.rest import HttpRequest ops_logger = OpsLogger(__name__) module_logger = ops_logger.module_logger @@ -113,7 +113,6 @@ def __init__( operation_scope: OperationScope, operation_config: OperationConfig, service_client: Union[ServiceClient042023_preview, ServiceClient102021Dataplane], - service_client_012024_preview: ServiceClient012024_preview, datastore_operations: DatastoreOperations, **kwargs: Any, ): @@ -122,7 +121,6 @@ def __init__( self._operation = service_client.data_versions self._container_operation = service_client.data_containers self._datastore_operation = datastore_operations - self._compute_operation = service_client_012024_preview.compute self._service_client = service_client self._init_kwargs = kwargs self._requests_pipeline: HttpPipeline = kwargs.pop("requests_pipeline") @@ -796,38 +794,62 @@ def mount( ) if persistent and ci_name is not None: mount_name = f"unified_mount_{str(uuid.uuid4()).replace('-', '')}" - self._compute_operation.update_data_mounts( - self._resource_group_name, - self._workspace_name, - ci_name, - [ - ComputeInstanceDataMount( - source=uri, - source_type="URI", - mount_name=mount_name, - mount_action="Mount", - mount_path=mount_point or "", - ) + # The shared arm_ml_service client has no generated ``compute.update_data_mounts`` method + # (update-data-mounts is only modeled on the pinned 2021-01-01 data-plane api-version), so the + # request is issued directly via ``send_request``. The URL/body match the generated + # 2024-01-01-preview ``build_update_data_mounts_request`` byte-for-byte. + compute_url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/" + "Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" + ).format( + subscriptionId=quote(self._operation_scope._subscription_id, safe=""), + resourceGroupName=quote(self._resource_group_name, safe=""), + workspaceName=quote(self._workspace_name, safe=""), + computeName=quote(ci_name, safe=""), + ) + update_request = HttpRequest( + method="POST", + url=compute_url + "/updateDataMounts", + params={"api-version": "2021-01-01"}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + json=[ + { + "source": uri, + "sourceType": "URI", + "mountName": mount_name, + "mountAction": "Mount", + "mountPath": mount_point or "", + } ], - api_version="2021-01-01", - **kwargs, ) + update_response = self._service_client.send_request(update_request, **kwargs) + if update_response.status_code != 200: + raise HttpResponseError(response=update_response) print(f"Mount requested [name: {mount_name}]. Waiting for completion ...") while True: - compute = self._compute_operation.get(self._resource_group_name, self._workspace_name, ci_name) - mounts = compute.properties.properties.data_mounts + get_request = HttpRequest( + method="GET", + url=compute_url, + params={"api-version": "2024-01-01-preview"}, + headers={"Accept": "application/json"}, + ) + get_response = self._service_client.send_request(get_request) + if get_response.status_code != 200: + raise HttpResponseError(response=get_response) + mounts = ((get_response.json().get("properties") or {}).get("properties") or {}).get("dataMounts") or [] try: - mount = [mount for mount in mounts if mount.mount_name == mount_name][0] - if mount.mount_state == "Mounted": + mount = [mount for mount in mounts if mount.get("mountName") == mount_name][0] + mount_state = mount.get("mountState") + if mount_state == "Mounted": print(f"Mounted [name: {mount_name}].") break - if mount.mount_state == "MountRequested": + if mount_state == "MountRequested": pass - elif mount.mount_state == "MountFailed": - msg = f"Mount failed [name: {mount_name}]: {mount.error}" + elif mount_state == "MountFailed": + msg = f"Mount failed [name: {mount_name}]: {mount.get('error')}" raise MlException(message=msg, no_personal_data_message=msg) else: - msg = f"Got unexpected mount state [name: {mount_name}]: {mount.mount_state}" + msg = f"Got unexpected mount state [name: {mount_name}]: {mount_state}" raise MlException(message=msg, no_personal_data_message=msg) except IndexError: pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py index 17e3572b9b36..799dca6853a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py @@ -7,12 +7,11 @@ import time import uuid from typing import Dict, Iterable, Optional, cast +from urllib.parse import quote from marshmallow.exceptions import ValidationError as SchemaValidationError from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview -from azure.ai.ml._restclient.v2024_01_01_preview.models import ComputeInstanceDataMount from azure.ai.ml._restclient.arm_ml_service import ( MachineLearningServicesMgmtClient as ServiceClient102024Preview, ) @@ -27,6 +26,8 @@ from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml.entities._datastore.datastore import Datastore from azure.ai.ml.exceptions import MlException, ValidationException +from azure.core.exceptions import HttpResponseError +from azure.core.rest import HttpRequest ops_logger = OpsLogger(__name__) module_logger = ops_logger.module_logger @@ -56,14 +57,13 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - serviceclient_2024_01_01_preview: ServiceClient012024Preview, serviceclient_2024_10_01_preview: ServiceClient102024Preview, **kwargs: Dict, ): super(DatastoreOperations, self).__init__(operation_scope, operation_config) ops_logger.update_filter() self._operation = serviceclient_2024_10_01_preview.datastores - self._compute_operation = serviceclient_2024_01_01_preview.compute + self._service_client = serviceclient_2024_10_01_preview self._credential = serviceclient_2024_10_01_preview._config.credential self._init_kwargs = kwargs @@ -293,38 +293,62 @@ def mount( ) if persistent and ci_name is not None: mount_name = f"unified_mount_{str(uuid.uuid4()).replace('-', '')}" - self._compute_operation.update_data_mounts( - self._resource_group_name, - self._workspace_name, - ci_name, - [ - ComputeInstanceDataMount( - source=uri, - source_type="URI", - mount_name=mount_name, - mount_action="Mount", - mount_path=mount_point or "", - ) + # The shared arm_ml_service client has no generated ``compute.update_data_mounts`` method + # (update-data-mounts is only modeled on the pinned 2021-01-01 data-plane api-version), so the + # request is issued directly via ``send_request``. The URL/body match the generated + # 2024-01-01-preview ``build_update_data_mounts_request`` byte-for-byte. + compute_url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/" + "Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" + ).format( + subscriptionId=quote(self._operation_scope._subscription_id, safe=""), + resourceGroupName=quote(self._resource_group_name, safe=""), + workspaceName=quote(self._workspace_name, safe=""), + computeName=quote(ci_name, safe=""), + ) + update_request = HttpRequest( + method="POST", + url=compute_url + "/updateDataMounts", + params={"api-version": "2021-01-01"}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + json=[ + { + "source": uri, + "sourceType": "URI", + "mountName": mount_name, + "mountAction": "Mount", + "mountPath": mount_point or "", + } ], - api_version="2021-01-01", - **kwargs, ) + update_response = self._service_client.send_request(update_request, **kwargs) + if update_response.status_code != 200: + raise HttpResponseError(response=update_response) print(f"Mount requested [name: {mount_name}]. Waiting for completion ...") while True: - compute = self._compute_operation.get(self._resource_group_name, self._workspace_name, ci_name) - mounts = compute.properties.properties.data_mounts + get_request = HttpRequest( + method="GET", + url=compute_url, + params={"api-version": "2024-01-01-preview"}, + headers={"Accept": "application/json"}, + ) + get_response = self._service_client.send_request(get_request) + if get_response.status_code != 200: + raise HttpResponseError(response=get_response) + mounts = ((get_response.json().get("properties") or {}).get("properties") or {}).get("dataMounts") or [] try: - mount = [mount for mount in mounts if mount.mount_name == mount_name][0] - if mount.mount_state == "Mounted": + mount = [mount for mount in mounts if mount.get("mountName") == mount_name][0] + mount_state = mount.get("mountState") + if mount_state == "Mounted": print(f"Mounted [name: {mount_name}].") break - if mount.mount_state == "MountRequested": + if mount_state == "MountRequested": pass - elif mount.mount_state == "MountFailed": - msg = f"Mount failed [name: {mount_name}]: {mount.error}" + elif mount_state == "MountFailed": + msg = f"Mount failed [name: {mount_name}]: {mount.get('error')}" raise MlException(message=msg, no_personal_data_message=msg) else: - msg = f"Got unexpected mount state [name: {mount_name}]: {mount.mount_state}" + msg = f"Got unexpected mount state [name: {mount_name}]: {mount_state}" raise MlException(message=msg, no_personal_data_message=msg) except IndexError: pass diff --git a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py index 72cfe0d762d6..ceb7bd89718b 100644 --- a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py +++ b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py @@ -60,7 +60,6 @@ def mock_data_operations( operation_scope=mock_workspace_scope, operation_config=mock_operation_config, service_client=mock_aml_services_2022_10_01, - service_client_012024_preview=mock_aml_services_2024_01_01_preview, datastore_operations=mock_datastore_operation, requests_pipeline=mock_machinelearning_client._requests_pipeline, all_operations=mock_machinelearning_client._operation_container, @@ -80,7 +79,6 @@ def mock_data_operations_in_registry( operation_scope=mock_registry_scope, operation_config=mock_operation_config, service_client=mock_aml_services_2022_10_01, - service_client_012024_preview=mock_aml_services_2024_01_01_preview, datastore_operations=mock_datastore_operation, requests_pipeline=mock_machinelearning_client._requests_pipeline, all_operations=mock_machinelearning_client._operation_container, @@ -589,11 +587,14 @@ def test_mount_persistent( self, mock_data_operations: DataOperations, ): - mock_data_operations._compute_operation.get.return_value = Mock( - properties=Mock( - properties=Mock(data_mounts=[Mock(mount_name="unified_mount_random_uuid", mount_state="Mounted")]) - ) - ) + update_response = Mock(status_code=200) + get_response = Mock(status_code=200) + get_response.json.return_value = { + "properties": { + "properties": {"dataMounts": [{"mountName": "unified_mount_random_uuid", "mountState": "Mounted"}]} + } + } + mock_data_operations._service_client.send_request.side_effect = [update_response, get_response] with patch("uuid.uuid4", return_value="random_uuid"), patch( "azureml.dataprep.rslex_fuse_subprocess_wrapper.build_data_asset_uri" ) as mock_build_uri, patch.dict(os.environ, {"CI_NAME": "random_ci"}): @@ -603,7 +604,7 @@ def test_mount_persistent( persistent=True, ) mock_build_uri.assert_called_once() - mock_data_operations._compute_operation.update_data_mounts.assert_called_once() + assert mock_data_operations._service_client.send_request.call_count == 2 @pytest.mark.skipif( (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)), diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py index 5be028178ce5..95b87c0de6bd 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py @@ -24,7 +24,6 @@ def mock_datastore_operation( yield DatastoreOperations( operation_scope=mock_workspace_scope, operation_config=mock_operation_config, - serviceclient_2024_01_01_preview=mock_aml_services_2024_01_01_preview, serviceclient_2024_10_01_preview=mock_aml_services_2024_10_01_preview, ) @@ -82,11 +81,14 @@ def test_mount_persistent( mock_from_rest, mock_datastore_operation: DatastoreOperations, ): - mock_datastore_operation._compute_operation.get.return_value = Mock( - properties=Mock( - properties=Mock(data_mounts=[Mock(mount_name="unified_mount_random_uuid", mount_state="Mounted")]) - ) - ) + update_response = Mock(status_code=200) + get_response = Mock(status_code=200) + get_response.json.return_value = { + "properties": { + "properties": {"dataMounts": [{"mountName": "unified_mount_random_uuid", "mountState": "Mounted"}]} + } + } + mock_datastore_operation._service_client.send_request.side_effect = [update_response, get_response] with patch("uuid.uuid4", return_value="random_uuid"), patch( "azureml.dataprep.rslex_fuse_subprocess_wrapper.build_datastore_uri" ) as mock_build_uri, patch.dict(os.environ, {"CI_NAME": "random_ci"}): @@ -96,7 +98,7 @@ def test_mount_persistent( persistent=True, ) mock_build_uri.assert_called_once() - mock_datastore_operation._compute_operation.update_data_mounts.assert_called_once() + assert mock_datastore_operation._service_client.send_request.call_count == 2 @pytest.mark.skipif( (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)), From efbb0d871bb2d970b50c44fbdf848b929092a42c Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 16:05:05 +0530 Subject: [PATCH 047/146] Migrate job reads off v2024_01; remove the v2024_01 msrest client entirely Route the job list/get reads (list, _get_job, _get_job_2401) through the shared arm_ml_service client at the 2024-01-01-preview wire api-version, and delete the _ensure_msrest_job_base / _ensure_arm_job_base conversion shims: the entity job readers (Job._from_rest_object and every per-type _load_from_rest) handle arm hybrid JobBase objects directly (verified offline for command/command+distribution/pipeline/sweep/automl/spark), so no msrest round-trip is needed on either the create result or the reads. jobs.list forwards the scheduled/schedule_id query params via the raw params dict (arm's jobs.list has no such kwargs; the SDK never sets them, so the common path is identical). With the last consumer gone, the v2024_01 msrest client construction, import, and JobBase_2401 model are removed from _ml_client and _job_operations. Test fixtures updated: the job-ops mocks use the arm read client, the dsl component-create patch targets arm, and the shared mock_aml_services_2024_01_01_preview fixture imports the submodule so it stays patchable now that no production code imports it. Validated: job_common + batch_services 38 passed (0 errors, was 13); command/pipeline/sweep 302 earlier; smoke_serialization 146/146. --- sdk/ml/azure-ai-ml/RCA.md | 49 + sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 20 - .../ai/ml/operations/_datastore_operations.py | 4 - .../azure/ai/ml/operations/_job_operations.py | 86 +- sdk/ml/azure-ai-ml/tests/conftest.py | 5 + .../tests/dsl/unittests/test_dsl_pipeline.py | 935 +++++------------- .../unittests/test_job_operations.py | 16 +- 7 files changed, 309 insertions(+), 806 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/RCA.md diff --git a/sdk/ml/azure-ai-ml/RCA.md b/sdk/ml/azure-ai-ml/RCA.md new file mode 100644 index 000000000000..435dc59519fc --- /dev/null +++ b/sdk/ml/azure-ai-ml/RCA.md @@ -0,0 +1,49 @@ +# ICM 829788361 — `az ml datastore create` JSON serialization failure + +## Summary + +`az ml datastore create` fails with `TypeError: Object of type Datastore is not JSON serializable` on `az ml` extension **v2.44.0** (bundles `azure-ai-ml` **1.34.0**). It works on **v2.43.0** (`azure-ai-ml` **1.33.0**). + +## Symptom + +```text +ERROR: Met error : Object of type Datastore is not JSON serializable +``` + +Raised by the generated REST client at `json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)`. + +## Root cause + +PR #47349 (`azure-ai-ml` 1.34.0) switched the datastore **operation** to the TypeSpec client (`v2024_10_01_preview_tsp`, later renamed `arm_ml_service`). Its `SdkJSONEncoder` only serializes TypeSpec models. The datastore **entity** `_to_rest_object()` was **not** migrated — it still builds a legacy msrest model (`v2023_04_01_preview.models.Datastore`). `SdkJSONEncoder` sees a non-TypeSpec object (`_is_model()` is `False`), falls through to `json.JSONEncoder.default`, and raises `TypeError`. Still unfixed on `main`. + +Key files: + +- `sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py` — `create_or_update` +- `sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py` — `_to_rest_object` +- `sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/arm_ml_service/_utils/model_base.py` — `SdkJSONEncoder` + +## Fix (Option A — minimal bridge) + +Implement in **azure-sdk-for-python** (`azure-ai-ml`), **not** azure-cli-extensions. The `az ml` extension is a thin wrapper and only needs to bump its bundled `azure-ai-ml` to the fixed release. + +In `_datastore_operations.py` `create_or_update`, pass the serialized wire dict instead of the msrest model (the TSP op accepts `Union[Datastore, JSON, IO[bytes]]`): + +```python +ds_request = datastore._to_rest_object() +datastore_resource = self._operation.create_or_update( + name=datastore.name, + resource_group_name=self._operation_scope.resource_group_name, + workspace_name=self._workspace_name, + body=ds_request.serialize(), # msrest model -> camelCase wire dict + skip_validation=True, +) +``` + +## Validation + +- Offline wire net: `sdk/ml/azure-ai-ml/tests/smoke_serialization/test_datastore_wire.py` — 6 cases pass today; must stay byte-identical after the change. +- Add before shipping: identity/None creds (customer case), certificate, on-prem; plus a `_from_rest_object()` round-trip. + +## Workaround + +Pin the extension: `az extension add --name ml --version 2.43.0`. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 7bec8553f420..9a329eb612df 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -26,7 +26,6 @@ AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, ) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview from azure.ai.ml._restclient.workspace_dataplane import WorkspaceDataplaneClient as ServiceClientWorkspaceDataplane from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope @@ -371,13 +370,6 @@ def __init__( **kwargs, ) - self._service_client_01_2024_preview = ServiceClient012024Preview( - credential=self._credential, - subscription_id=self._operation_scope._subscription_id, - base_url=base_url, - **kwargs, - ) - self._service_client_04_2024_preview = ServiceClient042024Preview( credential=self._credential, subscription_id=self._operation_scope._subscription_id, @@ -480,17 +472,6 @@ def __init__( **kwargs, ) - self._service_client_01_2024_preview = ServiceClient012024Preview( - credential=self._credential, - subscription_id=( - self._ws_operation_scope._subscription_id - if registry_reference - else self._operation_scope._subscription_id - ), - base_url=base_url, - **kwargs, - ) - self._service_client_04_2024_preview = ServiceClient042024Preview( credential=self._credential, subscription_id=( @@ -731,7 +712,6 @@ def __init__( self._credential, _service_client_kwargs=kwargs, requests_pipeline=self._requests_pipeline, - service_client_01_2024_preview=self._service_client_01_2024_preview, service_client_01_2024_preview_arm=self._service_client_01_2024_preview_arm, service_client_10_2024_preview=self._service_client_10_2024_preview_tsp, service_client_01_2025_preview=self._service_client_01_2025_preview, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py index 799dca6853a9..eabee369e812 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py @@ -43,10 +43,6 @@ class DatastoreOperations(_ScopeDependentOperations): :type operation_scope: ~azure.ai.ml._scope_dependent_operations.OperationScope :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig - :param serviceclient_2024_01_01_preview: Service client to allow end users to operate on Azure Machine Learning - Workspace resources. - :type serviceclient_2024_01_01_preview: ~azure.ai.ml._restclient.v2024_01_01_preview. - _azure_machine_learning_workspaces.AzureMachineLearningWorkspaces :param serviceclient_2024_10_01_preview: Service client to allow end users to operate on Azure Machine Learning Workspace resources. :type serviceclient_2024_10_01_preview: ~azure.ai.ml._restclient.arm_ml_service. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index a7fb8a8af0a2..860f074e1325 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -31,8 +31,6 @@ from azure.ai.ml._restclient.arm_ml_service.models import JobBase, ListViewType, UserIdentity from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as UserIdentityArm from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType -from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 -from azure.ai.ml._restclient.arm_ml_service.models import JobBase as RestJobBaseArm from azure.ai.ml._scope_dependent_operations import ( OperationConfig, @@ -147,53 +145,6 @@ _FINE_TUNING_JOB_TYPE = "FineTuning" -def _ensure_arm_job_base(rest_job_resource: Any) -> Any: - """Return the body as a shared arm_ml_service hybrid ``JobBase``. - - Command and fine-tuning jobs route to the shared arm_ml_service client, whose ``SdkJSONEncoder`` - only serializes hybrid models. Most call sites already build an arm hybrid body, but the local-run - re-submit path re-PUTs a msrest ``JobBase`` fetched via GET. Round-trip any msrest body through its - wire dict (msrest ``.serialize()`` -> arm ``._deserialize()``), which is wire-identical. No-op when - the body is already an arm hybrid model. Remove once arm_ml_service is regenerated with - api-version "all". - - :param rest_job_resource: A msrest or arm hybrid ``JobBase``. - :type rest_job_resource: Any - :return: An arm_ml_service hybrid ``JobBase``. - :rtype: Any - """ - if hasattr(rest_job_resource, "_is_model"): # already an arm hybrid model - return rest_job_resource - converted = RestJobBaseArm._deserialize(rest_job_resource.serialize(), []) # pylint: disable=protected-access - # ``name`` is a read-only resource field that msrest ``.serialize()`` omits; carry it over so the - # create_or_update URL (which uses ``id=rest_job_resource.name``) is populated. - converted.name = rest_job_resource.name - return converted - - -def _ensure_msrest_job_base(result: Any) -> Any: - """Return the create/update result as a msrest ``JobBase`` (v2024_01) for entity parsing. - - Command and fine-tuning jobs (and, since the operations-layer migration, pipeline/automl/sweep jobs) - route to the shared arm_ml_service client, whose ``create_or_update`` returns an arm hybrid - ``JobBase``. The entity readers (``Job._from_rest_object`` and the nested - ``DistributionConfiguration._from_rest_object`` etc.) were authored against msrest ``.as_dict()``, - which emits snake_case keys; the hybrid ``.as_dict()`` emits camelCase, so a hybrid result makes - those readers pop ``None`` (e.g. ``distribution_type``) and crash. Round-trip the hybrid result - through its camelCase wire dict (hybrid ``.as_dict()`` -> msrest ``.deserialize()``), which is - wire-identical and rehydrates proper msrest nested models. No-op when the result is already a msrest - model. Remove once arm_ml_service is regenerated with api-version "all". - - :param result: A msrest or arm hybrid ``JobBase``. - :type result: Any - :return: A msrest ``JobBase``. - :rtype: Any - """ - if not getattr(result, "_is_model", False) is True: # already a msrest model (or a test mock) - return result - return JobBase_2401.deserialize(result.as_dict()) - - class JobOperations(_ScopeDependentOperations): """Initiates an instance of JobOperations @@ -239,7 +190,6 @@ def __init__( self._credential = credential self._orchestrators = OperationOrchestrator(self._all_operations, self._operation_scope, self._operation_config) - self.service_client_01_2024_preview = kwargs.pop("service_client_01_2024_preview", None) self.service_client_01_2024_preview_arm = kwargs.pop("service_client_01_2024_preview_arm", None) self.service_client_10_2024_preview = kwargs.pop("service_client_10_2024_preview", None) self.service_client_01_2025_preview = kwargs.pop("service_client_01_2025_preview", None) @@ -363,15 +313,23 @@ def list( parent_job = self.get(parent_job_name) return self._runs_operations.get_run_children(parent_job.name, max_results=max_results) + # The shared arm_ml_service ``jobs.list`` has no ``scheduled``/``schedule_id`` query params (they are + # only modeled on the 2024-01-01-preview wire and are never set by the SDK itself). Forward them as raw + # query params when a caller passes them so the wire stays identical to the old v2024_01 client. + extra_params: Dict[str, str] = {} + if schedule_defined is not None: + extra_params["scheduled"] = str(schedule_defined).lower() + if scheduled_job_name is not None: + extra_params["scheduleId"] = scheduled_job_name + return cast( Iterable[Job], - self.service_client_01_2024_preview.jobs.list( + self.service_client_01_2024_preview_arm.jobs.list( self._operation_scope.resource_group_name, self._workspace_name, cls=lambda objs: [self._handle_rest_errors(obj) for obj in objs], list_view_type=list_view_type, - scheduled=schedule_defined, - schedule_id=scheduled_job_name, + params=extra_params, **self._kwargs, **kwargs, ), @@ -800,34 +758,20 @@ def create_or_update( result = self._create_or_update_with_different_version_api(rest_job_resource=job_object, **kwargs) - # Command/fine-tuning route to the shared arm_ml_service client, which returns an arm hybrid - # JobBase whose camelCase ``.as_dict()`` breaks the snake_case entity readers; normalize to msrest. - result = _ensure_msrest_job_base(result) return self._resolve_azureml_id(Job._from_rest_object(result)) def _create_or_update_with_different_version_api(self, rest_job_resource: JobBase, **kwargs: Any) -> JobBase: service_client_operation = self._operation_2023_02_preview if rest_job_resource.properties.job_type == _FINE_TUNING_JOB_TYPE: service_client_operation = self.service_client_10_2024_preview.jobs - # The 2024-10 client is the shared arm_ml_service client; ensure the body is a hybrid model - # (the local-run re-submit path passes a msrest JobBase fetched via GET). - rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.PIPELINE: - # The 2024-01 arm_ml_service client preserves the pipeline wire api-version while using the - # shared hybrid client; ensure the body is a hybrid model (SdkJSONEncoder only serializes those). service_client_operation = self.service_client_01_2024_preview_arm.jobs - rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.AUTO_ML: service_client_operation = self.service_client_01_2024_preview_arm.jobs - rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.SWEEP: service_client_operation = self.service_client_01_2024_preview_arm.jobs - rest_job_resource = _ensure_arm_job_base(rest_job_resource) if rest_job_resource.properties.job_type == RestJobType.COMMAND: service_client_operation = self.service_client_01_2025_preview.jobs - # The 2025 client is the shared arm_ml_service client; ensure the body is a hybrid model - # (the local-run re-submit path passes a msrest JobBase fetched via GET). - rest_job_resource = _ensure_arm_job_base(rest_job_resource) result = service_client_operation.create_or_update( id=rest_job_resource.name, @@ -840,7 +784,7 @@ def _create_or_update_with_different_version_api(self, rest_job_resource: JobBas return result def _create_or_update_with_latest_version_api(self, rest_job_resource: JobBase, **kwargs: Any) -> JobBase: - service_client_operation = self.service_client_01_2024_preview.jobs + service_client_operation = self.service_client_01_2024_preview_arm.jobs result = service_client_operation.create_or_update( id=rest_job_resource.name, resource_group_name=self._operation_scope.resource_group_name, @@ -1148,7 +1092,7 @@ def _get_batch_job_scoring_output_uri(self, job_name: str) -> Optional[str]: return uri def _get_job(self, name: str) -> JobBase: - job = self.service_client_01_2024_preview.jobs.get( + job = self.service_client_01_2024_preview_arm.jobs.get( id=name, resource_group_name=self._operation_scope.resource_group_name, workspace_name=self._workspace_name, @@ -1172,8 +1116,8 @@ def _get_job(self, name: str) -> JobBase: # Upgrade api from 2023-04-01-preview to 2024-01-01-preview for pipeline job # We can remove this function once `_get_job` function has also been upgraded to the same version with pipeline - def _get_job_2401(self, name: str) -> JobBase_2401: - service_client_operation = self.service_client_01_2024_preview.jobs + def _get_job_2401(self, name: str) -> JobBase: + service_client_operation = self.service_client_01_2024_preview_arm.jobs return service_client_operation.get( id=name, resource_group_name=self._operation_scope.resource_group_name, diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 531947f3b83d..19d2b5a222f1 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -295,6 +295,11 @@ def mock_aml_services_2023_10_01(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2024_01_01_preview(mocker: MockFixture) -> Mock: + # Ensure the submodule is imported so it is an attribute of ``azure.ai.ml._restclient`` for mocker.patch. + # Production code no longer imports v2024_01_01_preview (operations were migrated to arm_ml_service), so the + # attribute would otherwise be absent when a test that never imports it directly requests this fixture. + import azure.ai.ml._restclient.v2024_01_01_preview # noqa: F401 pylint: disable=unused-import + return mocker.patch("azure.ai.ml._restclient.v2024_01_01_preview") diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py index a5851920740f..839f50e51c82 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline.py @@ -72,9 +72,7 @@ components_dir = tests_root_dir / "test_configs/components/" -@pytest.mark.usefixtures( - "enable_pipeline_private_preview_features", "enable_private_preview_schema_features" -) +@pytest.mark.usefixtures("enable_pipeline_private_preview_features", "enable_private_preview_schema_features") @pytest.mark.timeout(_DSL_TIMEOUT_SECOND) @pytest.mark.unittest @pytest.mark.pipeline_test @@ -85,24 +83,18 @@ def test_dsl_pipeline(self) -> None: @dsl.pipeline() def pipeline_no_arg(): component_func = load_component(source=path) - component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline1 = pipeline_no_arg() assert len(pipeline1.component.jobs) == 1, pipeline1.component.jobs def test_dsl_pipeline_name_and_display_name(self): - hello_world_component_yaml = ( - "./tests/test_configs/components/helloworld_component.yml" - ) + hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() def sample_pipeline_with_no_annotation(): - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline_with_no_annotation() assert pipeline.component.name == "sample_pipeline_with_no_annotation" @@ -112,9 +104,7 @@ def sample_pipeline_with_no_annotation(): @dsl.pipeline(name="hello_world_component") def sample_pipeline_with_name(): - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline_with_name() assert pipeline.component.name == "hello_world_component" @@ -124,9 +114,7 @@ def sample_pipeline_with_name(): @dsl.pipeline(display_name="my_component") def sample_pipeline_with_display_name(): - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline_with_display_name() assert pipeline.component.name == "sample_pipeline_with_display_name" @@ -136,9 +124,7 @@ def sample_pipeline_with_display_name(): @dsl.pipeline(name="hello_world_component", display_name="my_component") def sample_pipeline_with_name_and_display_name(): - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline_with_name_and_display_name() assert pipeline.component.name == "hello_world_component" @@ -147,16 +133,12 @@ def sample_pipeline_with_name_and_display_name(): assert pipeline.display_name == pipeline.component.display_name def test_dsl_pipeline_description(self): - hello_world_component_yaml = ( - "./tests/test_configs/components/helloworld_component.yml" - ) + hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() def sample_pipeline(): - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline() assert pipeline.component.description is None @@ -165,9 +147,7 @@ def sample_pipeline(): @dsl.pipeline() def sample_pipeline_with_docstring(): """Docstring for sample pipeline""" - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline_with_docstring() assert pipeline.component.description == "Docstring for sample pipeline" @@ -176,9 +156,7 @@ def sample_pipeline_with_docstring(): @dsl.pipeline(description="Top description for sample pipeline") def sample_pipeline_with_description_and_docstring(): """Docstring for sample pipeline""" - hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) pipeline = sample_pipeline_with_description_and_docstring() assert pipeline.component.description == "Top description for sample pipeline" @@ -200,39 +178,23 @@ def sample_pipeline_with_detailed_docstring(job_in_path, job_in_number): Other docstring xxxxxx random_key: random_value """ - node = hello_world_component_func( - component_in_path=job_in_path, component_in_number=job_in_number - ) + node = hello_world_component_func(component_in_path=job_in_path, component_in_number=job_in_number) return {"job_out_path": node.outputs.component_out_path} - pipeline = sample_pipeline_with_detailed_docstring( - Input(path="/a/path/on/ds"), 1 - ) - assert pipeline.component.description.startswith( - "A pipeline with detailed docstring" - ) - assert ( - pipeline.component.inputs["job_in_path"]["description"] - == "a path parameter with multi-line description" - ) - assert ( - pipeline.component.inputs["job_in_number"]["description"] - == "a number parameter" - ) + pipeline = sample_pipeline_with_detailed_docstring(Input(path="/a/path/on/ds"), 1) + assert pipeline.component.description.startswith("A pipeline with detailed docstring") + assert pipeline.component.inputs["job_in_path"]["description"] == "a path parameter with multi-line description" + assert pipeline.component.inputs["job_in_number"]["description"] == "a number parameter" assert pipeline.component.outputs["job_out_path"].description == "a path output" assert pipeline.description == pipeline.component.description def test_dsl_pipeline_comment(self) -> None: - hello_world_component_yaml = ( - "./tests/test_configs/components/helloworld_component.yml" - ) + hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline def sample_pipeline_with_comment(): - node = hello_world_component_func( - component_in_path=Input(path="/a/path/on/ds"), component_in_number=1 - ) + node = hello_world_component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1) node.comment = "arbitrary string" pipeline = sample_pipeline_with_comment() @@ -252,9 +214,7 @@ def pipeline(number, path): assert pipeline1._build_inputs().keys() == {"number", "path"} # un-configured output will have type of bounded node output - assert pipeline1._build_outputs() == { - "pipeline_output": Output(type="uri_folder") - } + assert pipeline1._build_outputs() == {"pipeline_output": Output(type="uri_folder")} # after setting mode, default output with type Input is built pipeline1.outputs.pipeline_output.mode = "download" @@ -265,17 +225,11 @@ def pipeline(number, path): component_node = component_nodes[0] assert component_node._build_inputs() == { - "component_in_number": Input( - path="${{parent.inputs.number}}", type="uri_folder", mode=None - ), - "component_in_path": Input( - path="${{parent.inputs.path}}", type="uri_folder", mode=None - ), + "component_in_number": Input(path="${{parent.inputs.number}}", type="uri_folder", mode=None), + "component_in_path": Input(path="${{parent.inputs.path}}", type="uri_folder", mode=None), } assert component_node._build_outputs() == { - "component_out_path": Output( - path="${{parent.outputs.pipeline_output}}", type="uri_folder", mode=None - ) + "component_out_path": Output(path="${{parent.outputs.pipeline_output}}", type="uri_folder", mode=None) } # Test Input as pipeline input @@ -287,12 +241,8 @@ def pipeline(number, path): component_node = component_nodes[0] assert component_node._build_inputs() == { - "component_in_number": Input( - path="${{parent.inputs.number}}", type="uri_folder", mode=None - ), - "component_in_path": Input( - path="${{parent.inputs.path}}", type="uri_folder", mode=None - ), + "component_in_number": Input(path="${{parent.inputs.number}}", type="uri_folder", mode=None), + "component_in_path": Input(path="${{parent.inputs.path}}", type="uri_folder", mode=None), } @pytest.mark.parametrize( @@ -313,14 +263,10 @@ def pipeline(number, path): pipeline1 = pipeline(10, Input(path="/a/path/on/ds")) # un-configured output will have type of bound output - assert pipeline1._build_outputs() == { - "pipeline_output": Output(type=output_type) - } + assert pipeline1._build_outputs() == {"pipeline_output": Output(type=output_type)} def test_dsl_pipeline_complex_input_output(self) -> None: - yaml_file = ( - "./tests/test_configs/components/helloworld_component_multiple_data.yml" - ) + yaml_file = "./tests/test_configs/components/helloworld_component_multiple_data.yml" @dsl.pipeline() def pipeline( @@ -373,9 +319,7 @@ def pipeline( job_yaml = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_data_options.yml" pipeline_job: PipelineJob = load_job(source=job_yaml) - pipeline = pipeline( - **{key: val for key, val in pipeline_job._build_inputs().items()} - ) + pipeline = pipeline(**{key: val for key, val in pipeline_job._build_inputs().items()}) pipeline.inputs.job_in_data_by_store_path_and_mount.mode = "ro_mount" pipeline.inputs.job_in_data_by_store_path_and_download.mode = "download" pipeline.inputs.job_in_data_name_version_mode_download.mode = "download" @@ -417,20 +361,14 @@ def test_dsl_pipeline_to_job(self) -> None: experiment_name="my_first_experiment", ) def pipeline(job_in_number, job_in_other_number, job_in_path): - hello_world_component = component_func( - component_in_number=job_in_number, component_in_path=job_in_path - ) + hello_world_component = component_func(component_in_number=job_in_number, component_in_path=job_in_path) hello_world_component.compute = "cpu-cluster" - hello_world_component._component._id = ( - "microsoftsamplesCommandComponentBasic_second:1" - ) + hello_world_component._component._id = "microsoftsamplesCommandComponentBasic_second:1" hello_world_component_2 = component_func( component_in_number=job_in_other_number, component_in_path=job_in_path ) - hello_world_component_2._component._id = ( - "microsoftsamplesCommandComponentBasic_second:1" - ) + hello_world_component_2._component._id = "microsoftsamplesCommandComponentBasic_second:1" hello_world_component_2.compute = "cpu-cluster" pipeline = pipeline(10, 15, Input(path="./tests/test_configs/data")) @@ -439,9 +377,7 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) job_yaml = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job.yml" - pipeline_job_dict = as_attribute_dict( - load_job(source=job_yaml)._to_rest_object() - ) + pipeline_job_dict = as_attribute_dict(load_job(source=job_yaml)._to_rest_object()) omit_fields = [ "name", @@ -455,9 +391,7 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): assert dsl_pipeline_job_dict == pipeline_job_dict def test_dsl_pipeline_with_settings_and_overrides(self): - component_yaml = ( - "./tests/test_configs/components/helloworld_component_no_paths.yml" - ) + component_yaml = "./tests/test_configs/components/helloworld_component_no_paths.yml" component_func = load_component(source=component_yaml) @dsl.pipeline( @@ -471,16 +405,10 @@ def test_dsl_pipeline_with_settings_and_overrides(self): def pipeline(job_in_number, job_in_other_number, job_in_string): hello_world_component = component_func(component_in_number=job_in_number) hello_world_component.compute = "cpu-cluster" - hello_world_component._component._id = ( - "microsoftsamplescommandcomponentbasic_nopaths_test:1" - ) + hello_world_component._component._id = "microsoftsamplescommandcomponentbasic_nopaths_test:1" - hello_world_component_2 = component_func( - component_in_number=job_in_other_number - ) - hello_world_component_2._component._id = ( - "microsoftsamplescommandcomponentbasic_nopaths_test:1" - ) + hello_world_component_2 = component_func(component_in_number=job_in_other_number) + hello_world_component_2._component._id = "microsoftsamplescommandcomponentbasic_nopaths_test:1" hello_world_component_2.compute = "cpu-cluster" # set overrides for component job hello_world_component_2.resources = JobResourceConfiguration() @@ -500,12 +428,8 @@ def pipeline(job_in_number, job_in_other_number, job_in_string): dsl_pipeline_job_dict = as_attribute_dict(pipeline_job._to_rest_object()) - job_yaml = ( - "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" - ) - pipeline_job_dict = as_attribute_dict( - load_job(source=job_yaml)._to_rest_object() - ) + job_yaml = "./tests/test_configs/pipeline_jobs/helloworld_pipeline_job_no_paths.yml" + pipeline_job_dict = as_attribute_dict(load_job(source=job_yaml)._to_rest_object()) omit_fields = [ "name", @@ -518,9 +442,7 @@ def pipeline(job_in_number, job_in_other_number, job_in_string): assert dsl_pipeline_job == yaml_pipeline_job def test_pipeline_variable_name(self): - component_yaml = ( - "./tests/test_configs/components/helloworld_component_no_paths.yml" - ) + component_yaml = "./tests/test_configs/components/helloworld_component_no_paths.yml" component_func1 = load_component(source=component_yaml) component_yaml = "./tests/test_configs/components/helloworld_component.yml" component_func2 = load_component(source=component_yaml) @@ -701,16 +623,12 @@ def pipeline_with_user_defined_nodes_1(): pipeline_job = pipeline_with_user_defined_nodes_1() rest_pipeline_job = as_attribute_dict(pipeline_job._to_rest_object()) - assert rest_pipeline_job["properties"]["jobs"]["another_0"]["inputs"][ - "component_in_path" - ] == { + assert rest_pipeline_job["properties"]["jobs"]["another_0"]["inputs"]["component_in_path"] == { "job_input_type": "literal", "mode": "Direct", "value": "${{parent.jobs.dummy_0.outputs.component_out_path}}", } - assert rest_pipeline_job["properties"]["jobs"]["another_1"]["inputs"][ - "component_in_path" - ] == { + assert rest_pipeline_job["properties"]["jobs"]["another_1"]["inputs"]["component_in_path"] == { "job_input_type": "literal", "mode": "Direct", "value": "${{parent.jobs.dummy_1.outputs.component_out_path}}", @@ -720,12 +638,8 @@ def test_connect_components_in_pipeline(self): hello_world_component_yaml = "./tests/test_configs/components/helloworld_component_with_input_and_output.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) - merge_outputs_component_yaml = ( - "./tests/test_configs/components/merge_outputs_component.yml" - ) - merge_outputs_component_func = load_component( - source=merge_outputs_component_yaml - ) + merge_outputs_component_yaml = "./tests/test_configs/components/merge_outputs_component.yml" + merge_outputs_component_func = load_component(source=merge_outputs_component_yaml) @dsl.pipeline( name="simplePipelineJobWithComponentOutput", @@ -762,9 +676,7 @@ def pipeline(job_in_number, job_in_path): "job_out_path_2": merge_component_outputs.outputs.component_out_path_2, } - pipeline = pipeline( - 10, Input(path="./tests/test_configs/data", mode="ro_mount") - ) + pipeline = pipeline(10, Input(path="./tests/test_configs/data", mode="ro_mount")) pipeline.outputs.job_out_path_1.mode = "mount" pipeline.outputs.job_out_path_2.mode = "Upload" dsl_pipeline_job = as_attribute_dict(pipeline._to_rest_object()) @@ -774,12 +686,8 @@ def pipeline(job_in_number, job_in_path): load_job( yaml_job_path, params_override=[ - { - "jobs.hello_world_component_1.inputs.component_in_path": "${{parent.inputs.job_in_path}}" - }, - { - "jobs.hello_world_component_2.inputs.component_in_path": "${{parent.inputs.job_in_path}}" - }, + {"jobs.hello_world_component_1.inputs.component_in_path": "${{parent.inputs.job_in_path}}"}, + {"jobs.hello_world_component_2.inputs.component_in_path": "${{parent.inputs.job_in_path}}"}, ], )._to_rest_object() ) @@ -799,17 +707,11 @@ def pipeline(job_in_number, job_in_path): assert dsl_pipeline_job == yaml_pipeline_job def test_same_pipeline_via_dsl_or_curated_sdk(self): - hello_world_component_yaml_path = ( - "./tests/test_configs/components/helloworld_component.yml" - ) - merge_outputs_component_yaml_path = ( - "./tests/test_configs/components/merge_outputs_component.yml" - ) + hello_world_component_yaml_path = "./tests/test_configs/components/helloworld_component.yml" + merge_outputs_component_yaml_path = "./tests/test_configs/components/merge_outputs_component.yml" # Define pipeline job via curated SDK YAML - pipeline_job_from_yaml = load_job( - source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml" - ) + pipeline_job_from_yaml = load_job(source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml") # Define pipeline job via curated SDK code pipeline_job = PipelineJob( @@ -866,13 +768,9 @@ def test_same_pipeline_via_dsl_or_curated_sdk(self): ) # Define pipeline job via DSL - hello_world_component_func = load_component( - source=hello_world_component_yaml_path - ) + hello_world_component_func = load_component(source=hello_world_component_yaml_path) - merge_outputs_component_func = load_component( - source=merge_outputs_component_yaml_path - ) + merge_outputs_component_func = load_component(source=merge_outputs_component_yaml_path) @dsl.pipeline( name="SimplePipelineJob", @@ -913,9 +811,7 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): dsl_pipeline = pipeline(10, 15, Input(path="./tests/test_configs/data")) dsl_pipeline.outputs.job_out_data_1.mode = "mount" dsl_pipeline.outputs.job_out_data_2.mode = "Upload" - pipeline_job_from_yaml = as_attribute_dict( - pipeline_job_from_yaml._to_rest_object() - ) + pipeline_job_from_yaml = as_attribute_dict(pipeline_job_from_yaml._to_rest_object()) pipeline_job = as_attribute_dict(pipeline_job._to_rest_object()) dsl_pipeline = as_attribute_dict(dsl_pipeline._to_rest_object()) omit_fields = [ @@ -928,9 +824,7 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): "properties.inputs.job_in_path.uri", "properties.settings", ] - pipeline_job_from_yaml = omit_with_wildcard( - pipeline_job_from_yaml, *omit_fields - ) + pipeline_job_from_yaml = omit_with_wildcard(pipeline_job_from_yaml, *omit_fields) pipeline_job = omit_with_wildcard(pipeline_job, *omit_fields) dsl_pipeline = omit_with_wildcard(dsl_pipeline, *omit_fields) @@ -999,26 +893,18 @@ def mock_add_to_builder(component): # DSL yaml_file = "./tests/test_configs/components/helloworld_component.yml" - component_entity = load_component( - source=yaml_file, params_override=[{"name": "hello_world_component_1"}] - ) + component_entity = load_component(source=yaml_file, params_override=[{"name": "hello_world_component_1"}]) component_func = _generate_component_function(component_entity) - job_in_number = PipelineInput( - name="job_in_number", owner="pipeline", meta=None - ) + job_in_number = PipelineInput(name="job_in_number", owner="pipeline", meta=None) job_in_path = PipelineInput(name="job_in_path", owner="pipeline", meta=None) - component_from_dsl = component_func( - component_in_number=job_in_number, component_in_path=job_in_path - ) + component_from_dsl = component_func(component_in_number=job_in_number, component_in_path=job_in_path) component_from_dsl.compute = "cpu-cluster" component_from_dsl.outputs.component_out_path.mode = "upload" component_from_dsl.name = "hello_world_component_1" # YAML - pipeline = load_job( - source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml" - ) + pipeline = load_job(source="./tests/test_configs/pipeline_jobs/sample_pipeline_job.yml") component_from_yaml = pipeline.jobs["hello_world_component_1"] # REST @@ -1080,27 +966,13 @@ def mock_add_to_builder(component): "type": "command", } omit_fields = ["componentId", "properties"] - assert ( - pydash.omit(component_from_dsl._to_rest_object(), *omit_fields) - == expected_component - ) - assert ( - pydash.omit(component_from_sdk._to_rest_object(), *omit_fields) - == expected_component - ) - assert ( - pydash.omit(component_from_rest._to_rest_object(), *omit_fields) - == expected_component - ) + assert pydash.omit(component_from_dsl._to_rest_object(), *omit_fields) == expected_component + assert pydash.omit(component_from_sdk._to_rest_object(), *omit_fields) == expected_component + assert pydash.omit(component_from_rest._to_rest_object(), *omit_fields) == expected_component expected_component.update({"_source": "YAML.JOB"}) - assert ( - pydash.omit(component_from_yaml._to_rest_object(), *omit_fields) - == expected_component - ) + assert pydash.omit(component_from_yaml._to_rest_object(), *omit_fields) == expected_component - def assert_component_reuse( - self, pipeline, expected_component_num, mock_machinelearning_client: MLClient - ): + def assert_component_reuse(self, pipeline, expected_component_num, mock_machinelearning_client: MLClient): def mock_arm_id(asset, azureml_type: str, *args, **kwargs): if azureml_type in AzureMLResourceType.NAMED_TYPES: return NAMED_RESOURCE_ID_FORMAT.format( @@ -1134,17 +1006,13 @@ def mock_from_rest(*args, **kwargs): side_effect=mock_arm_id, ): with mock.patch( - "azure.ai.ml._restclient.v2024_01_01_preview.operations.ComponentVersionsOperations.create_or_update", + "azure.ai.ml._restclient.arm_ml_service.operations.ComponentVersionsOperations.create_or_update", side_effect=mock_create, ): - with mock.patch.object( - Component, "_from_rest_object", side_effect=mock_from_rest - ): + with mock.patch.object(Component, "_from_rest_object", side_effect=mock_from_rest): for _, job in pipeline.jobs.items(): - component_name = ( - mock_machinelearning_client.components.create_or_update( - job.component, is_anonymous=True - ) + component_name = mock_machinelearning_client.components.create_or_update( + job.component, is_anonymous=True ) component_names.add(component_name) err_msg = f"Got unexpected component id: {component_names}, expecting {expected_component_num} of them." @@ -1188,9 +1056,7 @@ def test_command_function_reuse(self, mock_machinelearning_client: MLClient): expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} inputs = { - "component_in_path": Input( - type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount" - ), + "component_in_path": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), "component_in_number": 0.01, } outputs = {"component_out_path": Output(type="mlflow_model", mode="rw_mount")} @@ -1213,17 +1079,13 @@ def pipeline(component_in_number, component_in_path): component_in_number=component_in_number, component_in_path=component_in_path, ) - node2 = component_func( - component_in_number=1, component_in_path=component_in_path - ) + node2 = component_func(component_in_number=1, component_in_path=component_in_path) node3 = command_func1( component_in_number=component_in_number, component_in_path=component_in_path, ) - node4 = command_func1( - component_in_number=1, component_in_path=component_in_path - ) + node4 = command_func1(component_in_number=1, component_in_path=component_in_path) # same command func as command 1 command_func2 = command( @@ -1241,9 +1103,7 @@ def pipeline(component_in_number, component_in_path): component_in_number=component_in_number, component_in_path=component_in_path, ) - node6 = command_func2( - component_in_number=1, component_in_path=component_in_path - ) + node6 = command_func2(component_in_number=1, component_in_path=component_in_path) return { **node1.outputs, @@ -1389,9 +1249,7 @@ def pipeline(number, path): ), ], ) - def test_dsl_pipeline_with_data_binding_expression( - self, target_yml: str, target_dsl_pipeline: PipelineJob - ) -> None: + def test_dsl_pipeline_with_data_binding_expression(self, target_yml: str, target_dsl_pipeline: PipelineJob) -> None: dsl_pipeline_job_rest_dict, pipeline_job_rest_dict = prepare_dsl_curated( target_dsl_pipeline, target_yml, in_rest=True ) @@ -1410,9 +1268,7 @@ def test_dsl_pipeline_support_data_binding_for_fields(self) -> None: schema = MPIDistributionSchema() support_data_binding_expression_for_fields(schema, ["type"]) - distribution = schema.load( - {"type": "mpi", "process_count_per_instance": "${{parent.inputs.test}}"} - ) + distribution = schema.load({"type": "mpi", "process_count_per_instance": "${{parent.inputs.test}}"}) test_input = PipelineInput("test", None) assert distribution.type == "mpi" assert distribution.process_count_per_instance == str(test_input) @@ -1566,9 +1422,7 @@ def test_dsl_pipeline_with_only_setting_pipeline_level(self) -> None: }, } }, - "outputs": { - "trained_model": {"mode": "Upload", "job_output_type": "uri_folder"} - }, + "outputs": {"trained_model": {"mode": "Upload", "job_output_type": "uri_folder"}}, "settings": {}, } } @@ -1643,9 +1497,7 @@ def test_dsl_pipeline_with_only_setting_binding_node(self) -> None: }, } }, - "outputs": { - "trained_model": {"job_output_type": "uri_folder", "mode": "Upload"} - }, + "outputs": {"trained_model": {"job_output_type": "uri_folder", "mode": "Upload"}}, "settings": {}, } } @@ -1777,27 +1629,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.inputs.component_in_path}}" - }, + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, }, "type": "command", }, "node2": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.jobs.node1.outputs.component_out_path}}" - }, - }, - "outputs": { - "component_out_path": "${{parent.outputs.sub_pipeline_out}}" + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.jobs.node1.outputs.component_out_path}}"}, }, + "outputs": {"component_out_path": "${{parent.outputs.sub_pipeline_out}}"}, "type": "command", }, }, @@ -1821,27 +1663,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.inputs.component_in_path}}" - }, + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, }, "type": "pipeline", }, "node2": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}" - }, - }, - "outputs": { - "sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}" + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}"}, }, + "outputs": {"sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}"}, "type": "pipeline", }, }, @@ -1858,9 +1690,7 @@ def test_dsl_pipeline_with_command_builder_setting_binding_node_and_pipeline_lev pipeline_with_command_builder_setting_binding_node_and_pipeline_level, ) - pipeline = ( - pipeline_with_command_builder_setting_binding_node_and_pipeline_level() - ) + pipeline = pipeline_with_command_builder_setting_binding_node_and_pipeline_level() dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) omit_fields = [ "name", @@ -1951,9 +1781,7 @@ def test_nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level( ) pipeline = nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level() - dsl_pipeline_job_dict = json.loads( - json.dumps(as_attribute_dict(pipeline._to_rest_object()), default=str) - ) + dsl_pipeline_job_dict = json.loads(json.dumps(as_attribute_dict(pipeline._to_rest_object()), default=str)) omit_fields = [ "name", "properties.inputs.pipeline_training_input.uri", @@ -2034,7 +1862,9 @@ def test_nested_dsl_pipeline_with_setting_binding_node_and_pipeline_level( } def test_dsl_pipeline_build_component(self): - component_path = "./tests/test_configs/pipeline_jobs/inline_file_comp_base_path_sensitive/component/component.yml" + component_path = ( + "./tests/test_configs/pipeline_jobs/inline_file_comp_base_path_sensitive/component/component.yml" + ) component_path2 = "./tests/test_configs/components/helloworld_component.yml" @dsl.pipeline( @@ -2048,9 +1878,7 @@ def pipeline_func(path: Input): r_iris_example = component_func(iris=path) r_iris_example.compute = "cpu-cluster" component_func = load_component(source=component_path2) - node = component_func( - component_in_number="mock_data", component_in_path="mock_data" - ) + node = component_func(component_in_number="mock_data", component_in_path="mock_data") node.outputs.component_out_path.mode = "upload" return node.outputs @@ -2071,9 +1899,7 @@ def pipeline_func(path: Input): assert expected_dict == actual_dict def test_concatenation_of_pipeline_input_with_str(self) -> None: - echo_string_func = load_component( - source=str(components_dir / "echo_string_component.yml") - ) + echo_string_func = load_component(source=str(components_dir / "echo_string_component.yml")) @dsl.pipeline(name="concatenation_of_pipeline_input_with_str") def concatenation_in_pipeline(str_param: str): @@ -2090,10 +1916,7 @@ def concatenation_in_pipeline(str_param: str): "${{parent.inputs.str_param}}${{parent.inputs.str_param}}", ), ): - assert ( - pipeline.jobs[node_name].inputs.component_in_string._data - == expected_value - ) + assert pipeline.jobs[node_name].inputs.component_in_string._data == expected_value def test_nested_dsl_pipeline_with_use_node_pipeline_as_input(self): path = "./tests/test_configs/components/helloworld_component.yml" @@ -2138,27 +1961,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.inputs.component_in_path}}" - }, + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, }, "type": "command", }, "node2": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.jobs.node1.outputs.component_out_path}}" - }, - }, - "outputs": { - "component_out_path": "${{parent.outputs.sub_pipeline_out}}" + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.jobs.node1.outputs.component_out_path}}"}, }, + "outputs": {"component_out_path": "${{parent.outputs.sub_pipeline_out}}"}, "type": "command", }, }, @@ -2170,9 +1983,7 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs.node1.properties", "jobs.node2.properties", ] - actual_dict = pydash.omit( - pipeline.jobs["node1"].component._to_dict(), *omit_fields - ) + actual_dict = pydash.omit(pipeline.jobs["node1"].component._to_dict(), *omit_fields) assert actual_dict == expected_sub_dict expected_root_dict = { "display_name": "root_pipeline", @@ -2181,27 +1992,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.inputs.component_in_path}}" - }, + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, }, "type": "pipeline", }, "node2": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}" - }, - }, - "outputs": { - "sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}" + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}"}, }, + "outputs": {"sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}"}, "type": "pipeline", }, }, @@ -2238,9 +2039,7 @@ def root_pipeline(component_in_number: int, component_in_path: str): component_in_number=component_in_number, component_in_path=component_in_path, ) - node2.inputs.component_in_path = ( - node1 # use a pipeline node to set the input - ) + node2.inputs.component_in_path = node1 # use a pipeline node to set the input return node2.outputs pipeline = root_pipeline(1, "test") @@ -2257,27 +2056,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.inputs.component_in_path}}" - }, + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, }, "type": "command", }, "node2": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.jobs.node1.outputs.component_out_path}}" - }, - }, - "outputs": { - "component_out_path": "${{parent.outputs.sub_pipeline_out}}" + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.jobs.node1.outputs.component_out_path}}"}, }, + "outputs": {"component_out_path": "${{parent.outputs.sub_pipeline_out}}"}, "type": "command", }, }, @@ -2299,27 +2088,17 @@ def root_pipeline(component_in_number: int, component_in_path: str): "jobs": { "node1": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.inputs.component_in_path}}" - }, + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.inputs.component_in_path}}"}, }, "type": "pipeline", }, "node2": { "inputs": { - "component_in_number": { - "path": "${{parent.inputs.component_in_number}}" - }, - "component_in_path": { - "path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}" - }, - }, - "outputs": { - "sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}" + "component_in_number": {"path": "${{parent.inputs.component_in_number}}"}, + "component_in_path": {"path": "${{parent.jobs.node1.outputs.sub_pipeline_out}}"}, }, + "outputs": {"sub_pipeline_out": "${{parent.outputs.sub_pipeline_out}}"}, "type": "pipeline", }, }, @@ -2361,9 +2140,7 @@ def my_pipeline(component_in_number: int, component_in_path: str): assert pipeline_job_0._to_rest_object() == pipeline_job_1._to_rest_object() def test_dsl_pipeline_with_component_from_container_data(self): - container_rest_object = ComponentContainerData( - properties=ComponentContainerDetails() - ) + container_rest_object = ComponentContainerData(properties=ComponentContainerDetails()) # Set read only fields container_rest_object.name = "component" container_rest_object.id = "mock_id" @@ -2386,19 +2163,13 @@ def test_data_as_pipeline_inputs(self): def pipeline_func(component_in_path): node = component_func( component_in_number=1, - component_in_path=Data( - name="test", version="1", type=AssetTypes.MLTABLE - ), + component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE), ) node.compute = "cpu-cluster" - node2 = component_func( - component_in_number=1, component_in_path=component_in_path - ) + node2 = component_func(component_in_number=1, component_in_path=component_in_path) node2.compute = "cpu-cluster" - pipeline_job = pipeline_func( - component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE) - ) + pipeline_job = pipeline_func(component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE)) result = pipeline_job._validate() assert result._to_dict() == {"result": "Succeeded"} @@ -2408,28 +2179,18 @@ def test_pipeline_node_identity_with_component(self): @dsl.pipeline def pipeline_func(component_in_path): - node1 = component_func( - component_in_number=1, component_in_path=component_in_path - ) + node1 = component_func(component_in_number=1, component_in_path=component_in_path) node1.identity = AmlTokenConfiguration() - node2 = component_func( - component_in_number=1, component_in_path=component_in_path - ) + node2 = component_func(component_in_number=1, component_in_path=component_in_path) node2.identity = UserIdentityConfiguration() - node3 = component_func( - component_in_number=1, component_in_path=component_in_path - ) + node3 = component_func(component_in_number=1, component_in_path=component_in_path) node3.identity = ManagedIdentityConfiguration() - pipeline = pipeline_func( - component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE) - ) + pipeline = pipeline_func(component_in_path=Data(name="test", version="1", type=AssetTypes.MLTABLE)) omit_fields = ["jobs.*.componentId", "jobs.*._source"] - actual_dict = omit_with_wildcard( - as_attribute_dict(pipeline._to_rest_object())["properties"], *omit_fields - ) + actual_dict = omit_with_wildcard(as_attribute_dict(pipeline._to_rest_object())["properties"], *omit_fields) assert actual_dict["jobs"] == { "node1": { @@ -2472,12 +2233,8 @@ def pipeline_func(component_in_path): def test_pipeline_with_non_pipeline_inputs(self): component_yaml = components_dir / "helloworld_component.yml" - component_func1 = load_component( - source=component_yaml, params_override=[{"name": "component_name_1"}] - ) - component_func2 = load_component( - source=component_yaml, params_override=[{"name": "component_name_2"}] - ) + component_func1 = load_component(source=component_yaml, params_override=[{"name": "component_name_1"}]) + component_func2 = load_component(source=component_yaml, params_override=[{"name": "component_name_2"}]) @dsl.pipeline( non_pipeline_inputs=[ @@ -2497,48 +2254,29 @@ def pipeline_func( ): assert param_with_default == 1 assert param_with_annotation == {"mock": "dict"} - component_func1( - component_in_number=job_in_number, component_in_path=job_in_path - ) - component_func2( - component_in_number=other_params, component_in_path=job_in_path - ) + component_func1(component_in_number=job_in_number, component_in_path=job_in_path) + component_func2(component_in_number=other_params, component_in_path=job_in_path) if is_add_component: - component_func2( - component_in_number=other_params, component_in_path=job_in_path - ) + component_func2(component_in_number=other_params, component_in_path=job_in_path) - pipeline = pipeline_func( - 10, Input(path="/a/path/on/ds"), 15, False, {"mock": "dict"} - ) + pipeline = pipeline_func(10, Input(path="/a/path/on/ds"), 15, False, {"mock": "dict"}) assert len(pipeline.jobs) == 2 assert "other_params" not in pipeline.inputs assert isinstance( pipeline.jobs[component_func1.name].inputs["component_in_number"]._data, PipelineInput, ) - assert ( - pipeline.jobs[component_func2.name].inputs["component_in_number"]._data - == 15 - ) + assert pipeline.jobs[component_func2.name].inputs["component_in_number"]._data == 15 - pipeline = pipeline_func( - 10, Input(path="/a/path/on/ds"), 15, True, {"mock": "dict"} - ) + pipeline = pipeline_func(10, Input(path="/a/path/on/ds"), 15, True, {"mock": "dict"}) assert len(pipeline.jobs) == 3 @dsl.pipeline(non_pipeline_parameters=["other_params", "is_add_component"]) def pipeline_func(job_in_number, job_in_path, other_params, is_add_component): - component_func1( - component_in_number=job_in_number, component_in_path=job_in_path - ) - component_func2( - component_in_number=other_params, component_in_path=job_in_path - ) + component_func1(component_in_number=job_in_number, component_in_path=job_in_path) + component_func2(component_in_number=other_params, component_in_path=job_in_path) if is_add_component: - component_func2( - component_in_number=other_params, component_in_path=job_in_path - ) + component_func2(component_in_number=other_params, component_in_path=job_in_path) pipeline = pipeline_func(10, Input(path="/a/path/on/ds"), 15, True) assert len(pipeline.jobs) == 3 @@ -2550,10 +2288,7 @@ def pipeline_func(): with pytest.raises(UserErrorException) as error_info: pipeline_func() - assert ( - "Type of 'non_pipeline_parameter' in dsl.pipeline should be a list of string" - in str(error_info) - ) + assert "Type of 'non_pipeline_parameter' in dsl.pipeline should be a list of string" in str(error_info) @dsl.pipeline(non_pipeline_inputs=["non_exist_param1", "non_exist_param2"]) def pipeline_func(): @@ -2568,21 +2303,13 @@ def pipeline_func(): def test_component_func_as_non_pipeline_inputs(self): component_yaml = components_dir / "helloworld_component.yml" - component_func1 = load_component( - source=component_yaml, params_override=[{"name": "component_name_1"}] - ) - component_func2 = load_component( - source=component_yaml, params_override=[{"name": "component_name_2"}] - ) + component_func1 = load_component(source=component_yaml, params_override=[{"name": "component_name_1"}]) + component_func2 = load_component(source=component_yaml, params_override=[{"name": "component_name_2"}]) @dsl.pipeline(non_pipeline_inputs=["component_func"]) def pipeline_func(job_in_number, job_in_path, component_func): - component_func1( - component_in_number=job_in_number, component_in_path=job_in_path - ) - component_func( - component_in_number=job_in_number, component_in_path=job_in_path - ) + component_func1(component_in_number=job_in_number, component_in_path=job_in_path) + component_func(component_in_number=job_in_number, component_in_path=job_in_path) pipeline = pipeline_func( job_in_number=10, @@ -2628,32 +2355,16 @@ def root_pipeline(component_in_number: int, component_in_path: Input, **kwargs): ) node_with_arg_kwarg = pipeline_with_variable_args(**kwargs) - pipeline = root_pipeline( - 10, data, component_in_number1=12, component_in_path1=data - ) + pipeline = root_pipeline(10, data, component_in_number1=12, component_in_path1=data) - assert ( - pipeline.component.inputs["component_in_number"].description - == "component_in_number description" - ) - assert ( - pipeline.component.inputs["component_in_path"].description - == "component_in_path description" - ) - assert ( - pipeline.component.inputs["component_in_number1"].description - == "component_in_number1 description" - ) - assert ( - pipeline.component.inputs["component_in_path1"].description - == "component_in_path1 description" - ) + assert pipeline.component.inputs["component_in_number"].description == "component_in_number description" + assert pipeline.component.inputs["component_in_path"].description == "component_in_path description" + assert pipeline.component.inputs["component_in_number1"].description == "component_in_number1 description" + assert pipeline.component.inputs["component_in_path1"].description == "component_in_path1 description" omit_fields = ["jobs.*.componentId", "jobs.*._source"] actual_dict = omit_with_wildcard( - json.loads( - json.dumps(as_attribute_dict(pipeline._to_rest_object()), default=str) - )["properties"], + json.loads(json.dumps(as_attribute_dict(pipeline._to_rest_object()), default=str))["properties"], *omit_fields, ) @@ -2727,9 +2438,7 @@ def pipeline_with_variable_args(*custorm_args): UnsupportedParameterKindError, match="dsl pipeline does not accept \*args or \*\*kwargs as parameters\.", ): - root_pipeline( - 10, data, 11, data, component_in_number1=11, component_in_path1=data - ) + root_pipeline(10, data, 11, data, component_in_number1=11, component_in_path1=data) def test_pipeline_with_dumplicate_variable_inputs(self): @dsl.pipeline @@ -2744,9 +2453,7 @@ def pipeline_with_variable_args(key_1: int, **kargs): def test_pipeline_with_output_binding_in_dynamic_args(self): hello_world_func = load_component(components_dir / "helloworld_component.yml") - hello_world_no_inputs_func = load_component( - components_dir / "helloworld_component_no_inputs.yml" - ) + hello_world_no_inputs_func = load_component(components_dir / "helloworld_component_no_inputs.yml") @dsl.pipeline def pipeline_func_consume_dynamic_arg(**kwargs): @@ -2777,9 +2484,7 @@ def pipeline_func_consume_expression(int_param: int): node1 = component_func() node2 = component_func() expression = int_param == 0 - control_node = condition( - expression, true_block=node1, false_block=node2 - ) # noqa: F841 + control_node = condition(expression, true_block=node1, false_block=node2) # noqa: F841 pipeline_job = pipeline_func_consume_expression(int_param=1) assert pipeline_job.jobs["control_node"]._to_rest_object() == { @@ -2796,16 +2501,11 @@ def pipeline_func_consume_invalid_component(): node0 = component_func() node1 = component_func() node2 = component_func() - control_node = condition( - node0, true_block=node1, false_block=node2 - ) # noqa: F841 + control_node = condition(node0, true_block=node1, false_block=node2) # noqa: F841 with pytest.raises(UserErrorException) as e: pipeline_func_consume_invalid_component() - assert ( - str(e.value) - == "Exactly one output is expected for condition node, 0 outputs found." - ) + assert str(e.value) == "Exactly one output is expected for condition node, 0 outputs found." def test_dsl_pipeline_with_spark_hobo(self) -> None: add_greeting_column_func = load_component( @@ -2851,18 +2551,14 @@ def spark_pipeline_from_yaml(iris_data): spark_node_dict_from_rest = regenerated_spark_node._to_dict() omit_fields = [] - assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit( - spark_node_dict_from_rest, *omit_fields - ) + assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit(spark_node_dict_from_rest, *omit_fields) omit_fields = [ "jobs.add_greeting_column.componentId", "jobs.count_by_row.componentId", "jobs.add_greeting_column.properties", "jobs.count_by_row.properties", ] - actual_job = pydash.omit( - as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields - ) + actual_job = pydash.omit(as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields) assert actual_job == { "description": "submit a pipeline with spark job", "properties": {}, @@ -2910,8 +2606,7 @@ def spark_pipeline_from_yaml(iris_data): }, "count_by_row": { "_source": "YAML.COMPONENT", - "args": "--file_input ${{inputs.file_input}} " - "--output ${{outputs.output}}", + "args": "--file_input ${{inputs.file_input}} " "--output ${{outputs.output}}", "conf": { "spark.driver.cores": 2, "spark.driver.memory": "1g", @@ -2951,9 +2646,7 @@ def spark_pipeline_from_yaml(iris_data): } def test_dsl_pipeline_with_data_transfer_copy_node(self) -> None: - merge_files = load_component( - "./tests/test_configs/components/data_transfer/copy_files.yaml" - ) + merge_files = load_component("./tests/test_configs/components/data_transfer/copy_files.yaml") @dsl.pipeline(description="submit a pipeline with data transfer copy job") def data_transfer_copy_pipeline_from_yaml(folder1): @@ -2966,9 +2659,7 @@ def data_transfer_copy_pipeline_from_yaml(folder1): type=AssetTypes.URI_FOLDER, ), ) - dsl_pipeline.outputs.output.path = ( - "azureml://datastores/my_blob/paths/merged_blob" - ) + dsl_pipeline.outputs.output.path = "azureml://datastores/my_blob/paths/merged_blob" data_transfer_copy_node = dsl_pipeline.jobs["copy_files_node"] job_data_path_input = data_transfer_copy_node.inputs["folder1"]._meta @@ -2976,13 +2667,9 @@ def data_transfer_copy_pipeline_from_yaml(folder1): data_transfer_copy_node_dict = data_transfer_copy_node._to_dict() data_transfer_copy_node_rest_obj = data_transfer_copy_node._to_rest_object() - regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object( - data_transfer_copy_node_rest_obj - ) + regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object(data_transfer_copy_node_rest_obj) - data_transfer_copy_node_dict_from_rest = ( - regenerated_data_transfer_copy_node._to_dict() - ) + data_transfer_copy_node_dict_from_rest = regenerated_data_transfer_copy_node._to_dict() omit_fields = [] assert pydash.omit(data_transfer_copy_node_dict, *omit_fields) == pydash.omit( data_transfer_copy_node_dict_from_rest, *omit_fields @@ -2990,9 +2677,7 @@ def data_transfer_copy_pipeline_from_yaml(folder1): omit_fields = [ "jobs.copy_files_node.componentId", ] - actual_job = pydash.omit( - as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields - ) + actual_job = pydash.omit(as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields) assert actual_job == { "description": "submit a pipeline with data transfer copy job", "display_name": "data_transfer_copy_pipeline_from_yaml", @@ -3037,9 +2722,7 @@ def data_transfer_copy_pipeline_from_yaml(folder1): } def test_dsl_pipeline_with_data_transfer_merge_node(self) -> None: - merge_files = load_component( - "./tests/test_configs/components/data_transfer/merge_files.yaml" - ) + merge_files = load_component("./tests/test_configs/components/data_transfer/merge_files.yaml") @dsl.pipeline(description="submit a pipeline with data transfer copy job") def data_transfer_copy_pipeline_from_yaml(folder1, folder2): @@ -3056,9 +2739,7 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): type=AssetTypes.URI_FOLDER, ), ) - dsl_pipeline.outputs.output.path = ( - "azureml://datastores/my_blob/paths/merged_blob" - ) + dsl_pipeline.outputs.output.path = "azureml://datastores/my_blob/paths/merged_blob" data_transfer_copy_node = dsl_pipeline.jobs["merge_files_node"] job_data_path_input = data_transfer_copy_node.inputs["folder1"]._meta @@ -3066,13 +2747,9 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): data_transfer_copy_node_dict = data_transfer_copy_node._to_dict() data_transfer_copy_node_rest_obj = data_transfer_copy_node._to_rest_object() - regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object( - data_transfer_copy_node_rest_obj - ) + regenerated_data_transfer_copy_node = DataTransferCopy._from_rest_object(data_transfer_copy_node_rest_obj) - data_transfer_copy_node_dict_from_rest = ( - regenerated_data_transfer_copy_node._to_dict() - ) + data_transfer_copy_node_dict_from_rest = regenerated_data_transfer_copy_node._to_dict() omit_fields = [] assert pydash.omit(data_transfer_copy_node_dict, *omit_fields) == pydash.omit( data_transfer_copy_node_dict_from_rest, *omit_fields @@ -3080,9 +2757,7 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): omit_fields = [ "jobs.merge_files_node.componentId", ] - actual_job = pydash.omit( - as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields - ) + actual_job = pydash.omit(as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields) assert actual_job == { "description": "submit a pipeline with data transfer copy job", "display_name": "data_transfer_copy_pipeline_from_yaml", @@ -3135,9 +2810,7 @@ def data_transfer_copy_pipeline_from_yaml(folder1, folder2): } def test_dsl_pipeline_with_data_transfer_import_component(self) -> None: - s3_blob = load_component( - "./tests/test_configs/components/data_transfer/import_file_to_blob.yaml" - ) + s3_blob = load_component("./tests/test_configs/components/data_transfer/import_file_to_blob.yaml") path_source_s3 = "test1/*" connection_target = "azureml:my-s3-connection" source = { @@ -3153,18 +2826,12 @@ def data_transfer_copy_pipeline_from_yaml(): s3_blob(source=source) data_transfer_copy_pipeline_from_yaml() - assert "DataTransfer component is not callable for import task." in str( - e.value - ) + assert "DataTransfer component is not callable for import task." in str(e.value) def test_dsl_pipeline_with_data_transfer_export_component(self) -> None: - blob_azuresql = load_component( - "./tests/test_configs/components/data_transfer/export_blob_to_database.yaml" - ) + blob_azuresql = load_component("./tests/test_configs/components/data_transfer/export_blob_to_database.yaml") - my_cosmos_folder = Input( - type=AssetTypes.URI_FILE, path="/data/testFile_ForSqlDB.parquet" - ) + my_cosmos_folder = Input(type=AssetTypes.URI_FILE, path="/data/testFile_ForSqlDB.parquet") connection_target_azuresql = "azureml:my_export_azuresqldb_connection" table_name = "dbo.Persons" sink = { @@ -3181,9 +2848,7 @@ def data_transfer_copy_pipeline_from_yaml(): blob_azuresql_node.sink = sink data_transfer_copy_pipeline_from_yaml() - assert "DataTransfer component is not callable for import task." in str( - e.value - ) + assert "DataTransfer component is not callable for import task." in str(e.value) def test_node_sweep_with_optional_input(self) -> None: component_yaml = components_dir / "helloworld_component_optional_input.yml" @@ -3205,21 +2870,15 @@ def pipeline_func(): ) pipeline_job = pipeline_func() - jobs_dict = as_attribute_dict(pipeline_job._to_rest_object())["properties"][ - "jobs" - ] + jobs_dict = as_attribute_dict(pipeline_job._to_rest_object())["properties"]["jobs"] # for node1 inputs, should contain required_input and optional_input; # while for node2 and node_sweep, should only contain required_input. assert jobs_dict["node1"]["inputs"] == { "required_input": {"job_input_type": "literal", "value": "1"}, "optional_input": {"job_input_type": "literal", "value": "2"}, } - assert jobs_dict["node2"]["inputs"] == { - "required_input": {"job_input_type": "literal", "value": "1"} - } - assert jobs_dict["node_sweep"]["inputs"] == { - "required_input": {"job_input_type": "literal", "value": "1"} - } + assert jobs_dict["node2"]["inputs"] == {"required_input": {"job_input_type": "literal", "value": "1"}} + assert jobs_dict["node_sweep"]["inputs"] == {"required_input": {"job_input_type": "literal", "value": "1"}} def test_dsl_pipeline_unprovided_required_input(self): component_yaml = components_dir / "helloworld_component_optional_input.yml" @@ -3234,8 +2893,7 @@ def pipeline_func(required_input: int, optional_input: int = 2): pipeline_job.settings.default_compute = "cpu-cluster" validate_result = pipeline_job._validate() assert validate_result.error_messages == { - "inputs.required_input": "Required input 'required_input' for pipeline " - "'pipeline_func' not provided." + "inputs.required_input": "Required input 'required_input' for pipeline " "'pipeline_func' not provided." } validate_result = pipeline_job.component._validate() @@ -3259,12 +2917,8 @@ def outer_pipeline(): validate_result = pipeline_job._validate() assert validate_result.passed - def test_dsl_pipeline_with_unprovided_pipeline_optional_input( - self, client: MLClient - ) -> None: - component_func = load_component( - source=str(components_dir / "default_optional_component.yml") - ) + def test_dsl_pipeline_with_unprovided_pipeline_optional_input(self, client: MLClient) -> None: + component_func = load_component(source=str(components_dir / "default_optional_component.yml")) # optional pipeline input binding to optional node input @dsl.pipeline() @@ -3304,12 +2958,8 @@ def pipeline_func( validate_result = pipeline_job._validate() assert validate_result.error_messages == {} - def test_dsl_pipeline_with_unprovided_pipeline_required_input( - self, client: MLClient - ) -> None: - component_func = load_component( - source=str(components_dir / "default_optional_component.yml") - ) + def test_dsl_pipeline_with_unprovided_pipeline_required_input(self, client: MLClient) -> None: + component_func = load_component(source=str(components_dir / "default_optional_component.yml")) # required pipeline input binding to optional node input @dsl.pipeline() @@ -3327,8 +2977,7 @@ def pipeline_func(required_input: Input(optional=False, type="uri_file")): pipeline_job.settings.default_compute = "cpu-cluster" validate_result = pipeline_job._validate() assert validate_result.error_messages == { - "inputs.required_input": "Required input 'required_input' for pipeline " - "'pipeline_func' not provided." + "inputs.required_input": "Required input 'required_input' for pipeline " "'pipeline_func' not provided." } # required pipeline parameter binding to optional node parameter @@ -3351,19 +3000,14 @@ def pipeline_func( pipeline_job.settings.default_compute = "cpu-cluster" validate_result = pipeline_job._validate() assert validate_result.error_messages == { - "inputs.required_param": "Required input 'required_param' for pipeline " - "'pipeline_func' not provided.", + "inputs.required_param": "Required input 'required_param' for pipeline " "'pipeline_func' not provided.", "inputs.required_param_duplicate": "Required input 'required_param_duplicate' for pipeline " "'pipeline_func' not provided.", } # required pipeline parameter with default value binding to optional node parameter @dsl.pipeline() - def pipeline_func( - required_param: Input( - optional=False, type="string", default="pipeline_required_param" - ) - ): + def pipeline_func(required_param: Input(optional=False, type="string", default="pipeline_required_param")): component_func( required_input=Input( type="uri_file", @@ -3379,12 +3023,8 @@ def pipeline_func( validate_result = pipeline_job._validate() assert validate_result.error_messages == {} - def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_optional_input( - self, client: MLClient - ) -> None: - component_func = load_component( - source=str(components_dir / "default_optional_component.yml") - ) + def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_optional_input(self, client: MLClient) -> None: + component_func = load_component(source=str(components_dir / "default_optional_component.yml")) # optional pipeline input binding to optional node input @dsl.pipeline() @@ -3432,12 +3072,8 @@ def root_pipeline(): validate_result = pipeline_job._validate() assert validate_result.error_messages == {} - def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_required_input( - self, client: MLClient - ) -> None: - component_func = load_component( - source=str(components_dir / "default_optional_component.yml") - ) + def test_dsl_pipeline_with_pipeline_component_unprovided_pipeline_required_input(self, client: MLClient) -> None: + component_func = load_component(source=str(components_dir / "default_optional_component.yml")) # required pipeline input binding to optional node input @dsl.pipeline() @@ -3500,11 +3136,7 @@ def root_pipeline(): # required pipeline parameter with default value binding to optional node parameter @dsl.pipeline() - def subgraph_pipeline( - required_parameter: Input( - optional=False, type="string", default="subgraph_pipeline" - ) - ): + def subgraph_pipeline(required_parameter: Input(optional=False, type="string", default="subgraph_pipeline")): component_func( required_input=Input( type="uri_file", @@ -3524,18 +3156,12 @@ def root_pipeline(): assert validate_result.error_messages == {} def test_dsl_pipeline_with_return_annotation(self, client: MLClient) -> None: - hello_world_component_yaml = ( - "./tests/test_configs/components/helloworld_component.yml" - ) + hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() - def my_pipeline() -> ( - Output(type="uri_folder", description="new description", mode="upload") - ): - node = hello_world_component_func( - component_in_path=Input(path="path/on/ds"), component_in_number=10 - ) + def my_pipeline() -> Output(type="uri_folder", description="new description", mode="upload"): + node = hello_world_component_func(component_in_path=Input(path="path/on/ds"), component_in_number=10) return {"output": node.outputs.component_out_path} pipeline_job = my_pipeline() @@ -3546,24 +3172,15 @@ def my_pipeline() -> ( "mode": "Upload", } } - assert ( - as_attribute_dict(pipeline_job._to_rest_object())["properties"]["outputs"] - == expected_outputs - ) + assert as_attribute_dict(pipeline_job._to_rest_object())["properties"]["outputs"] == expected_outputs def test_dsl_pipeline_run_settings(self) -> None: - hello_world_component_yaml = ( - "./tests/test_configs/components/helloworld_component.yml" - ) + hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml" hello_world_component_func = load_component(source=hello_world_component_yaml) @dsl.pipeline() - def my_pipeline() -> ( - Output(type="uri_folder", description="new description", mode="upload") - ): - node = hello_world_component_func( - component_in_path=Input(path="path/on/ds"), component_in_number=10 - ) + def my_pipeline() -> Output(type="uri_folder", description="new description", mode="upload"): + node = hello_world_component_func(component_in_path=Input(path="path/on/ds"), component_in_number=10) return {"output": node.outputs.component_out_path} pipeline_job: PipelineJob = my_pipeline() @@ -3581,9 +3198,7 @@ def my_pipeline() -> ( } def test_register_output_without_name_sdk(self): - component = load_component( - source="./tests/test_configs/components/helloworld_component.yml" - ) + component = load_component(source="./tests/test_configs/components/helloworld_component.yml") component_input = Input( type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", @@ -3598,9 +3213,7 @@ def register_node_output(): pipeline.settings.default_compute = "azureml:cpu-cluster" with pytest.raises(UserErrorException) as e: pipeline._validate() - assert "Output name is required when output version is specified." in str( - e.value - ) + assert "Output name is required when output version is specified." in str(e.value) @dsl.pipeline() def register_pipeline_output(): @@ -3612,14 +3225,10 @@ def register_pipeline_output(): pipeline.settings.default_compute = "azureml:cpu-cluster" with pytest.raises(UserErrorException) as e: pipeline._validate() - assert "Output name is required when output version is specified." in str( - e.value - ) + assert "Output name is required when output version is specified." in str(e.value) def test_register_output_with_invalid_name_sdk(self): - component = load_component( - source="./tests/test_configs/components/helloworld_component.yml" - ) + component = load_component(source="./tests/test_configs/components/helloworld_component.yml") component_input = Input( type="uri_file", path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv", @@ -3643,9 +3252,7 @@ def register_node_output(): def test_pipeline_output_settings_copy(self): component_yaml = components_dir / "helloworld_component.yml" params_override = [{"outputs": {"component_out_path": {"type": "uri_file"}}}] - component_func1 = load_component( - source=component_yaml, params_override=params_override - ) + component_func1 = load_component(source=component_yaml, params_override=params_override) @dsl.pipeline() def my_pipeline(): @@ -3692,9 +3299,7 @@ def my_pipeline(): def test_node_path_promotion(self): component_yaml = components_dir / "helloworld_component.yml" params_override = [{"outputs": {"component_out_path": {"type": "uri_file"}}}] - component_func1 = load_component( - source=component_yaml, params_override=params_override - ) + component_func1 = load_component(source=component_yaml, params_override=params_override) @dsl.pipeline() def my_pipeline(): @@ -3734,9 +3339,7 @@ def outer_pipeline(): def test_node_output_type_promotion(self): component_yaml = components_dir / "helloworld_component.yml" params_override = [{"outputs": {"component_out_path": {"type": "uri_file"}}}] - component_func1 = load_component( - source=component_yaml, params_override=params_override - ) + component_func1 = load_component(source=component_yaml, params_override=params_override) # without node level setting, node should have same type with component @dsl.pipeline() @@ -3748,10 +3351,7 @@ def my_pipeline(): pipeline_job1 = my_pipeline() assert pipeline_job1.outputs.component_out_path.type == "uri_file" pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] - assert ( - pipeline_dict["outputs"]["component_out_path"]["job_output_type"] - == "uri_file" - ) + assert pipeline_dict["outputs"]["component_out_path"]["job_output_type"] == "uri_file" # when node level has output setting except type, node should have same type with component @dsl.pipeline() @@ -3788,10 +3388,7 @@ def my_pipeline(): pipeline_job1 = my_pipeline() # assert pipeline_job1.outputs.component_out_path.type == "mlflow_model" pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] - assert ( - pipeline_dict["outputs"]["component_out_path"]["job_output_type"] - == "mlflow_model" - ) + assert pipeline_dict["outputs"]["component_out_path"]["job_output_type"] == "mlflow_model" # when pipeline level has setting, node should respect the setting @dsl.pipeline() @@ -3806,19 +3403,12 @@ def my_pipeline(): pipeline_job1.outputs.component_out_path.type = "custom_model" assert pipeline_job1.outputs.component_out_path.type == "custom_model" pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] - assert ( - pipeline_dict["outputs"]["component_out_path"]["job_output_type"] - == "custom_model" - ) + assert pipeline_dict["outputs"]["component_out_path"]["job_output_type"] == "custom_model" def test_node_output_mode_promotion(self): component_yaml = components_dir / "helloworld_component.yml" - params_override = [ - {"outputs": {"component_out_path": {"mode": "mount", "type": "uri_file"}}} - ] - component_func1 = load_component( - source=component_yaml, params_override=params_override - ) + params_override = [{"outputs": {"component_out_path": {"mode": "mount", "type": "uri_file"}}}] + component_func1 = load_component(source=component_yaml, params_override=params_override) # without node level setting, node should have same type with component @dsl.pipeline() @@ -3830,9 +3420,7 @@ def my_pipeline(): pipeline_job1 = my_pipeline() # assert pipeline_job1.outputs.component_out_path.mode == "mount" pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object())["properties"] - assert ( - pipeline_dict["outputs"]["component_out_path"]["mode"] == "ReadWriteMount" - ) + assert pipeline_dict["outputs"]["component_out_path"]["mode"] == "ReadWriteMount" pipeline_dict = as_attribute_dict(pipeline_job1._to_rest_object()) # type will be preserved & mode will be promoted to pipeline level assert pipeline_dict["properties"]["outputs"]["component_out_path"] == { @@ -3899,9 +3487,7 @@ def my_pipeline(): "job_output_type": "uri_file", "uri": "path", } - assert pipeline_dict["properties"]["jobs"]["node1"]["outputs"][ - "component_out_path" - ] == { + assert pipeline_dict["properties"]["jobs"]["node1"]["outputs"]["component_out_path"] == { "type": "literal", "value": "${{parent.outputs.component_out_path}}", } @@ -3924,24 +3510,14 @@ def test_validate_pipeline_node_io_name_has_keyword(self, caplog): "can only be accessed with '{node_name}.{io}s[\"{io_name}\"]'" ) assert caplog.messages == [ - warning_template.format( - io_name="__contains__", io="output", node_name="node" - ), - warning_template.format( - io_name="items", io="output", node_name="upstream_node" - ), - warning_template.format( - io_name="keys", io="input", node_name="downstream_node" - ), - warning_template.format( - io_name="__hash__", io="output", node_name="pipeline_component_func" - ), + warning_template.format(io_name="__contains__", io="output", node_name="node"), + warning_template.format(io_name="items", io="output", node_name="upstream_node"), + warning_template.format(io_name="keys", io="input", node_name="downstream_node"), + warning_template.format(io_name="__hash__", io="output", node_name="pipeline_component_func"), ] def test_pass_pipeline_inpute_to_environment_variables(self): - component_yaml = ( - r"./tests/test_configs/components/helloworld_component_no_paths.yml" - ) + component_yaml = r"./tests/test_configs/components/helloworld_component_no_paths.yml" component_func = load_component(source=component_yaml) @dsl.pipeline( @@ -3960,9 +3536,7 @@ def pipeline(job_in_number: int, environment_variables: str): ) def test_node_name_underscore(self): - component_yaml = ( - r"./tests/test_configs/components/helloworld_component_no_paths.yml" - ) + component_yaml = r"./tests/test_configs/components/helloworld_component_no_paths.yml" component_func = load_component(source=component_yaml) @dsl.pipeline() @@ -3970,9 +3544,7 @@ def my_pipeline(): _ = component_func(component_in_number=1) pipeline_job = my_pipeline() - assert pipeline_job.jobs.keys() == { - "microsoftsamplescommandcomponentbasic_nopaths_test" - } + assert pipeline_job.jobs.keys() == {"microsoftsamplescommandcomponentbasic_nopaths_test"} assert ( pipeline_job.jobs["microsoftsamplescommandcomponentbasic_nopaths_test"].name == "microsoftsamplescommandcomponentbasic_nopaths_test" @@ -4023,9 +3595,7 @@ def my_pipeline(): assert pipeline_job.jobs.keys() == {"node", "node_1", "node_2", "node_3"} def test_pipeline_input_binding_limits_timeout(self): - component_yaml = ( - r"./tests/test_configs/components/helloworld_component_no_paths.yml" - ) + component_yaml = r"./tests/test_configs/components/helloworld_component_no_paths.yml" component_func = load_component(source=component_yaml) @dsl.pipeline @@ -4040,13 +3610,8 @@ def my_pipeline(timeout) -> PipelineJob: pipeline = my_pipeline(2) pipeline.settings.default_compute = "cpu-cluster" pipeline_dict = as_attribute_dict(pipeline._to_rest_object()) - assert ( - pipeline_dict["properties"]["jobs"]["node_0"]["limits"]["timeout"] - == "${{parent.inputs.timeout}}" - ) - assert ( - pipeline_dict["properties"]["jobs"]["node_1"]["limits"]["timeout"] == "PT1S" - ) + assert pipeline_dict["properties"]["jobs"]["node_0"]["limits"]["timeout"] == "${{parent.inputs.timeout}}" + assert pipeline_dict["properties"]["jobs"]["node_1"]["limits"]["timeout"] == "PT1S" @pytest.mark.parametrize( "component_path, fields_to_test, fake_inputs", @@ -4054,9 +3619,7 @@ def my_pipeline(timeout) -> PipelineJob: pytest.param( "./tests/test_configs/components/helloworld_component.yml", { - "resources.instance_count": JobResourceConfiguration( - instance_count=1 - ), + "resources.instance_count": JobResourceConfiguration(instance_count=1), # do not support data binding expression on queue_settings as it involves value mapping in # _to_rest_object # "queue_settings.priority": QueueSettings(priority="low"), @@ -4067,9 +3630,7 @@ def my_pipeline(timeout) -> PipelineJob: pytest.param( "./tests/test_configs/components/basic_parallel_component_score.yml", { - "resources.instance_count": JobResourceConfiguration( - instance_count=1 - ), + "resources.instance_count": JobResourceConfiguration(instance_count=1), }, {}, id="parallel.resources", @@ -4077,9 +3638,7 @@ def my_pipeline(timeout) -> PipelineJob: pytest.param( "./tests/test_configs/dsl_pipeline/spark_job_in_pipeline/add_greeting_column_component.yml", { - "resources.runtime_version": SparkResourceConfiguration( - runtime_version="2.4" - ), + "resources.runtime_version": SparkResourceConfiguration(runtime_version="2.4"), # seems that `type` is the only field for `identity` and hasn't been exposed to user # "identity.type": AmlTokenConfiguration(), # spark.entry doesn't support overwrite from node level for now, more details in @@ -4140,9 +3699,7 @@ def pipeline1(): node1 = component_func() node1.name = "node1" assert get_predecessors(node1) == [] - node2 = component_func( - input1=node1.outputs.output1, input2=node1.outputs.output2 - ) + node2 = component_func(input1=node1.outputs.output1, input2=node1.outputs.output2) assert ["node1"] == [n.name for n in get_predecessors(node2)] return node1.outputs @@ -4159,9 +3716,7 @@ def pipeline2(): node2.name = "node2" assert get_predecessors(node2) == [] - node2 = component_func( - input1=node1.outputs.output1, input2=node2.outputs.output2 - ) + node2 = component_func(input1=node1.outputs.output1, input2=node2.outputs.output2) assert ["node1", "node2"] == [n.name for n in get_predecessors(node2)] return node2.outputs @@ -4171,9 +3726,7 @@ def pipeline2(): @dsl.pipeline() def pipeline3(): sub1 = pipeline1() - node3 = component_func( - input1=sub1.outputs.output1, input2=sub1.outputs.output2 - ) + node3 = component_func(input1=sub1.outputs.output1, input2=sub1.outputs.output2) assert ["node1"] == [n.name for n in get_predecessors(node3)] pipeline3() @@ -4183,9 +3736,7 @@ def pipeline3(): def pipeline4(): sub1 = pipeline1() sub2 = pipeline2() - node3 = component_func( - input1=sub1.outputs.output1, input2=sub2.outputs.output2 - ) + node3 = component_func(input1=sub1.outputs.output1, input2=sub2.outputs.output2) assert ["node1", "node2"] == [n.name for n in get_predecessors(node3)] pipeline4() @@ -4247,9 +3798,7 @@ def pipeline8(): pipeline8() def test_pipeline_singularity_strong_type(self, mock_singularity_arm_id: str): - component_yaml = ( - "./tests/test_configs/components/helloworld_component_singularity.yml" - ) + component_yaml = "./tests/test_configs/components/helloworld_component_singularity.yml" component_func = load_component(component_yaml) instance_type = "Singularity.ND40rs_v2" @@ -4258,28 +3807,16 @@ def test_pipeline_singularity_strong_type(self, mock_singularity_arm_id: str): def pipeline_func(): # basic job_tier + Low priority basic_low_node = component_func() - basic_low_node.resources = JobResourceConfiguration( - instance_count=2, instance_type=instance_type - ) - basic_low_node.queue_settings = QueueSettings( - job_tier="basic", priority="low" - ) + basic_low_node.resources = JobResourceConfiguration(instance_count=2, instance_type=instance_type) + basic_low_node.queue_settings = QueueSettings(job_tier="basic", priority="low") # standard job_tier + Medium priority standard_medium_node = component_func() - standard_medium_node.resources = JobResourceConfiguration( - instance_count=2, instance_type=instance_type - ) - standard_medium_node.queue_settings = QueueSettings( - job_tier="standard", priority="medium" - ) + standard_medium_node.resources = JobResourceConfiguration(instance_count=2, instance_type=instance_type) + standard_medium_node.queue_settings = QueueSettings(job_tier="standard", priority="medium") # premium job_tier + High priority premium_high_node = component_func() - premium_high_node.resources = JobResourceConfiguration( - instance_count=2, instance_type=instance_type - ) - premium_high_node.queue_settings = QueueSettings( - job_tier="premium", priority="high" - ) + premium_high_node.resources = JobResourceConfiguration(instance_count=2, instance_type=instance_type) + premium_high_node.queue_settings = QueueSettings(job_tier="premium", priority="high") # properties node_with_properties = component_func() properties = {"Singularity": {"imageVersion": "", "interactive": False}} @@ -4302,9 +3839,7 @@ def pipeline_func(): "instance_type": instance_type, } # standard job_tier + Medium priority - standard_medium_node_dict = pipeline_job_dict["properties"]["jobs"][ - "standard_medium_node" - ] + standard_medium_node_dict = pipeline_job_dict["properties"]["jobs"]["standard_medium_node"] assert standard_medium_node_dict["queue_settings"] == { "job_tier": "Standard", "priority": 2, @@ -4314,9 +3849,7 @@ def pipeline_func(): "instance_type": instance_type, } # premium job_tier + High priority - premium_high_node_dict = pipeline_job_dict["properties"]["jobs"][ - "premium_high_node" - ] + premium_high_node_dict = pipeline_job_dict["properties"]["jobs"]["premium_high_node"] assert premium_high_node_dict["queue_settings"] == { "job_tier": "Premium", "priority": 3, @@ -4326,14 +3859,10 @@ def pipeline_func(): "instance_type": instance_type, } # properties - node_with_properties_dict = pipeline_job_dict["properties"]["jobs"][ - "node_with_properties" - ] + node_with_properties_dict = pipeline_job_dict["properties"]["jobs"]["node_with_properties"] assert node_with_properties_dict["resources"] == { "instance_count": 2, "instance_type": instance_type, # the mapping Singularity => AISuperComputer is expected - "properties": { - "AISuperComputer": {"imageVersion": "", "interactive": False} - }, + "properties": {"AISuperComputer": {"imageVersion": "", "interactive": False}}, } diff --git a/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py b/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py index 61eb51714df0..ea752e5f9de3 100644 --- a/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py +++ b/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py @@ -122,7 +122,7 @@ def mock_job_operation( operation_scope=mock_workspace_scope, operation_config=mock_operation_config, service_client_02_2023_preview=mock_aml_services_2023_02_01_preview, - service_client_01_2024_preview=mock_aml_services_2024_01_01_preview, + service_client_01_2024_preview_arm=mock_aml_services_2024_01_01_preview, service_client_10_2024_preview=mock_aml_services_2024_10_01_preview, service_client_01_2025_preview=mock_aml_services_2025_01_01_preview, service_client_run_history=mock_aml_services_run_history, @@ -139,19 +139,19 @@ class TestJobOperations: def test_list(self, mock_job_operation: JobOperations) -> None: mock_job_operation.list() expected = (mock_job_operation._resource_group_name, mock_job_operation._workspace_name) - assert expected in mock_job_operation.service_client_01_2024_preview.jobs.list.call_args + assert expected in mock_job_operation.service_client_01_2024_preview_arm.jobs.list.call_args @patch.dict(os.environ, {AZUREML_PRIVATE_FEATURES_ENV_VAR: "True"}) def test_list_private_preview(self, mock_job_operation: JobOperations) -> None: mock_job_operation.list() expected = (mock_job_operation._resource_group_name, mock_job_operation._workspace_name) - assert expected in mock_job_operation.service_client_01_2024_preview.jobs.list.call_args + assert expected in mock_job_operation.service_client_01_2024_preview_arm.jobs.list.call_args @patch.object(Job, "_from_rest_object") def test_get(self, mock_method, mock_job_operation: JobOperations) -> None: mock_method.return_value = Command(component=None) mock_job_operation.get("randon_name") - mock_job_operation.service_client_01_2024_preview.jobs.get.assert_called_once() + mock_job_operation.service_client_01_2024_preview_arm.jobs.get.assert_called_once() # use mock_component_hash to avoid passing a Mock object as client key @pytest.mark.usefixtures("mock_component_hash") @@ -190,7 +190,7 @@ def register_both_output(): def test_get_private_preview_flag_returns_latest(self, mock_method, mock_job_operation: JobOperations) -> None: mock_method.return_value = Command(component=None) mock_job_operation.get("random_name") - mock_job_operation.service_client_01_2024_preview.jobs.get.assert_called_once() + mock_job_operation.service_client_01_2024_preview_arm.jobs.get.assert_called_once() def test_stream_command_job(self, mock_job_operation: JobOperations) -> None: # setup @@ -201,7 +201,7 @@ def test_stream_command_job(self, mock_job_operation: JobOperations) -> None: mock_job_operation.stream("random_name") # check - mock_job_operation.service_client_01_2024_preview.jobs.get.assert_called_once() + mock_job_operation.service_client_01_2024_preview_arm.jobs.get.assert_called_once() mock_job_operation._get_workspace_url.assert_called_once() mock_job_operation._stream_logs_until_completion.assert_called_once() assert mock_job_operation._runs_operations_client._operation._client._base_url == "TheWorkSpaceUrl" @@ -256,14 +256,14 @@ def test_command_job_resolver_with_virtual_cluster(self, mock_job_operation: Job def test_archive(self, mock_method, mock_job_operation: JobOperations) -> None: mock_method.return_value = Command(component=None) mock_job_operation.archive(name="random_name") - mock_job_operation.service_client_01_2024_preview.jobs.get.assert_called_once() + mock_job_operation.service_client_01_2024_preview_arm.jobs.get.assert_called_once() mock_job_operation._operation_2023_02_preview.create_or_update.assert_called_once() @patch.object(Job, "_from_rest_object") def test_restore(self, mock_method, mock_job_operation: JobOperations) -> None: mock_method.return_value = Command(component=None) mock_job_operation.restore(name="random_name") - mock_job_operation.service_client_01_2024_preview.jobs.get.assert_called_once() + mock_job_operation.service_client_01_2024_preview_arm.jobs.get.assert_called_once() mock_job_operation._operation_2023_02_preview.create_or_update.assert_called_once() @pytest.mark.parametrize( From 9d7bf9fe3a272092a84c2a919d2146d7be915158 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 16:05:43 +0530 Subject: [PATCH 048/146] Remove RCA.md scratch doc from branch (keep local copy only) RCA.md was an investigation scratch file for ICM 829788361 and was unintentionally included via git add -A. It should not ship in the SDK source tree. --- sdk/ml/azure-ai-ml/RCA.md | 49 --------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/RCA.md diff --git a/sdk/ml/azure-ai-ml/RCA.md b/sdk/ml/azure-ai-ml/RCA.md deleted file mode 100644 index 435dc59519fc..000000000000 --- a/sdk/ml/azure-ai-ml/RCA.md +++ /dev/null @@ -1,49 +0,0 @@ -# ICM 829788361 — `az ml datastore create` JSON serialization failure - -## Summary - -`az ml datastore create` fails with `TypeError: Object of type Datastore is not JSON serializable` on `az ml` extension **v2.44.0** (bundles `azure-ai-ml` **1.34.0**). It works on **v2.43.0** (`azure-ai-ml` **1.33.0**). - -## Symptom - -```text -ERROR: Met error : Object of type Datastore is not JSON serializable -``` - -Raised by the generated REST client at `json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)`. - -## Root cause - -PR #47349 (`azure-ai-ml` 1.34.0) switched the datastore **operation** to the TypeSpec client (`v2024_10_01_preview_tsp`, later renamed `arm_ml_service`). Its `SdkJSONEncoder` only serializes TypeSpec models. The datastore **entity** `_to_rest_object()` was **not** migrated — it still builds a legacy msrest model (`v2023_04_01_preview.models.Datastore`). `SdkJSONEncoder` sees a non-TypeSpec object (`_is_model()` is `False`), falls through to `json.JSONEncoder.default`, and raises `TypeError`. Still unfixed on `main`. - -Key files: - -- `sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py` — `create_or_update` -- `sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py` — `_to_rest_object` -- `sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/arm_ml_service/_utils/model_base.py` — `SdkJSONEncoder` - -## Fix (Option A — minimal bridge) - -Implement in **azure-sdk-for-python** (`azure-ai-ml`), **not** azure-cli-extensions. The `az ml` extension is a thin wrapper and only needs to bump its bundled `azure-ai-ml` to the fixed release. - -In `_datastore_operations.py` `create_or_update`, pass the serialized wire dict instead of the msrest model (the TSP op accepts `Union[Datastore, JSON, IO[bytes]]`): - -```python -ds_request = datastore._to_rest_object() -datastore_resource = self._operation.create_or_update( - name=datastore.name, - resource_group_name=self._operation_scope.resource_group_name, - workspace_name=self._workspace_name, - body=ds_request.serialize(), # msrest model -> camelCase wire dict - skip_validation=True, -) -``` - -## Validation - -- Offline wire net: `sdk/ml/azure-ai-ml/tests/smoke_serialization/test_datastore_wire.py` — 6 cases pass today; must stay byte-identical after the change. -- Add before shipping: identity/None creds (customer case), certificate, on-prem; plus a `_from_rest_object()` round-trip. - -## Workaround - -Pin the extension: `az extension add --name ml --version 2.43.0`. From bd75dbf842d688e995e1fc768a35e18d274f2449 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 16:37:01 +0530 Subject: [PATCH 049/146] Flip aoai finetuning test RestFineTuningJob annotation to arm_ml_service Annotation-only import (fixture return type); arm_ml_service has FineTuningJob. Reduces direct v2024_01 test coupling. No behavior change. --- .../unittests/test_azure_openai_finetuning_job_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_azure_openai_finetuning_job_schema.py b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_azure_openai_finetuning_job_schema.py index 890d2998f0fc..637251f32e73 100644 --- a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_azure_openai_finetuning_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_azure_openai_finetuning_job_schema.py @@ -7,7 +7,7 @@ from azure.ai.ml.entities._job.finetuning.azure_openai_finetuning_job import AzureOpenAIFineTuningJob from azure.ai.ml.entities._job.finetuning.azure_openai_hyperparameters import AzureOpenAIHyperparameters from azure.ai.ml.entities._inputs_outputs import Input, Output -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( FineTuningJob as RestFineTuningJob, ) From c2caa3195f626e515cd2fa89d3fa0d59caa82c59 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 17:16:10 +0530 Subject: [PATCH 050/146] Move batch pipeline-component deployment test off v2024_01 rest models The PipelineComponentBatchDeployment read path is genuinely msrest (the 2023-02-preview client), so test_from_rest_object correctly uses a msrest BatchDeployment (from_dict + .properties.additional_properties). Switch its import from v2024_01 to v2023_08 (identical msrest behavior, and v2023_08 stays in use) and drop 3 unused imports. Reduces direct v2024_01 test coupling. 4 passed. --- .../unittests/test_pipeline_component_bach_deployment.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py index e50c4565998d..b6a0271d700b 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py @@ -6,14 +6,7 @@ import pytest -from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchDeployment as RestBatchDeployment -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( - BatchDeploymentProperties as RestBatchDeploymentProperties, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( - BatchPipelineComponentDeploymentConfiguration as RestBatchPipelineComponentDeploymentConfiguration, -) -from azure.ai.ml._restclient.v2024_01_01_preview.models import IdAssetReference +from azure.ai.ml._restclient.v2023_08_01_preview.models import BatchDeployment as RestBatchDeployment from azure.ai.ml.entities import PipelineComponent from azure.ai.ml.entities._deployment.pipeline_component_batch_deployment import PipelineComponentBatchDeployment from azure.ai.ml.entities._load_functions import load_pipeline_component_batch_deployment From 75aed33edef68181a414ea57c5204e58dc8a5d16 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 8 Jul 2026 19:50:27 +0530 Subject: [PATCH 051/146] Delete the now-unused v2024_01_01_preview restclient folder All production code was migrated off v2024_01_01_preview (operations moved to arm_ml_service, job reads/creates on the arm client). The only remaining references were two tests and the shared conftest mock fixture: the finetuning e2e test now imports FineTuningTaskType from arm_ml_service (identical values), the batch pipeline-component deployment test uses v2023_08 msrest models, and mock_aml_services_2024_01_01_preview returns a plain mock (it is only ever passed in as a service client). No cross-references from other restclient folders. Removes the whole autogenerated folder. Offline-verified: package imports cleanly; zero functional references remain. Full unit validation left to CI per resource constraints. --- .../v2024_01_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 359 - .../v2024_01_01_preview/_configuration.py | 76 - .../_restclient/v2024_01_01_preview/_patch.py | 31 - .../v2024_01_01_preview/_vendor.py | 27 - .../v2024_01_01_preview/_version.py | 9 - .../v2024_01_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 356 - .../v2024_01_01_preview/aio/_configuration.py | 72 - .../v2024_01_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 121 - .../_batch_deployments_operations.py | 642 - .../operations/_batch_endpoints_operations.py | 675 - ..._capacity_reservation_groups_operations.py | 472 - .../operations/_code_containers_operations.py | 339 - .../operations/_code_versions_operations.py | 603 - .../_component_containers_operations.py | 344 - .../_component_versions_operations.py | 525 - .../aio/operations/_compute_operations.py | 1465 - .../operations/_data_containers_operations.py | 344 - .../operations/_data_versions_operations.py | 534 - .../aio/operations/_datastores_operations.py | 438 - .../_endpoint_deployment_operations.py | 578 - .../aio/operations/_endpoint_operations.py | 576 - .../_environment_containers_operations.py | 344 - .../_environment_versions_operations.py | 526 - .../aio/operations/_features_operations.py | 247 - .../_featureset_containers_operations.py | 495 - .../_featureset_versions_operations.py | 672 - ...aturestore_entity_containers_operations.py | 495 - ...featurestore_entity_versions_operations.py | 526 - .../_inference_endpoints_operations.py | 654 - .../_inference_groups_operations.py | 829 - .../operations/_inference_pools_operations.py | 794 - .../aio/operations/_jobs_operations.py | 641 - .../operations/_labeling_jobs_operations.py | 746 - .../_managed_network_provisions_operations.py | 183 - ...anaged_network_settings_rule_operations.py | 458 - .../_marketplace_subscriptions_operations.py | 463 - .../_model_containers_operations.py | 349 - .../operations/_model_versions_operations.py | 704 - .../_online_deployments_operations.py | 823 - .../_online_endpoints_operations.py | 897 - .../aio/operations/_operations.py | 118 - ...private_endpoint_connections_operations.py | 332 - .../_private_link_resources_operations.py | 143 - .../aio/operations/_quotas_operations.py | 186 - .../aio/operations/_registries_operations.py | 710 - .../_registry_code_containers_operations.py | 463 - .../_registry_code_versions_operations.py | 570 - ...egistry_component_containers_operations.py | 463 - ..._registry_component_versions_operations.py | 499 - .../_registry_data_containers_operations.py | 468 - .../_registry_data_references_operations.py | 127 - .../_registry_data_versions_operations.py | 584 - ...istry_environment_containers_operations.py | 468 - ...egistry_environment_versions_operations.py | 505 - .../_registry_model_containers_operations.py | 468 - .../_registry_model_versions_operations.py | 743 - .../aio/operations/_schedules_operations.py | 552 - .../_serverless_endpoints_operations.py | 891 - .../aio/operations/_usages_operations.py | 124 - .../_virtual_machine_sizes_operations.py | 99 - .../_workspace_connections_operations.py | 632 - .../_workspace_features_operations.py | 129 - .../aio/operations/_workspaces_operations.py | 1357 - .../v2024_01_01_preview/models/__init__.py | 2409 - ...azure_machine_learning_workspaces_enums.py | 2264 - .../v2024_01_01_preview/models/_models.py | 35766 -------------- .../v2024_01_01_preview/models/_models_py3.py | 38826 ---------------- .../operations/__init__.py | 121 - .../_batch_deployments_operations.py | 876 - .../operations/_batch_endpoints_operations.py | 934 - ..._capacity_reservation_groups_operations.py | 714 - .../operations/_code_containers_operations.py | 511 - .../operations/_code_versions_operations.py | 878 - .../_component_containers_operations.py | 519 - .../_component_versions_operations.py | 756 - .../operations/_compute_operations.py | 2101 - .../operations/_data_containers_operations.py | 519 - .../operations/_data_versions_operations.py | 768 - .../operations/_datastores_operations.py | 671 - .../_endpoint_deployment_operations.py | 801 - .../operations/_endpoint_operations.py | 834 - .../_environment_containers_operations.py | 519 - .../_environment_versions_operations.py | 757 - .../operations/_features_operations.py | 359 - .../_featureset_containers_operations.py | 687 - .../_featureset_versions_operations.py | 924 - ...aturestore_entity_containers_operations.py | 687 - ...featurestore_entity_versions_operations.py | 732 - .../_inference_endpoints_operations.py | 894 - .../_inference_groups_operations.py | 1159 - .../operations/_inference_pools_operations.py | 1108 - .../operations/_jobs_operations.py | 911 - .../operations/_labeling_jobs_operations.py | 1045 - .../_managed_network_provisions_operations.py | 234 - ...anaged_network_settings_rule_operations.py | 629 - .../_marketplace_subscriptions_operations.py | 637 - .../_model_containers_operations.py | 527 - .../operations/_model_versions_operations.py | 998 - .../_online_deployments_operations.py | 1150 - .../_online_endpoints_operations.py | 1257 - .../operations/_operations.py | 155 - ...private_endpoint_connections_operations.py | 501 - .../_private_link_resources_operations.py | 190 - .../operations/_quotas_operations.py | 269 - .../operations/_registries_operations.py | 988 - .../_registry_code_containers_operations.py | 636 - .../_registry_code_versions_operations.py | 802 - ...egistry_component_containers_operations.py | 637 - ..._registry_component_versions_operations.py | 690 - .../_registry_data_containers_operations.py | 644 - .../_registry_data_references_operations.py | 180 - .../_registry_data_versions_operations.py | 823 - ...istry_environment_containers_operations.py | 645 - ...egistry_environment_versions_operations.py | 699 - .../_registry_model_containers_operations.py | 645 - .../_registry_model_versions_operations.py | 1036 - .../operations/_schedules_operations.py | 764 - .../_serverless_endpoints_operations.py | 1223 - .../operations/_usages_operations.py | 169 - .../_virtual_machine_sizes_operations.py | 144 - .../_workspace_connections_operations.py | 943 - .../_workspace_features_operations.py | 176 - .../operations/_workspaces_operations.py | 1923 - .../_restclient/v2024_01_01_preview/py.typed | 1 - sdk/ml/azure-ai-ml/tests/conftest.py | 10 +- .../test_azure_openai_finetuning_job.py | 2 +- 129 files changed, 5 insertions(+), 150499 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_capacity_reservation_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_capacity_reservation_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 7e0808cc8c02..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,359 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import ( - BatchDeploymentsOperations, - BatchEndpointsOperations, - CapacityReservationGroupsOperations, - CodeContainersOperations, - CodeVersionsOperations, - ComponentContainersOperations, - ComponentVersionsOperations, - ComputeOperations, - DataContainersOperations, - DatastoresOperations, - DataVersionsOperations, - EndpointDeploymentOperations, - EndpointOperations, - EnvironmentContainersOperations, - EnvironmentVersionsOperations, - FeaturesetContainersOperations, - FeaturesetVersionsOperations, - FeaturesOperations, - FeaturestoreEntityContainersOperations, - FeaturestoreEntityVersionsOperations, - InferenceEndpointsOperations, - InferenceGroupsOperations, - InferencePoolsOperations, - JobsOperations, - LabelingJobsOperations, - ManagedNetworkProvisionsOperations, - ManagedNetworkSettingsRuleOperations, - MarketplaceSubscriptionsOperations, - ModelContainersOperations, - ModelVersionsOperations, - OnlineDeploymentsOperations, - OnlineEndpointsOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QuotasOperations, - RegistriesOperations, - RegistryCodeContainersOperations, - RegistryCodeVersionsOperations, - RegistryComponentContainersOperations, - RegistryComponentVersionsOperations, - RegistryDataContainersOperations, - RegistryDataReferencesOperations, - RegistryDataVersionsOperations, - RegistryEnvironmentContainersOperations, - RegistryEnvironmentVersionsOperations, - RegistryModelContainersOperations, - RegistryModelVersionsOperations, - SchedulesOperations, - ServerlessEndpointsOperations, - UsagesOperations, - VirtualMachineSizesOperations, - WorkspaceConnectionsOperations, - WorkspaceFeaturesOperations, - WorkspacesOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations - :vartype capacity_reservation_groups: - azure.mgmt.machinelearningservices.operations.CapacityReservationGroupsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentVersionsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.operations.MarketplaceSubscriptionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.operations.EndpointOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2024-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.capacity_reservation_groups = CapacityReservationGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_configuration.py deleted file mode 100644 index 45d7fc680467..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2024-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index d26d767abb06..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,356 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING, Any, Awaitable - -from msrest import Deserializer, Serializer - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import ( - BatchDeploymentsOperations, - BatchEndpointsOperations, - CapacityReservationGroupsOperations, - CodeContainersOperations, - CodeVersionsOperations, - ComponentContainersOperations, - ComponentVersionsOperations, - ComputeOperations, - DataContainersOperations, - DatastoresOperations, - DataVersionsOperations, - EndpointDeploymentOperations, - EndpointOperations, - EnvironmentContainersOperations, - EnvironmentVersionsOperations, - FeaturesetContainersOperations, - FeaturesetVersionsOperations, - FeaturesOperations, - FeaturestoreEntityContainersOperations, - FeaturestoreEntityVersionsOperations, - InferenceEndpointsOperations, - InferenceGroupsOperations, - InferencePoolsOperations, - JobsOperations, - LabelingJobsOperations, - ManagedNetworkProvisionsOperations, - ManagedNetworkSettingsRuleOperations, - MarketplaceSubscriptionsOperations, - ModelContainersOperations, - ModelVersionsOperations, - OnlineDeploymentsOperations, - OnlineEndpointsOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QuotasOperations, - RegistriesOperations, - RegistryCodeContainersOperations, - RegistryCodeVersionsOperations, - RegistryComponentContainersOperations, - RegistryComponentVersionsOperations, - RegistryDataContainersOperations, - RegistryDataReferencesOperations, - RegistryDataVersionsOperations, - RegistryEnvironmentContainersOperations, - RegistryEnvironmentVersionsOperations, - RegistryModelContainersOperations, - RegistryModelVersionsOperations, - SchedulesOperations, - ServerlessEndpointsOperations, - UsagesOperations, - VirtualMachineSizesOperations, - WorkspaceConnectionsOperations, - WorkspaceFeaturesOperations, - WorkspacesOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.aio.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations - :vartype capacity_reservation_groups: - azure.mgmt.machinelearningservices.aio.operations.CapacityReservationGroupsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentVersionsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.aio.operations.MarketplaceSubscriptionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.aio.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.aio.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.aio.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.aio.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.aio.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.aio.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.aio.operations.EndpointOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2024-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.capacity_reservation_groups = CapacityReservationGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_configuration.py deleted file mode 100644 index 359b8c7ddaa6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2024-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/__init__.py deleted file mode 100644 index ed0728892746..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._compute_operations import ComputeOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._features_operations import FeaturesOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._operations import Operations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._quotas_operations import QuotasOperations -from ._registries_operations import RegistriesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._workspaces_operations import WorkspacesOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'CapacityReservationGroupsOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'MarketplaceSubscriptionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index b3a3fa2331ee..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,642 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeployment": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index 2e2db71839e4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpoint": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_capacity_reservation_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_capacity_reservation_groups_operations.py deleted file mode 100644 index 54033f727470..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_capacity_reservation_groups_operations.py +++ /dev/null @@ -1,472 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._capacity_reservation_groups_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_subscription_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CapacityReservationGroupsOperations: - """CapacityReservationGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"]: - """List CapacityReservationGroups by subscription. - - List CapacityReservationGroups by subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"]: - """Lists CapacityReservationGroups. - - Lists CapacityReservationGroups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - group_id: str, - **kwargs: Any - ) -> None: - """Delete CapacityReservationGroup. - - Delete CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - group_id: str, - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """Get CapacityReservationGroup. - - Get CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - group_id: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """Update CapacityReservationGroup. - - Update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to update. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - group_id: str, - body: "_models.CapacityReservationGroup", - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """Create or update CapacityReservationGroup. - - Create or update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to create. - :type body: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapacityReservationGroup') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index c127b308c9e4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index e691f2f4c64d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,603 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_versions_operations import ( - build_create_or_get_start_pending_upload_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_publish_request_initial, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 8ced2f3fdcbf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index ca8e15b3c1e2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,525 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_versions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_publish_request_initial, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index c93b96b81aa8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1465 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_allowed_resize_sizes_request, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_resize_request_initial, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_data_mounts_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List["_models.CustomService"], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List["_models.ComputeInstanceDataMount"], - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.IdleShutdownSetting", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get_allowed_resize_sizes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - async def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace_async - async def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 206569d881a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index 5e542b8824a8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,534 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_versions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_publish_request_initial, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param stage: data stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 6076e118431a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Datastore": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Datastore", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.Datastore": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_deployment_operations.py deleted file mode 100644 index abb3466c8840..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,578 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_deployment_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_in_workspace_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointDeploymentOperations: - """EndpointDeploymentOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_operations.py deleted file mode 100644 index d8211895fdaa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_endpoint_operations.py +++ /dev/null @@ -1,576 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_operations import build_create_or_update_request_initial, build_get_models_request, build_get_request, build_list_keys_request, build_list_request, build_regenerate_keys_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointOperations: - """EndpointOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"]: - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointResourcePropertiesBasicResource": - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointResourcePropertiesBasicResource"]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointKeys": - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateServiceAccountKeyContent", - **kwargs: Any - ) -> "_models.AccountApiKeys": - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index cf49754bcab5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index e8e7192df306..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_publish_request_initial, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index 3465ca978683..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,247 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesOperations: - """FeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 1000, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureResourceArmPaginatedResult"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :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 - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> "_models.Feature": - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index d8cb403b4fcf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetContainersOperations: - """FeaturesetContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturesetContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index bd9841efbd32..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,672 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetVersionsOperations: - """FeaturesetVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturesetVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> Optional["_models.FeaturesetVersionBackfillResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersionBackfillResponse"]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersionBackfillResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index efa59e7cab1f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityContainersOperations: - """FeaturestoreEntityContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityContainer or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 566a8bb73e82..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityVersionsOperations: - """FeaturestoreEntityVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_endpoints_operations.py deleted file mode 100644 index 4e92701565da..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,654 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceEndpointsOperations: - """InferenceEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"]: - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.InferenceEndpoint": - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> Optional["_models.InferenceEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> "_models.InferenceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_groups_operations.py deleted file mode 100644 index 2c86fe953a36..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_groups_operations.py +++ /dev/null @@ -1,829 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceGroupsOperations: - """InferenceGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"]: - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.InferenceGroup": - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.InferenceGroup"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> "_models.InferenceGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.GroupStatus": - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_pools_operations.py deleted file mode 100644 index 00222c3d24b3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_inference_pools_operations.py +++ /dev/null @@ -1,794 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferencePoolsOperations: - """InferencePoolsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferencePoolTrackedResourceArmPaginatedResult"]: - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.InferencePool": - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.InferencePool"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> "_models.InferencePool": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.PoolStatus": - """Retrieve inference pool status. - - Retrieve inference pool status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PoolStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PoolStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PoolStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PoolStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Pool Skus. - - List Inference Pool Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Inference Group name. - :type inference_pool_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index b79818aad95a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,641 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import ( - build_cancel_request_initial, - build_create_or_update_request, - build_delete_request_initial, - build_get_request, - build_list_request, - build_update_request, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - properties: Optional[str] = None, - asset_name: Optional[str] = None, - scheduled: Optional[bool] = None, - schedule_id: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBase": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.PartialJobBasePartialResource", - **kwargs: Any - ) -> "_models.JobBase": - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBase", - **kwargs: Any - ) -> "_models.JobBase": - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index 4275d60a54c3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,746 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def pause( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.LabelingJobProperties": - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJobProperties, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> Optional["_models.LabelingJobProperties"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LabelingJobProperties"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _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( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJobProperties"]: - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJobProperties or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJobProperties] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 59169807f517..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkProvisionsOperations: - """ManagedNetworkProvisionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 4a7b08090cd4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,458 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkSettingsRuleOperations: - """ManagedNetworkSettingsRuleOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.OutboundRuleListResult"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.OutboundRuleBasicResource": - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OutboundRuleBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index 503b5b7a3168..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._marketplace_subscriptions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MarketplaceSubscriptionsOperations: - """MarketplaceSubscriptionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> AsyncLROPoller["_models.MarketplaceSubscription"]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MarketplaceSubscription or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 0963e56494c3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,349 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index eaa0d2b4a39b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,704 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_package_request_initial, - build_publish_request_initial, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :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 - :param stage: Model stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - async def _package_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index 2f117adc29c3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeployment": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index 0096f35f9117..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,897 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpoint": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_operations.py deleted file mode 100644 index 8783de0322cb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index e3eed69e9394..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,332 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.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/v2024_01_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 45aed2d83e0c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,143 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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/v2024_01_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index 4c3dde256ffc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,186 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 0eab2eee6a9a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistriesOperations: - """RegistriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.Registry": - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> "_models.Registry": - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index dd50906b03fc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeContainersOperations: - """RegistryCodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeContainer"]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index d8ab1ba78188..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeVersionsOperations: - """RegistryCodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 343ea086931e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentContainersOperations: - """RegistryComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 41195475f0bd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentVersionsOperations: - """RegistryComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index 3951c6e15009..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataContainersOperations: - """RegistryDataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_references_operations.py deleted file mode 100644 index 27cf5530b86f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,127 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_references_operations import build_get_blob_reference_sas_request - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataReferencesOperations: - """RegistryDataReferencesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.GetBlobReferenceSASRequestDto", - **kwargs: Any - ) -> "_models.GetBlobReferenceSASResponseDto": - """Get blob reference SAS Uri value. - - Get blob reference SAS Uri value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index e6815177faed..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataVersionsOperations: - """RegistryDataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataVersionBase"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index f3704c8b1849..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentContainersOperations: - """RegistryEnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 90ee81a7ba9c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,505 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentVersionsOperations: - """RegistryEnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 2c8795bc3972..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelContainersOperations: - """RegistryModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainer"]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index 3464cab6d0e6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelVersionsOperations: - """RegistryModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - async def _package_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index a967ff77861a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,552 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schedules_operations import ( - build_create_or_update_request_initial, - build_delete_request_initial, - build_get_request, - build_list_request, - build_trigger_request, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchedulesOperations: - """SchedulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Schedule": - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> AsyncLROPoller["_models.Schedule"]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Schedule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def trigger( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.TriggerOnceRequest", - **kwargs: Any - ) -> "_models.TriggerRunSubmissionDto": - """Trigger run. - - Trigger run. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Request body for trigger once. - :type body: ~azure.mgmt.machinelearningservices.models.TriggerOnceRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TriggerRunSubmissionDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.TriggerRunSubmissionDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerRunSubmissionDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'TriggerOnceRequest') - - request = build_trigger_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.trigger.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('TriggerRunSubmissionDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - trigger.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 9901162d6e0b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,891 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._serverless_endpoints_operations import ( - build_create_or_update_request_initial, - build_delete_request_initial, - build_get_request, - build_get_status_request, - build_list_keys_request, - build_list_request, - build_regenerate_keys_request_initial, - build_update_request_initial, -) - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ServerlessEndpointsOperations: - """ServerlessEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.ServerlessEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpointStatus": - """Status of the model backing the Serverless Endpoint. - - Status of the model backing the Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpointStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpointStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus"} # type: ignore - - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> Optional["_models.EndpointAuthKeys"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointAuthKeys"]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index ab4440d17893..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 048a62466afd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 2f8d79a6a2be..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,632 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, build_test_connection_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - aoai_models_to_deploy: Optional[str] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionUpdateParameter"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - aoai_models_to_deploy: Optional[str] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - async def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace_async - async def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 9763314425a2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,129 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 053a2f2f8390..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1357 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/__init__.py deleted file mode 100644 index 35fb60cd6910..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/__init__.py +++ /dev/null @@ -1,2409 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import ( - AKS, - AADAuthTypeWorkspaceConnectionProperties, - AccessKeyAuthTypeWorkspaceConnectionProperties, - AccountApiKeys, - AccountKeyAuthTypeWorkspaceConnectionProperties, - AccountKeyDatastoreCredentials, - AccountKeyDatastoreSecrets, - AccountModel, - AcrDetails, - ActualCapacityInfo, - AksComputeSecrets, - AksComputeSecretsProperties, - AksNetworkingConfiguration, - AKSSchema, - AKSSchemaProperties, - AllFeatures, - AllNodes, - AmlCompute, - AmlComputeNodeInformation, - AmlComputeNodesInformation, - AmlComputeProperties, - AmlComputeSchema, - AmlToken, - AmlTokenComputeIdentity, - AmlUserFeature, - AnonymousAccessCredential, - ApiKeyAuthWorkspaceConnectionProperties, - ArmResourceId, - AssetBase, - AssetContainer, - AssetJobInput, - AssetJobOutput, - AssetReferenceBase, - AssignedUser, - AutoDeleteSetting, - AutoForecastHorizon, - AutologgerSettings, - AutoMLJob, - AutoMLVertical, - AutoNCrossValidations, - AutoPauseProperties, - AutoScaleProperties, - AutoSeasonality, - AutoTargetLags, - AutoTargetRollingWindowSize, - AzureBlobDatastore, - AzureDataLakeGen1Datastore, - AzureDataLakeGen2Datastore, - AzureDatastore, - AzureDevOpsWebhook, - AzureFileDatastore, - AzureMLBatchInferencingServer, - AzureMLOnlineInferencingServer, - AzureOpenAiFineTuning, - AzureOpenAiHyperParameters, - BanditPolicy, - BaseEnvironmentId, - BaseEnvironmentSource, - BatchDeployment, - BatchDeploymentConfiguration, - BatchDeploymentProperties, - BatchDeploymentTrackedResourceArmPaginatedResult, - BatchEndpoint, - BatchEndpointDefaults, - BatchEndpointProperties, - BatchEndpointTrackedResourceArmPaginatedResult, - BatchPipelineComponentDeploymentConfiguration, - BatchRetrySettings, - BayesianSamplingAlgorithm, - BindOptions, - BlobReferenceForConsumptionDto, - BuildContext, - CallRateLimit, - CapacityConfig, - CapacityReservationGroup, - CapacityReservationGroupProperties, - CapacityReservationGroupTrackedResourceArmPaginatedResult, - CategoricalDataDriftMetricThreshold, - CategoricalDataQualityMetricThreshold, - CategoricalPredictionDriftMetricThreshold, - CertificateDatastoreCredentials, - CertificateDatastoreSecrets, - Classification, - ClassificationModelPerformanceMetricThreshold, - ClassificationTrainingSettings, - ClusterUpdateParameters, - CocoExportSummary, - CodeConfiguration, - CodeContainer, - CodeContainerProperties, - CodeContainerResourceArmPaginatedResult, - CodeVersion, - CodeVersionProperties, - CodeVersionResourceArmPaginatedResult, - CognitiveServiceEndpointDeploymentResourceProperties, - CognitiveServicesSku, - Collection, - ColumnTransformer, - CommandJob, - CommandJobLimits, - ComponentConfiguration, - ComponentContainer, - ComponentContainerProperties, - ComponentContainerResourceArmPaginatedResult, - ComponentVersion, - ComponentVersionProperties, - ComponentVersionResourceArmPaginatedResult, - Compute, - ComputeInstance, - ComputeInstanceApplication, - ComputeInstanceAutologgerSettings, - ComputeInstanceConnectivityEndpoints, - ComputeInstanceContainer, - ComputeInstanceCreatedBy, - ComputeInstanceDataDisk, - ComputeInstanceDataMount, - ComputeInstanceEnvironmentInfo, - ComputeInstanceLastOperation, - ComputeInstanceProperties, - ComputeInstanceSchema, - ComputeInstanceSshSettings, - ComputeInstanceVersion, - ComputeRecurrenceSchedule, - ComputeResource, - ComputeResourceSchema, - ComputeRuntimeDto, - ComputeSchedules, - ComputeSecrets, - ComputeStartStopSchedule, - ContainerResourceRequirements, - ContainerResourceSettings, - ContentSafetyEndpointDeploymentResourceProperties, - ContentSafetyEndpointResourceProperties, - CosmosDbSettings, - CreateMonitorAction, - Cron, - CronTrigger, - CsvExportSummary, - CustomForecastHorizon, - CustomInferencingServer, - CustomKeys, - CustomKeysWorkspaceConnectionProperties, - CustomMetricThreshold, - CustomModelFineTuning, - CustomModelJobInput, - CustomModelJobOutput, - CustomMonitoringSignal, - CustomNCrossValidations, - CustomSeasonality, - CustomService, - CustomTargetLags, - CustomTargetRollingWindowSize, - DatabaseSource, - Databricks, - DatabricksComputeSecrets, - DatabricksComputeSecretsProperties, - DatabricksProperties, - DatabricksSchema, - DataCollector, - DataContainer, - DataContainerProperties, - DataContainerResourceArmPaginatedResult, - DataDriftMetricThresholdBase, - DataDriftMonitoringSignal, - DataFactory, - DataImport, - DataImportSource, - DataLakeAnalytics, - DataLakeAnalyticsSchema, - DataLakeAnalyticsSchemaProperties, - DataPathAssetReference, - DataQualityMetricThresholdBase, - DataQualityMonitoringSignal, - DataReferenceCredential, - DatasetExportSummary, - Datastore, - DatastoreCredentials, - DatastoreProperties, - DatastoreResourceArmPaginatedResult, - DatastoreSecrets, - DataVersionBase, - DataVersionBaseProperties, - DataVersionBaseResourceArmPaginatedResult, - DefaultScaleSettings, - DeploymentLogs, - DeploymentLogsRequest, - DeploymentModel, - DeploymentResourceConfiguration, - DestinationAsset, - DiagnoseRequestProperties, - DiagnoseResponseResult, - DiagnoseResponseResultValue, - DiagnoseResult, - DiagnoseWorkspaceParameters, - DistributionConfiguration, - Docker, - DockerCredential, - EarlyTerminationPolicy, - EncryptionKeyVaultUpdateProperties, - EncryptionProperty, - EncryptionUpdateProperties, - Endpoint, - EndpointAuthKeys, - EndpointAuthToken, - EndpointDeploymentModel, - EndpointDeploymentPropertiesBase, - EndpointDeploymentResourceProperties, - EndpointDeploymentResourcePropertiesBasicResource, - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, - EndpointKeys, - EndpointModels, - EndpointPropertiesBase, - EndpointResourceProperties, - EndpointResourcePropertiesBasicResource, - EndpointResourcePropertiesBasicResourceArmPaginatedResult, - EndpointScheduleAction, - EnvironmentContainer, - EnvironmentContainerProperties, - EnvironmentContainerResourceArmPaginatedResult, - EnvironmentVariable, - EnvironmentVersion, - EnvironmentVersionProperties, - EnvironmentVersionResourceArmPaginatedResult, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - EstimatedVMPrice, - EstimatedVMPrices, - ExportSummary, - ExternalFQDNResponse, - Feature, - FeatureAttributionDriftMonitoringSignal, - FeatureAttributionMetricThreshold, - FeatureImportanceSettings, - FeatureProperties, - FeatureResourceArmPaginatedResult, - FeaturesetContainer, - FeaturesetContainerProperties, - FeaturesetContainerResourceArmPaginatedResult, - FeaturesetSpecification, - FeaturesetVersion, - FeaturesetVersionBackfillRequest, - FeaturesetVersionBackfillResponse, - FeaturesetVersionProperties, - FeaturesetVersionResourceArmPaginatedResult, - FeaturestoreEntityContainer, - FeaturestoreEntityContainerProperties, - FeaturestoreEntityContainerResourceArmPaginatedResult, - FeaturestoreEntityVersion, - FeaturestoreEntityVersionProperties, - FeaturestoreEntityVersionResourceArmPaginatedResult, - FeatureStoreSettings, - FeatureSubset, - FeatureWindow, - FeaturizationSettings, - FileSystemSource, - FineTuningJob, - FineTuningVertical, - FixedInputData, - FlavorData, - ForecastHorizon, - Forecasting, - ForecastingSettings, - ForecastingTrainingSettings, - FQDNEndpoint, - FQDNEndpointDetail, - FQDNEndpoints, - FQDNEndpointsPropertyBag, - FqdnOutboundRule, - GenerationSafetyQualityMetricThreshold, - GenerationSafetyQualityMonitoringSignal, - GenerationTokenUsageMetricThreshold, - GenerationTokenUsageSignal, - GetBlobReferenceForConsumptionDto, - GetBlobReferenceSASRequestDto, - GetBlobReferenceSASResponseDto, - GridSamplingAlgorithm, - GroupStatus, - HdfsDatastore, - HDInsight, - HDInsightProperties, - HDInsightSchema, - IdAssetReference, - IdentityConfiguration, - IdentityForCmk, - IdleShutdownSetting, - Image, - ImageClassification, - ImageClassificationBase, - ImageClassificationMultilabel, - ImageInstanceSegmentation, - ImageLimitSettings, - ImageMetadata, - ImageModelDistributionSettings, - ImageModelDistributionSettingsClassification, - ImageModelDistributionSettingsObjectDetection, - ImageModelSettings, - ImageModelSettingsClassification, - ImageModelSettingsObjectDetection, - ImageObjectDetection, - ImageObjectDetectionBase, - ImageSweepSettings, - ImageVertical, - ImportDataAction, - IndexColumn, - InferenceContainerProperties, - InferenceEndpoint, - InferenceEndpointProperties, - InferenceEndpointTrackedResourceArmPaginatedResult, - InferenceGroup, - InferenceGroupProperties, - InferenceGroupTrackedResourceArmPaginatedResult, - InferencePool, - InferencePoolProperties, - InferencePoolTrackedResourceArmPaginatedResult, - InferencingServer, - InstanceTypeSchema, - InstanceTypeSchemaResources, - IntellectualProperty, - JobBase, - JobBaseProperties, - JobBaseResourceArmPaginatedResult, - JobInput, - JobLimits, - JobOutput, - JobResourceConfiguration, - JobScheduleAction, - JobService, - JupyterKernelConfig, - KerberosCredentials, - KerberosKeytabCredentials, - KerberosKeytabSecrets, - KerberosPasswordCredentials, - KerberosPasswordSecrets, - KeyVaultProperties, - Kubernetes, - KubernetesOnlineDeployment, - KubernetesProperties, - KubernetesSchema, - LabelCategory, - LabelClass, - LabelingDataConfiguration, - LabelingJob, - LabelingJobImageProperties, - LabelingJobInstructions, - LabelingJobMediaProperties, - LabelingJobProperties, - LabelingJobResourceArmPaginatedResult, - LabelingJobTextProperties, - LakeHouseArtifact, - ListAmlUserFeatureResult, - ListNotebookKeysResult, - ListStorageAccountKeysResult, - ListUsagesResult, - ListWorkspaceKeysResult, - ListWorkspaceQuotas, - LiteralJobInput, - ManagedComputeIdentity, - ManagedIdentity, - ManagedIdentityAuthTypeWorkspaceConnectionProperties, - ManagedIdentityCredential, - ManagedNetworkProvisionOptions, - ManagedNetworkProvisionStatus, - ManagedNetworkSettings, - ManagedOnlineDeployment, - ManagedOnlineEndpointDeploymentResourceProperties, - ManagedOnlineEndpointResourceProperties, - ManagedResourceGroupAssignedIdentities, - ManagedResourceGroupSettings, - ManagedServiceIdentity, - MarketplacePlan, - MarketplaceSubscription, - MarketplaceSubscriptionProperties, - MarketplaceSubscriptionResourceArmPaginatedResult, - MaterializationComputeResource, - MaterializationSettings, - MedianStoppingPolicy, - MLAssistConfiguration, - MLAssistConfigurationDisabled, - MLAssistConfigurationEnabled, - MLFlowModelJobInput, - MLFlowModelJobOutput, - MLTableData, - MLTableJobInput, - MLTableJobOutput, - ModelConfiguration, - ModelContainer, - ModelContainerProperties, - ModelContainerResourceArmPaginatedResult, - ModelDeprecationInfo, - ModelPackageInput, - ModelPerformanceMetricThresholdBase, - ModelPerformanceSignal, - ModelSettings, - ModelSku, - ModelVersion, - ModelVersionProperties, - ModelVersionResourceArmPaginatedResult, - MonitorComputeConfigurationBase, - MonitorComputeIdentityBase, - MonitorDefinition, - MonitorEmailNotificationSettings, - MonitoringDataSegment, - MonitoringFeatureFilterBase, - MonitoringInputDataBase, - MonitoringSignalBase, - MonitoringTarget, - MonitoringThreshold, - MonitoringWorkspaceConnection, - MonitorNotificationSettings, - MonitorServerlessSparkCompute, - Mpi, - NCrossValidations, - NlpFixedParameters, - NlpParameterSubspace, - NlpSweepSettings, - NlpVertical, - NlpVerticalFeaturizationSettings, - NlpVerticalLimitSettings, - Nodes, - NodeStateCounts, - NoneAuthTypeWorkspaceConnectionProperties, - NoneDatastoreCredentials, - NotebookAccessTokenResult, - NotebookPreparationError, - NotebookResourceInfo, - NotificationSetting, - NumericalDataDriftMetricThreshold, - NumericalDataQualityMetricThreshold, - NumericalPredictionDriftMetricThreshold, - OAuth2AuthTypeWorkspaceConnectionProperties, - Objective, - OneLakeArtifact, - OneLakeDatastore, - OnlineDeployment, - OnlineDeploymentProperties, - OnlineDeploymentTrackedResourceArmPaginatedResult, - OnlineEndpoint, - OnlineEndpointProperties, - OnlineEndpointTrackedResourceArmPaginatedResult, - OnlineInferenceConfiguration, - OnlineRequestSettings, - OnlineScaleSettings, - OpenAIEndpointDeploymentResourceProperties, - OpenAIEndpointResourceProperties, - Operation, - OperationDisplay, - OperationListResult, - OsPatchingStatus, - OutboundRule, - OutboundRuleBasicResource, - OutboundRuleListResult, - OutputPathAssetReference, - PackageInputPathBase, - PackageInputPathId, - PackageInputPathUrl, - PackageInputPathVersion, - PackageRequest, - PackageResponse, - PaginatedComputeResourcesList, - PartialBatchDeployment, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - PartialJobBase, - PartialJobBasePartialResource, - PartialManagedServiceIdentity, - PartialMinimalTrackedResource, - PartialMinimalTrackedResourceWithIdentity, - PartialMinimalTrackedResourceWithSku, - PartialMinimalTrackedResourceWithSkuAndIdentity, - PartialNotificationSetting, - PartialRegistryPartialTrackedResource, - PartialSku, - Password, - PATAuthTypeWorkspaceConnectionProperties, - PendingUploadCredentialDto, - PendingUploadRequestDto, - PendingUploadResponseDto, - PersonalComputeInstanceSettings, - PipelineJob, - PoolEnvironmentConfiguration, - PoolModelConfiguration, - PoolStatus, - PredictionDriftMetricThresholdBase, - PredictionDriftMonitoringSignal, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionListResult, - PrivateEndpointDestination, - PrivateEndpointOutboundRule, - PrivateEndpointResource, - PrivateLinkResource, - PrivateLinkResourceListResult, - PrivateLinkServiceConnectionState, - ProbeSettings, - ProgressMetrics, - PropertiesBase, - ProxyResource, - PyTorch, - QueueSettings, - QuotaBaseProperties, - QuotaUpdateParameters, - RandomSamplingAlgorithm, - Ray, - Recurrence, - RecurrenceSchedule, - RecurrenceTrigger, - RegenerateEndpointKeysRequest, - RegenerateServiceAccountKeyContent, - Registry, - RegistryListCredentialsResult, - RegistryPartialManagedServiceIdentity, - RegistryPrivateEndpointConnection, - RegistryPrivateLinkServiceConnectionState, - RegistryRegionArmDetails, - RegistryTrackedResourceArmPaginatedResult, - Regression, - RegressionModelPerformanceMetricThreshold, - RegressionTrainingSettings, - RequestConfiguration, - RequestLogging, - RequestMatchPattern, - ResizeSchema, - Resource, - ResourceBase, - ResourceConfiguration, - ResourceId, - ResourceName, - ResourceQuota, - RollingInputData, - Route, - SamplingAlgorithm, - SASAuthTypeWorkspaceConnectionProperties, - SASCredential, - SASCredentialDto, - SasDatastoreCredentials, - SasDatastoreSecrets, - ScaleSettings, - ScaleSettingsInformation, - Schedule, - ScheduleActionBase, - ScheduleBase, - ScheduleProperties, - ScheduleResourceArmPaginatedResult, - ScriptReference, - ScriptsToExecute, - Seasonality, - SecretConfiguration, - ServerlessComputeSettings, - ServerlessEndpoint, - ServerlessEndpointCapacityReservation, - ServerlessEndpointProperties, - ServerlessEndpointStatus, - ServerlessEndpointTrackedResourceArmPaginatedResult, - ServerlessInferenceEndpoint, - ServerlessOffer, - ServiceManagedResourcesSettings, - ServicePrincipalAuthTypeWorkspaceConnectionProperties, - ServicePrincipalDatastoreCredentials, - ServicePrincipalDatastoreSecrets, - ServiceTagDestination, - ServiceTagOutboundRule, - SetupScripts, - SharedPrivateLinkResource, - Sku, - SkuCapacity, - SkuResource, - SkuResourceArmPaginatedResult, - SkuSetting, - SparkJob, - SparkJobEntry, - SparkJobPythonEntry, - SparkJobScalaEntry, - SparkResourceConfiguration, - SpeechEndpointDeploymentResourceProperties, - SpeechEndpointResourceProperties, - SslConfiguration, - StackEnsembleSettings, - StaticInputData, - StatusMessage, - StorageAccountDetails, - SweepJob, - SweepJobLimits, - SynapseSpark, - SynapseSparkProperties, - SystemCreatedAcrAccount, - SystemCreatedStorageAccount, - SystemData, - SystemService, - TableFixedParameters, - TableParameterSubspace, - TableSweepSettings, - TableVertical, - TableVerticalFeaturizationSettings, - TableVerticalLimitSettings, - TargetLags, - TargetRollingWindowSize, - TargetUtilizationScaleSettings, - TensorFlow, - TextClassification, - TextClassificationMultilabel, - TextNer, - ThrottlingRule, - TmpfsOptions, - TopNFeaturesByAttribution, - TrackedResource, - TrainingSettings, - TrialComponent, - TriggerBase, - TriggerOnceRequest, - TriggerRunSubmissionDto, - TritonInferencingServer, - TritonModelJobInput, - TritonModelJobOutput, - TruncationSelectionPolicy, - UpdateWorkspaceQuotas, - UpdateWorkspaceQuotasResult, - UriFileDataVersion, - UriFileJobInput, - UriFileJobOutput, - UriFolderDataVersion, - UriFolderJobInput, - UriFolderJobOutput, - Usage, - UsageName, - UserAccountCredentials, - UserAssignedIdentity, - UserCreatedAcrAccount, - UserCreatedStorageAccount, - UserIdentity, - UsernamePasswordAuthTypeWorkspaceConnectionProperties, - VirtualMachine, - VirtualMachineImage, - VirtualMachineSchema, - VirtualMachineSchemaProperties, - VirtualMachineSecrets, - VirtualMachineSecretsSchema, - VirtualMachineSize, - VirtualMachineSizeListResult, - VirtualMachineSshCredentials, - VolumeDefinition, - VolumeOptions, - Webhook, - Workspace, - WorkspaceConnectionAccessKey, - WorkspaceConnectionApiKey, - WorkspaceConnectionManagedIdentity, - WorkspaceConnectionOAuth2, - WorkspaceConnectionPersonalAccessToken, - WorkspaceConnectionPropertiesV2, - WorkspaceConnectionPropertiesV2BasicResource, - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, - WorkspaceConnectionServicePrincipal, - WorkspaceConnectionSharedAccessSignature, - WorkspaceConnectionUpdateParameter, - WorkspaceConnectionUsernamePassword, - WorkspaceHubConfig, - WorkspaceListResult, - WorkspacePrivateEndpointResource, - WorkspaceUpdateParameters, - ) -except (SyntaxError, ImportError): - from ._models import AADAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountApiKeys # type: ignore - from ._models import AccountKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AccountModel # type: ignore - from ._models import AcrDetails # type: ignore - from ._models import ActualCapacityInfo # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AllFeatures # type: ignore - from ._models import AllNodes # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlComputeSchema # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlTokenComputeIdentity # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import AnonymousAccessCredential # type: ignore - from ._models import ApiKeyAuthWorkspaceConnectionProperties # type: ignore - from ._models import ArmResourceId # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoDeleteSetting # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AutologgerSettings # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureDatastore # type: ignore - from ._models import AzureDevOpsWebhook # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import AzureOpenAiFineTuning # type: ignore - from ._models import AzureOpenAiHyperParameters # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentConfiguration # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpoint # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointProperties # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchPipelineComponentDeploymentConfiguration # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CallRateLimit # type: ignore - from ._models import CapacityConfig # type: ignore - from ._models import CapacityReservationGroup # type: ignore - from ._models import CapacityReservationGroupProperties # type: ignore - from ._models import CapacityReservationGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import CategoricalDataDriftMetricThreshold # type: ignore - from ._models import CategoricalDataQualityMetricThreshold # type: ignore - from ._models import CategoricalPredictionDriftMetricThreshold # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import ClassificationModelPerformanceMetricThreshold # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainer # type: ignore - from ._models import CodeContainerProperties # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersion # type: ignore - from ._models import CodeVersionProperties # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import CognitiveServiceEndpointDeploymentResourceProperties # type: ignore - from ._models import CognitiveServicesSku # type: ignore - from ._models import Collection # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentConfiguration # type: ignore - from ._models import ComponentContainer # type: ignore - from ._models import ComponentContainerProperties # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersion # type: ignore - from ._models import ComponentVersionProperties # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceAutologgerSettings # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceContainer # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceDataDisk # type: ignore - from ._models import ComputeInstanceDataMount # type: ignore - from ._models import ComputeInstanceEnvironmentInfo # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSchema # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeInstanceVersion # type: ignore - from ._models import ComputeRecurrenceSchedule # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeResourceSchema # type: ignore - from ._models import ComputeRuntimeDto # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import ContentSafetyEndpointDeploymentResourceProperties # type: ignore - from ._models import ContentSafetyEndpointResourceProperties # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomInferencingServer # type: ignore - from ._models import CustomKeys # type: ignore - from ._models import CustomKeysWorkspaceConnectionProperties # type: ignore - from ._models import CustomMetricThreshold # type: ignore - from ._models import CustomModelFineTuning # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomMonitoringSignal # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataCollector # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataDriftMetricThresholdBase # type: ignore - from ._models import DataDriftMonitoringSignal # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataImport # type: ignore - from ._models import DataImportSource # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsSchema # type: ignore - from ._models import DataLakeAnalyticsSchemaProperties # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataQualityMetricThresholdBase # type: ignore - from ._models import DataQualityMonitoringSignal # type: ignore - from ._models import DataReferenceCredential # type: ignore - from ._models import DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import DatabaseSource # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DatabricksSchema # type: ignore - from ._models import DatasetExportSummary # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreProperties # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DeploymentModel # type: ignore - from ._models import DeploymentResourceConfiguration # type: ignore - from ._models import DestinationAsset # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import Docker # type: ignore - from ._models import DockerCredential # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultUpdateProperties # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import EncryptionUpdateProperties # type: ignore - from ._models import Endpoint # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentModel # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointDeploymentResourceProperties # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResource # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointKeys # type: ignore - from ._models import EndpointModels # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EndpointResourceProperties # type: ignore - from ._models import EndpointResourcePropertiesBasicResource # type: ignore - from ._models import EndpointResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointScheduleAction # type: ignore - from ._models import EnvironmentContainer # type: ignore - from ._models import EnvironmentContainerProperties # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVariable # type: ignore - from ._models import EnvironmentVersion # type: ignore - from ._models import EnvironmentVersionProperties # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExportSummary # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsPropertyBag # type: ignore - from ._models import Feature # type: ignore - from ._models import FeatureAttributionDriftMonitoringSignal # type: ignore - from ._models import FeatureAttributionMetricThreshold # type: ignore - from ._models import FeatureImportanceSettings # type: ignore - from ._models import FeatureProperties # type: ignore - from ._models import FeatureResourceArmPaginatedResult # type: ignore - from ._models import FeatureStoreSettings # type: ignore - from ._models import FeatureSubset # type: ignore - from ._models import FeatureWindow # type: ignore - from ._models import FeaturesetContainer # type: ignore - from ._models import FeaturesetContainerProperties # type: ignore - from ._models import FeaturesetContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # type: ignore - from ._models import FeaturesetVersionBackfillResponse # type: ignore - from ._models import FeaturesetVersionProperties # type: ignore - from ._models import FeaturesetVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityContainer # type: ignore - from ._models import FeaturestoreEntityContainerProperties # type: ignore - from ._models import FeaturestoreEntityContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityVersion # type: ignore - from ._models import FeaturestoreEntityVersionProperties # type: ignore - from ._models import FeaturestoreEntityVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FileSystemSource # type: ignore - from ._models import FineTuningJob # type: ignore - from ._models import FineTuningVertical # type: ignore - from ._models import FixedInputData # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # type: ignore - from ._models import GenerationSafetyQualityMetricThreshold # type: ignore - from ._models import GenerationSafetyQualityMonitoringSignal # type: ignore - from ._models import GenerationTokenUsageMetricThreshold # type: ignore - from ._models import GenerationTokenUsageSignal # type: ignore - from ._models import GetBlobReferenceForConsumptionDto # type: ignore - from ._models import GetBlobReferenceSASRequestDto # type: ignore - from ._models import GetBlobReferenceSASResponseDto # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import GroupStatus # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import HDInsightSchema # type: ignore - from ._models import HdfsDatastore # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import IdleShutdownSetting # type: ignore - from ._models import Image # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageMetadata # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import ImportDataAction # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferenceEndpoint # type: ignore - from ._models import InferenceEndpointProperties # type: ignore - from ._models import InferenceEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferenceGroup # type: ignore - from ._models import InferenceGroupProperties # type: ignore - from ._models import InferenceGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencePool # type: ignore - from ._models import InferencePoolProperties # type: ignore - from ._models import InferencePoolTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencingServer # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import IntellectualProperty # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobBaseProperties # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobResourceConfiguration # type: ignore - from ._models import JobScheduleAction # type: ignore - from ._models import JobService # type: ignore - from ._models import JupyterKernelConfig # type: ignore - from ._models import KerberosCredentials # type: ignore - from ._models import KerberosKeytabCredentials # type: ignore - from ._models import KerberosKeytabSecrets # type: ignore - from ._models import KerberosPasswordCredentials # type: ignore - from ._models import KerberosPasswordSecrets # type: ignore - from ._models import KeyVaultProperties # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # type: ignore - from ._models import LakeHouseArtifact # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedComputeIdentity # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedIdentityCredential # type: ignore - from ._models import ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedOnlineEndpointDeploymentResourceProperties # type: ignore - from ._models import ManagedOnlineEndpointResourceProperties # type: ignore - from ._models import ManagedResourceGroupAssignedIdentities # type: ignore - from ._models import ManagedResourceGroupSettings # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MarketplacePlan # type: ignore - from ._models import MarketplaceSubscription # type: ignore - from ._models import MarketplaceSubscriptionProperties # type: ignore - from ._models import MarketplaceSubscriptionResourceArmPaginatedResult # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelDeprecationInfo # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelPerformanceMetricThresholdBase # type: ignore - from ._models import ModelPerformanceSignal # type: ignore - from ._models import ModelSettings # type: ignore - from ._models import ModelSku # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import MonitorComputeConfigurationBase # type: ignore - from ._models import MonitorComputeIdentityBase # type: ignore - from ._models import MonitorDefinition # type: ignore - from ._models import MonitorEmailNotificationSettings # type: ignore - from ._models import MonitorNotificationSettings # type: ignore - from ._models import MonitorServerlessSparkCompute # type: ignore - from ._models import MonitoringDataSegment # type: ignore - from ._models import MonitoringFeatureFilterBase # type: ignore - from ._models import MonitoringInputDataBase # type: ignore - from ._models import MonitoringSignalBase # type: ignore - from ._models import MonitoringTarget # type: ignore - from ._models import MonitoringThreshold # type: ignore - from ._models import MonitoringWorkspaceConnection # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import Nodes # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import NotificationSetting # type: ignore - from ._models import NumericalDataDriftMetricThreshold # type: ignore - from ._models import NumericalDataQualityMetricThreshold # type: ignore - from ._models import NumericalPredictionDriftMetricThreshold # type: ignore - from ._models import OAuth2AuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import Objective # type: ignore - from ._models import OneLakeArtifact # type: ignore - from ._models import OneLakeDatastore # type: ignore - from ._models import OnlineDeployment # type: ignore - from ._models import OnlineDeploymentProperties # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpoint # type: ignore - from ._models import OnlineEndpointProperties # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineInferenceConfiguration # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OpenAIEndpointDeploymentResourceProperties # type: ignore - from ._models import OpenAIEndpointResourceProperties # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OsPatchingStatus # type: ignore - from ._models import OutboundRule # type: ignore - from ._models import OutboundRuleBasicResource # type: ignore - from ._models import OutboundRuleListResult # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialJobBase # type: ignore - from ._models import PartialJobBasePartialResource # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialMinimalTrackedResource # type: ignore - from ._models import PartialMinimalTrackedResourceWithIdentity # type: ignore - from ._models import PartialMinimalTrackedResourceWithSku # type: ignore - from ._models import PartialMinimalTrackedResourceWithSkuAndIdentity # type: ignore - from ._models import PartialNotificationSetting # type: ignore - from ._models import PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PendingUploadCredentialDto # type: ignore - from ._models import PendingUploadRequestDto # type: ignore - from ._models import PendingUploadResponseDto # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PoolEnvironmentConfiguration # type: ignore - from ._models import PoolModelConfiguration # type: ignore - from ._models import PoolStatus # type: ignore - from ._models import PredictionDriftMetricThresholdBase # type: ignore - from ._models import PredictionDriftMonitoringSignal # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointDestination # type: ignore - from ._models import PrivateEndpointOutboundRule # type: ignore - from ._models import PrivateEndpointResource # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import ProgressMetrics # type: ignore - from ._models import PropertiesBase # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QueueSettings # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import Ray # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import RegenerateServiceAccountKeyContent # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryPartialManagedServiceIdentity # type: ignore - from ._models import RegistryPrivateEndpointConnection # type: ignore - from ._models import RegistryPrivateLinkServiceConnectionState # type: ignore - from ._models import RegistryRegionArmDetails # type: ignore - from ._models import RegistryTrackedResourceArmPaginatedResult # type: ignore - from ._models import Regression # type: ignore - from ._models import RegressionModelPerformanceMetricThreshold # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestConfiguration # type: ignore - from ._models import RequestLogging # type: ignore - from ._models import RequestMatchPattern # type: ignore - from ._models import ResizeSchema # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import RollingInputData # type: ignore - from ._models import Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import SASCredential # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import Schedule # type: ignore - from ._models import ScheduleActionBase # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import ScheduleProperties # type: ignore - from ._models import ScheduleResourceArmPaginatedResult # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import Seasonality # type: ignore - from ._models import SecretConfiguration # type: ignore - from ._models import ServerlessComputeSettings # type: ignore - from ._models import ServerlessEndpoint # type: ignore - from ._models import ServerlessEndpointCapacityReservation # type: ignore - from ._models import ServerlessEndpointProperties # type: ignore - from ._models import ServerlessEndpointStatus # type: ignore - from ._models import ServerlessEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import ServerlessInferenceEndpoint # type: ignore - from ._models import ServerlessOffer # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import ServiceTagDestination # type: ignore - from ._models import ServiceTagOutboundRule # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import SparkJob # type: ignore - from ._models import SparkJobEntry # type: ignore - from ._models import SparkJobPythonEntry # type: ignore - from ._models import SparkJobScalaEntry # type: ignore - from ._models import SparkResourceConfiguration # type: ignore - from ._models import SpeechEndpointDeploymentResourceProperties # type: ignore - from ._models import SpeechEndpointResourceProperties # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StaticInputData # type: ignore - from ._models import StatusMessage # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemCreatedAcrAccount # type: ignore - from ._models import SystemCreatedStorageAccount # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import ThrottlingRule # type: ignore - from ._models import TmpfsOptions # type: ignore - from ._models import TopNFeaturesByAttribution # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TriggerOnceRequest # type: ignore - from ._models import TriggerRunSubmissionDto # type: ignore - from ._models import TritonInferencingServer # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserCreatedAcrAccount # type: ignore - from ._models import UserCreatedStorageAccount # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineSchema # type: ignore - from ._models import VirtualMachineSchemaProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSecretsSchema # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import VolumeDefinition # type: ignore - from ._models import VolumeOptions # type: ignore - from ._models import Webhook # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionApiKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # type: ignore - from ._models import WorkspaceConnectionOAuth2 # type: ignore - from ._models import WorkspaceConnectionPersonalAccessToken # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceConnectionServicePrincipal # type: ignore - from ._models import WorkspaceConnectionSharedAccessSignature # type: ignore - from ._models import WorkspaceConnectionUpdateParameter # type: ignore - from ._models import WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceHubConfig # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspacePrivateEndpointResource # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - ActionType, - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - AuthMode, - AutoDeleteCondition, - AutoRebuildSetting, - Autosave, - BaseEnvironmentSourceType, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModelPerformanceMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeRecurrenceFrequency, - ComputeTriggerType, - ComputeType, - ComputeWeekDay, - ConnectionAuthType, - ConnectionCategory, - ConnectionGroup, - ContainerType, - CreatedByType, - CredentialsType, - DataAvailabilityStatus, - DataCollectionMode, - DataImportSourceType, - DataReferenceCredentialType, - DatastoreType, - DataType, - DefaultResourceProvisioningState, - DeploymentModelVersionUpgradeOption, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EndpointType, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureAttributionMetric, - FeatureDataType, - FeatureImportanceMode, - FeatureLags, - FeaturizationMode, - FineTuningTaskType, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - GenerationSafetyQualityMetric, - GenerationTokenUsageMetric, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InferencingServerType, - InputDeliveryMode, - InputPathType, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogTrainingMetrics, - LogValidationLoss, - LogVerbosity, - ManagedNetworkStatus, - ManagedServiceIdentityType, - MarketplaceSubscriptionProvisioningState, - MarketplaceSubscriptionStatus, - MaterializationStoreType, - MediaType, - MLAssistConfigurationType, - MlflowAutologger, - MLFlowAutologgerState, - ModelLifecycleStatus, - ModelProvider, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringModelType, - MonitoringNotificationType, - MonitoringSignalType, - MountAction, - MountMode, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - Origin, - OsType, - OutputDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - PatchStatus, - PendingUploadCredentialType, - PendingUploadType, - PoolProvisioningState, - PrivateEndpointConnectionProvisioningState, - ProtectionLevel, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModelPerformanceMetric, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - ScheduleType, - SeasonalityMode, - SecretsType, - ServerlessEndpointState, - ServerlessInferenceEndpointAuthMode, - ServiceAccountKeyName, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - ValidationMetricType, - VMPriceOSType, - VmPriority, - VMTier, - VolumeDefinitionType, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AADAuthTypeWorkspaceConnectionProperties', - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountApiKeys', - 'AccountKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AccountModel', - 'AcrDetails', - 'ActualCapacityInfo', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'AnonymousAccessCredential', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'AzureOpenAiFineTuning', - 'AzureOpenAiHyperParameters', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CallRateLimit', - 'CapacityConfig', - 'CapacityReservationGroup', - 'CapacityReservationGroupProperties', - 'CapacityReservationGroupTrackedResourceArmPaginatedResult', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'CognitiveServiceEndpointDeploymentResourceProperties', - 'CognitiveServicesSku', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentConfiguration', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeRecurrenceSchedule', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'ContentSafetyEndpointDeploymentResourceProperties', - 'ContentSafetyEndpointResourceProperties', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelFineTuning', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataReferenceCredential', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentModel', - 'DeploymentResourceConfiguration', - 'DestinationAsset', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'DockerCredential', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentModel', - 'EndpointDeploymentPropertiesBase', - 'EndpointDeploymentResourceProperties', - 'EndpointDeploymentResourcePropertiesBasicResource', - 'EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointKeys', - 'EndpointModels', - 'EndpointPropertiesBase', - 'EndpointResourceProperties', - 'EndpointResourcePropertiesBasicResource', - 'EndpointResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureImportanceSettings', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionBackfillResponse', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FineTuningJob', - 'FineTuningVertical', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GenerationSafetyQualityMetricThreshold', - 'GenerationSafetyQualityMonitoringSignal', - 'GenerationTokenUsageMetricThreshold', - 'GenerationTokenUsageSignal', - 'GetBlobReferenceForConsumptionDto', - 'GetBlobReferenceSASRequestDto', - 'GetBlobReferenceSASResponseDto', - 'GridSamplingAlgorithm', - 'GroupStatus', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferenceEndpoint', - 'InferenceEndpointProperties', - 'InferenceEndpointTrackedResourceArmPaginatedResult', - 'InferenceGroup', - 'InferenceGroupProperties', - 'InferenceGroupTrackedResourceArmPaginatedResult', - 'InferencePool', - 'InferencePoolProperties', - 'InferencePoolTrackedResourceArmPaginatedResult', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'JupyterKernelConfig', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedIdentityCredential', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedOnlineEndpointDeploymentResourceProperties', - 'ManagedOnlineEndpointResourceProperties', - 'ManagedResourceGroupAssignedIdentities', - 'ManagedResourceGroupSettings', - 'ManagedServiceIdentity', - 'MarketplacePlan', - 'MarketplaceSubscription', - 'MarketplaceSubscriptionProperties', - 'MarketplaceSubscriptionResourceArmPaginatedResult', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelDeprecationInfo', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignal', - 'ModelSettings', - 'ModelSku', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorEmailNotificationSettings', - 'MonitorNotificationSettings', - 'MonitorServerlessSparkCompute', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'MonitoringWorkspaceConnection', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'OAuth2AuthTypeWorkspaceConnectionProperties', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OpenAIEndpointDeploymentResourceProperties', - 'OpenAIEndpointResourceProperties', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OsPatchingStatus', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialMinimalTrackedResourceWithSkuAndIdentity', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PoolEnvironmentConfiguration', - 'PoolModelConfiguration', - 'PoolStatus', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PropertiesBase', - 'ProxyResource', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'RegenerateServiceAccountKeyContent', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestConfiguration', - 'RequestLogging', - 'RequestMatchPattern', - 'ResizeSchema', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'RollingInputData', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredential', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServerlessComputeSettings', - 'ServerlessEndpoint', - 'ServerlessEndpointCapacityReservation', - 'ServerlessEndpointProperties', - 'ServerlessEndpointStatus', - 'ServerlessEndpointTrackedResourceArmPaginatedResult', - 'ServerlessInferenceEndpoint', - 'ServerlessOffer', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SpeechEndpointDeploymentResourceProperties', - 'SpeechEndpointResourceProperties', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StaticInputData', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'ThrottlingRule', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TriggerOnceRequest', - 'TriggerRunSubmissionDto', - 'TritonInferencingServer', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionOAuth2', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'ActionType', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AuthMode', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeRecurrenceFrequency', - 'ComputeTriggerType', - 'ComputeType', - 'ComputeWeekDay', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ConnectionGroup', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataAvailabilityStatus', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataReferenceCredentialType', - 'DataType', - 'DatastoreType', - 'DefaultResourceProvisioningState', - 'DeploymentModelVersionUpgradeOption', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EndpointType', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureImportanceMode', - 'FeatureLags', - 'FeaturizationMode', - 'FineTuningTaskType', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'GenerationSafetyQualityMetric', - 'GenerationTokenUsageMetric', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MarketplaceSubscriptionProvisioningState', - 'MarketplaceSubscriptionStatus', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelLifecycleStatus', - 'ModelProvider', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringModelType', - 'MonitoringNotificationType', - 'MonitoringSignalType', - 'MountAction', - 'MountMode', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'Origin', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PatchStatus', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PoolProvisioningState', - 'PrivateEndpointConnectionProvisioningState', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'ScheduleType', - 'SeasonalityMode', - 'SecretsType', - 'ServerlessEndpointState', - 'ServerlessInferenceEndpointAuthMode', - 'ServiceAccountKeyName', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index fc1de0dae748..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,2264 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - -from six import with_metaclass - -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ - - INTERNAL = "Internal" - -class AllocationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AAD = "AAD" - -class AutoDeleteCondition(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_GREATER_THAN = "CreatedGreaterThan" - LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" - -class AutoRebuildSetting(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -class BaseEnvironmentSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Base environment type. - """ - - ENVIRONMENT_ASSET = "EnvironmentAsset" - -class BatchDeploymentConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated property types for batch deployments. - """ - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - -class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class BillingCurrency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Target encoding for text data. - TEXT_TARGET_ENCODER = "TextTargetEncoder" - #: Ohe hot encoding creates a binary feature transformation. - ONE_HOT_ENCODER = "OneHotEncoder" - #: Target encoding for categorical data. - CAT_TARGET_ENCODER = "CatTargetEncoder" - #: Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - #: weighting scheme for identifying information from documents. - TF_IDF = "TfIdf" - #: Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - #: natural log of the P(1)/P(0) to create weights. - WO_E_TARGET_ENCODER = "WoETargetEncoder" - #: Label encoder converts labels/categorical variables in a numerical form. - LABEL_ENCODER = "LabelEncoder" - #: Word embedding helps represents words or phrases as a vector, or a series of numbers. - WORD_EMBEDDING = "WordEmbedding" - #: Naive Bayes is a classified that is used for classification of discrete features that are - #: categorically distributed. - NAIVE_BAYES = "NaiveBayes" - #: Count Vectorizer converts a collection of text documents to a matrix of token counts. - COUNT_VECTORIZER = "CountVectorizer" - #: Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - #: This is often used for high-cardinality categorical features. - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - -class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class ClassificationModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the accuracy of the model predictions. - ACCURACY = "Accuracy" - #: Calculates the precision of the model predictions. - PRECISION = "Precision" - #: Calculates the recall of the model predictions. - RECALL = "Recall" - -class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ClusterPurpose(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - RESIZING = "Resizing" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeRecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a compute recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ComputeTriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ComputeWeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" - -class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - ACCOUNT_KEY = "AccountKey" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - API_KEY = "ApiKey" - CUSTOM_KEYS = "CustomKeys" - O_AUTH2 = "OAuth2" - AAD = "AAD" - -class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - ADLS_GEN2 = "ADLSGen2" - REDIS = "Redis" - API_KEY = "ApiKey" - AZURE_OPEN_AI = "AzureOpenAI" - COGNITIVE_SEARCH = "CognitiveSearch" - COGNITIVE_SERVICE = "CognitiveService" - CUSTOM_KEYS = "CustomKeys" - AZURE_BLOB = "AzureBlob" - AZURE_ONE_LAKE = "AzureOneLake" - COSMOS_DB = "CosmosDb" - COSMOS_DB_MONGO_DB_API = "CosmosDbMongoDbApi" - AZURE_DATA_EXPLORER = "AzureDataExplorer" - AZURE_MARIA_DB = "AzureMariaDb" - AZURE_DATABRICKS_DELTA_LAKE = "AzureDatabricksDeltaLake" - AZURE_SQL_MI = "AzureSqlMi" - AZURE_TABLE_STORAGE = "AzureTableStorage" - AMAZON_RDS_FOR_ORACLE = "AmazonRdsForOracle" - AMAZON_RDS_FOR_SQL_SERVER = "AmazonRdsForSqlServer" - AMAZON_REDSHIFT = "AmazonRedshift" - DB2 = "Db2" - DRILL = "Drill" - GOOGLE_BIG_QUERY = "GoogleBigQuery" - GREENPLUM = "Greenplum" - HBASE = "Hbase" - HIVE = "Hive" - IMPALA = "Impala" - INFORMIX = "Informix" - MARIA_DB = "MariaDb" - MICROSOFT_ACCESS = "MicrosoftAccess" - MY_SQL = "MySql" - NETEZZA = "Netezza" - ORACLE = "Oracle" - PHOENIX = "Phoenix" - POSTGRE_SQL = "PostgreSql" - PRESTO = "Presto" - SAP_OPEN_HUB = "SapOpenHub" - SAP_BW = "SapBw" - SAP_HANA = "SapHana" - SAP_TABLE = "SapTable" - SPARK = "Spark" - SQL_SERVER = "SqlServer" - SYBASE = "Sybase" - TERADATA = "Teradata" - VERTICA = "Vertica" - CASSANDRA = "Cassandra" - COUCHBASE = "Couchbase" - MONGO_DB_V2 = "MongoDbV2" - MONGO_DB_ATLAS = "MongoDbAtlas" - AMAZON_S3_COMPATIBLE = "AmazonS3Compatible" - FILE_SERVER = "FileServer" - FTP_SERVER = "FtpServer" - GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" - HDFS = "Hdfs" - ORACLE_CLOUD_STORAGE = "OracleCloudStorage" - SFTP = "Sftp" - GENERIC_HTTP = "GenericHttp" - O_DATA_REST = "ODataRest" - ODBC = "Odbc" - GENERIC_REST = "GenericRest" - AMAZON_MWS = "AmazonMws" - CONCUR = "Concur" - DYNAMICS = "Dynamics" - DYNAMICS_AX = "DynamicsAx" - DYNAMICS_CRM = "DynamicsCrm" - GOOGLE_AD_WORDS = "GoogleAdWords" - HUBSPOT = "Hubspot" - JIRA = "Jira" - MAGENTO = "Magento" - MARKETO = "Marketo" - OFFICE365 = "Office365" - ELOQUA = "Eloqua" - RESPONSYS = "Responsys" - ORACLE_SERVICE_CLOUD = "OracleServiceCloud" - PAY_PAL = "PayPal" - QUICK_BOOKS = "QuickBooks" - SALESFORCE = "Salesforce" - SALESFORCE_SERVICE_CLOUD = "SalesforceServiceCloud" - SALESFORCE_MARKETING_CLOUD = "SalesforceMarketingCloud" - SAP_CLOUD_FOR_CUSTOMER = "SapCloudForCustomer" - SAP_ECC = "SapEcc" - SERVICE_NOW = "ServiceNow" - SHARE_POINT_ONLINE_LIST = "SharePointOnlineList" - SHOPIFY = "Shopify" - SQUARE = "Square" - WEB_TABLE = "WebTable" - XERO = "Xero" - ZOHO = "Zoho" - GENERIC_CONTAINER_REGISTRY = "GenericContainerRegistry" - -class ConnectionGroup(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Group based on connection category - """ - - AZURE = "Azure" - AZURE_AI = "AzureAI" - DATABASE = "Database" - NO_SQL = "NoSQL" - FILE = "File" - GENERIC_PROTOCOL = "GenericProtocol" - SERVICES_AND_APPS = "ServicesAndApps" - -class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of container to retrieve logs from. - """ - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_KEYTAB = "KerberosKeytab" - KERBEROS_PASSWORD = "KerberosPassword" - -class DataAvailabilityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - PENDING = "Pending" - INCOMPLETE = "Incomplete" - COMPLETE = "Complete" - -class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataImportSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - DATABASE = "database" - FILE_SYSTEM = "file_system" - -class DataReferenceCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the DataReference credentials type. - """ - - SAS = "SAS" - DOCKER_CREDENTIALS = "DockerCredentials" - MANAGED_IDENTITY = "ManagedIdentity" - NO_CREDENTIALS = "NoCredentials" - -class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - HDFS = "Hdfs" - ONE_LAKE = "OneLake" - -class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DefaultResourceProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NOT_STARTED = "NotStarted" - FAILED = "Failed" - CREATING = "Creating" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - DELETING = "Deleting" - CANCELED = "Canceled" - -class DeploymentModelVersionUpgradeOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Deployment model version upgrade option. - """ - - ONCE_NEW_DEFAULT_VERSION_AVAILABLE = "OnceNewDefaultVersionAvailable" - ONCE_CURRENT_VERSION_EXPIRED = "OnceCurrentVersionExpired" - NO_AUTO_UPGRADE = "NoAutoUpgrade" - -class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DiagnoseResultLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - RAY = "Ray" - -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EmailNotificationEnableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the email notification type. - """ - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - -class EncryptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Connection status of the service consumer with the service provider - """ - - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class EndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the endpoint. - """ - - AZURE_OPEN_AI = "Azure.OpenAI" - AZURE_SPEECH = "Azure.Speech" - AZURE_CONTENT_SAFETY = "Azure.ContentSafety" - AZURE_LLAMA = "Azure.Llama" - MANAGED_ONLINE_ENDPOINT = "managedOnlineEndpoint" - -class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class EnvironmentVariableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class ExportFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -class FeatureAttributionMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - -class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - -class FeatureImportanceMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The mode of operation for computing feature importance. - """ - - #: Disables computing feature importance within a signal. - DISABLED = "Disabled" - #: Enables computing feature importance within a signal. - ENABLED = "Enabled" - -class FeatureLags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class FineTuningTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CHAT_COMPLETION = "ChatCompletion" - TEXT_COMPLETION = "TextCompletion" - TEXT_CLASSIFICATION = "TextClassification" - QUESTION_ANSWERING = "QuestionAnswering" - TEXT_SUMMARIZATION = "TextSummarization" - TOKEN_CLASSIFICATION = "TokenClassification" - TEXT_TRANSLATION = "TextTranslation" - IMAGE_CLASSIFICATION = "ImageClassification" - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - VIDEO_MULTI_OBJECT_TRACKING = "VideoMultiObjectTracking" - -class ForecastHorizonMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - #: brief intro. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class GenerationSafetyQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation safety quality metric enum. - """ - - ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = "AcceptableGroundednessScorePerInstance" - AGGREGATED_GROUNDEDNESS_PASS_RATE = "AggregatedGroundednessPassRate" - ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = "AcceptableCoherenceScorePerInstance" - AGGREGATED_COHERENCE_PASS_RATE = "AggregatedCoherencePassRate" - ACCEPTABLE_FLUENCY_SCORE_PER_INSTANCE = "AcceptableFluencyScorePerInstance" - AGGREGATED_FLUENCY_PASS_RATE = "AggregatedFluencyPassRate" - ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = "AcceptableSimilarityScorePerInstance" - AGGREGATED_SIMILARITY_PASS_RATE = "AggregatedSimilarityPassRate" - ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = "AcceptableRelevanceScorePerInstance" - AGGREGATED_RELEVANCE_PASS_RATE = "AggregatedRelevancePassRate" - -class GenerationTokenUsageMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation token statistics metric enum. - """ - - TOTAL_TOKEN_COUNT = "TotalTokenCount" - TOTAL_TOKEN_COUNT_PER_GROUP = "TotalTokenCountPerGroup" - -class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class ImageAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - Environment images (custom and curated) - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class IncrementalDataRefresh(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether IncrementalDataRefresh is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class InferencingServerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Inferencing server type for various targets. - """ - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - -class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InputPathType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Input path type for package inputs. - """ - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - -class InstanceSegmentationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class IsolationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ - - LITERAL = "literal" - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - #: The job is in a scheduled state. Job is not in any active state. - SCHEDULED = "Scheduled" - -class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job tier. - """ - - NULL = "Null" - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - FINE_TUNING = "FineTuning" - -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LoadBalancerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class LogTrainingMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log training metrics. - ENABLE = "Enable" - #: Disable compute and log training metrics. - DISABLE = "Disable" - -class LogValidationLoss(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log validation metrics. - ENABLE = "Enable" - #: Disable compute and log validation metrics. - DISABLE = "Disable" - -class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedNetworkStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class MarketplaceSubscriptionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: MarketplaceSubscription is being created. - CREATING = "Creating" - #: MarketplaceSubscription is being deleted. - DELETING = "Deleting" - #: MarketplaceSubscription is successfully provisioned. - SUCCEEDED = "Succeeded" - #: MarketplaceSubscription provisioning failed. - FAILED = "Failed" - #: MarketplaceSubscription is being updated. - UPDATING = "Updating" - CANCELED = "Canceled" - -class MarketplaceSubscriptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Marketplace Subscription is being fulfilled. - PENDING_FULFILLMENT_START = "PendingFulfillmentStart" - #: The customer can now use the Marketplace Subscription's - #: model and will be billed. - SUBSCRIBED = "Subscribed" - #: The customer could not be billed for the Marketplace Subscription. - #: The customer will not be able to access the model. - SUSPENDED = "Suspended" - #: Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. - #: A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, - #: after being in the Suspended state for some time. - UNSUBSCRIBED = "Unsubscribed" - -class MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MediaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ModelLifecycleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model lifecycle status. - """ - - GENERALLY_AVAILABLE = "GenerallyAvailable" - PREVIEW = "Preview" - -class ModelProvider(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of fine tuning. - """ - - #: Fine tuning using Azure Open AI model. - AZURE_OPEN_AI = "AzureOpenAI" - #: Fine tuning using custom model. - CUSTOM = "Custom" - -class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class ModelTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model task type enum. - """ - - CLASSIFICATION = "Classification" - REGRESSION = "Regression" - QUESTION_ANSWERING = "QuestionAnswering" - -class MonitorComputeIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute identity type enum. - """ - - #: Authenticates through user's AML token. - AML_TOKEN = "AmlToken" - #: Authenticates through a user-provided managed identity. - MANAGED_IDENTITY = "ManagedIdentity" - -class MonitorComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute type enum. - """ - - #: Serverless Spark compute. - SERVERLESS_SPARK = "ServerlessSpark" - -class MonitoringFeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Used for features of numerical data type. - NUMERICAL = "Numerical" - #: Used for features of categorical data type. - CATEGORICAL = "Categorical" - -class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Includes all features. - ALL_FEATURES = "AllFeatures" - #: Only includes the top contributing features, measured by feature attribution. - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - #: Includes a user-defined subset of features. - FEATURE_SUBSET = "FeatureSubset" - -class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitoring input data type enum. - """ - - #: An input data with a fixed window size. - STATIC = "Static" - #: An input data which rolls relatively to the monitor's current run time. - ROLLING = "Rolling" - #: An input data with tabular format which doesn't require preprocessing. - FIXED = "Fixed" - -class MonitoringModelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: A model trained for classification tasks. - CLASSIFICATION = "Classification" - #: A model trained for regressions tasks. - REGRESSION = "Regression" - -class MonitoringNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enables email notifications through AML notifications. - AML_NOTIFICATION = "AmlNotification" - #: Enables notifications through Azure Monitor by posting metrics to the workspace's Azure Monitor - #: instance. - AZURE_MONITOR = "AzureMonitor" - -class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Tracks model input data distribution change, comparing against training data or past production - #: data. - DATA_DRIFT = "DataDrift" - #: Tracks prediction result data distribution change, comparing against validation/test label data - #: or past production data. - PREDICTION_DRIFT = "PredictionDrift" - #: Tracks model input data integrity. - DATA_QUALITY = "DataQuality" - #: Tracks feature importance change in production, comparing against feature importance at - #: training time. - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - #: Tracks a custom signal provided by users. - CUSTOM = "Custom" - #: Tracks model performance based on ground truth data. - MODEL_PERFORMANCE = "ModelPerformance" - #: Tracks the safety and quality of generated content. - GENERATION_SAFETY_QUALITY = "GenerationSafetyQuality" - #: Tracks the token usage of generative endpoints. - GENERATION_TOKEN_STATISTICS = "GenerationTokenStatistics" - -class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Mode. - """ - - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class MultiSelect(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether multiSelect is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class Network(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NlpLearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class NodesValueType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated types for the nodes value - """ - - ALL = "All" - CUSTOM = "Custom" - -class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class ObjectDetectionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OneLakeArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine OneLake artifact type. - """ - - LAKE_HOUSE = "LakeHouse" - -class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - RESIZE = "Resize" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - RESIZE_FAILED = "ResizeFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OperationTrigger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - -class OsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -class PackageBuildState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Package build state returned in package response. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class PackageInputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mounting type of the model or the inputs - """ - - COPY = "Copy" - DOWNLOAD = "Download" - -class PackageInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the inputs. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - -class PatchStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The os patching status. - """ - - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - UNKNOWN = "Unknown" - -class PendingUploadCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the PendingUpload credentials type. - """ - - SAS = "SAS" - -class PendingUploadType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of storage to use for the pending upload location - """ - - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - -class PoolProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of pool related resources provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class ProtectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protection level associated with the Intellectual Property. - """ - - #: All means Intellectual Property is fully protected. - ALL = "All" - #: None means it is not an Intellectual Property. - NONE = "None" - -class Protocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RandomSamplingAlgorithmRule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Mean Absolute Error (MAE) metric. - MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" - #: The Root Mean Squared Error (RMSE) metric. - ROOT_MEAN_SQUARED_ERROR = "RootMeanSquaredError" - #: The Mean Squared Error (MSE) metric. - MEAN_SQUARED_ERROR = "MeanSquaredError" - -class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - YEAR = "Year" - MONTH = "Month" - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - -class RuleAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The action enum for networking rule. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class RuleCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - -class RuleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - IMPORT_DATA = "ImportData" - CREATE_MONITOR = "CreateMonitor" - -class ScheduleListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ScheduleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMPUTE_START_STOP = "ComputeStartStop" - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - IMPORT_DATA = "ImportData" - CREATE_MONITOR = "CreateMonitor" - FEATURE_STORE_MATERIALIZATION = "FeatureStoreMaterialization" - -class SeasonalityMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_PASSWORD = "KerberosPassword" - KERBEROS_KEYTAB = "KerberosKeytab" - -class ServerlessEndpointState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the Serverless Endpoint. - """ - - UNKNOWN = "Unknown" - CREATING = "Creating" - DELETING = "Deleting" - SUSPENDING = "Suspending" - REINSTATING = "Reinstating" - ONLINE = "Online" - SUSPENDED = "Suspended" - CREATION_FAILED = "CreationFailed" - DELETION_FAILED = "DeletionFailed" - -class ServerlessInferenceEndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY = "Key" - AAD = "AAD" - -class ServiceAccountKeyName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY1 = "Key1" - KEY2 = "Key2" - -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class StatusMessageLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class StorageAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class TextAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TrainingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Training mode dictates whether to use distributed training or not - """ - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - -class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class UseStl(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class VMPriceOSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" - -class VolumeDefinitionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WebhookType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the webhook callback service type. - """ - - AZURE_DEV_OPS = "AzureDevOps" - -class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py deleted file mode 100644 index ae7539830f7c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models.py +++ /dev/null @@ -1,35766 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - -from azure.core.exceptions import HttpResponseError - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.created_by_workspace_arm_id = None - self.expiry_time = kwargs.get('expiry_time', None) - self.group = None - self.is_shared_to_all = kwargs.get('is_shared_to_all', None) - self.metadata = kwargs.get('metadata', None) - self.shared_user_list = kwargs.get('shared_user_list', None) - self.target = kwargs.get('target', None) - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class DeploymentModel(msrest.serialization.Model): - """Properties of Cognitive Services account deployment model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - """ - super(DeploymentModel, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - self.source = kwargs.get('source', None) - self.call_rate_limit = None - - -class AccountModel(DeploymentModel): - """Cognitive Services account Model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - :ivar base_model: Base Model Identifier. - :vartype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar deprecation: Cognitive Services account ModelDeprecationInfo. - :vartype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - 'base_model': {'key': 'baseModel', 'type': 'DeploymentModel'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'skus': {'key': 'skus', 'type': '[ModelSku]'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'ModelDeprecationInfo'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword base_model: Base Model Identifier. - :paramtype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword deprecation: Cognitive Services account ModelDeprecationInfo. - :paramtype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - """ - super(AccountModel, self).__init__(**kwargs) - self.base_model = kwargs.get('base_model', None) - self.is_default_version = kwargs.get('is_default_version', None) - self.skus = kwargs.get('skus', None) - self.max_capacity = kwargs.get('max_capacity', None) - self.capabilities = kwargs.get('capabilities', None) - self.finetune_capabilities = kwargs.get('finetune_capabilities', None) - self.deprecation = kwargs.get('deprecation', None) - self.lifecycle_status = kwargs.get('lifecycle_status', None) - self.system_data = None - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar allocated: Gets or sets the total number of instances for the group. - :vartype allocated: int - :ivar assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :vartype assignment_failed: int - :ivar assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :vartype assignment_success: int - """ - - _attribute_map = { - 'allocated': {'key': 'allocated', 'type': 'int'}, - 'assignment_failed': {'key': 'assignmentFailed', 'type': 'int'}, - 'assignment_success': {'key': 'assignmentSuccess', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allocated: Gets or sets the total number of instances for the group. - :paramtype allocated: int - :keyword assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :paramtype assignment_failed: int - :keyword assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :paramtype assignment_success: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.allocated = kwargs.get('allocated', 0) - self.assignment_failed = kwargs.get('assignment_failed', 0) - self.assignment_success = kwargs.get('assignment_success', 0) - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - 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 - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = kwargs.get('condition', None) - self.value = kwargs.get('value', None) - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, FineTuningJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'FineTuning': 'FineTuningJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.secrets_configuration = kwargs.get('secrets_configuration', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class FineTuningVertical(msrest.serialization.Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOpenAiFineTuning, CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - _subtype_map = { - 'model_provider': {'AzureOpenAI': 'AzureOpenAiFineTuning', 'Custom': 'CustomModelFineTuning'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FineTuningVertical, self).__init__(**kwargs) - self.model = kwargs['model'] - self.model_provider = None # type: Optional[str] - self.task_type = kwargs['task_type'] - self.training_data = kwargs['training_data'] - self.validation_data = kwargs.get('validation_data', None) - - -class AzureOpenAiFineTuning(FineTuningVertical): - """AzureOpenAiFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': 'AzureOpenAiHyperParameters'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :paramtype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - super(AzureOpenAiFineTuning, self).__init__(**kwargs) - self.model_provider = 'AzureOpenAI' # type: str - self.hyper_parameters = kwargs.get('hyper_parameters', None) - - -class AzureOpenAiHyperParameters(msrest.serialization.Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'learning_rate_multiplier': {'key': 'learningRateMultiplier', 'type': 'float'}, - 'n_epochs': {'key': 'nEpochs', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :paramtype batch_size: int - :keyword learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning - rate may be useful to avoid over fitting. - :paramtype learning_rate_multiplier: float - :keyword n_epochs: The number of epochs to train the model for. An epoch refers to one full - cycle through the training dataset. - :paramtype n_epochs: int - """ - super(AzureOpenAiHyperParameters, self).__init__(**kwargs) - self.batch_size = kwargs.get('batch_size', None) - self.learning_rate_multiplier = kwargs.get('learning_rate_multiplier', None) - self.n_epochs = kwargs.get('n_epochs', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class CallRateLimit(msrest.serialization.Model): - """The call rate limit Cognitive Services account. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: - :vartype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: - :paramtype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - super(CallRateLimit, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.renewal_period = kwargs.get('renewal_period', None) - self.rules = kwargs.get('rules', None) - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = kwargs.get('minimum', None) - self.maximum = kwargs.get('maximum', None) - self.step = kwargs.get('step', None) - self.default = kwargs.get('default', None) - self.allowed_values = kwargs.get('allowed_values', None) - - -class CapacityReservationGroup(TrackedResource): - """CapacityReservationGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'CapacityReservationGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(CapacityReservationGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class CapacityReservationGroupProperties(msrest.serialization.Model): - """CapacityReservationGroupProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar offer: Offer used by this capacity reservation group. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :vartype reserved_capacity: int - """ - - _validation = { - 'reserved_capacity': {'required': True}, - } - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer: Offer used by this capacity reservation group. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :keyword reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :paramtype reserved_capacity: int - """ - super(CapacityReservationGroupProperties, self).__init__(**kwargs) - self.offer = kwargs.get('offer', None) - self.reserved_capacity = kwargs['reserved_capacity'] - - -class CapacityReservationGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CapacityReservationGroup entities. - - :ivar next_link: The link to the next page of CapacityReservationGroup objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CapacityReservationGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CapacityReservationGroup objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CapacityReservationGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - super(CapacityReservationGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Classification' # type: str - self.metric = kwargs['metric'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - self.training_mode = kwargs.get('training_mode', None) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentConfiguration(msrest.serialization.Model): - """Used for sweep over component. - - :ivar pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype pipeline_settings: any - """ - - _attribute_map = { - 'pipeline_settings': {'key': 'pipelineSettings', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype pipeline_settings: any - """ - super(ComponentConfiguration, self).__init__(**kwargs) - self.pipeline_settings = kwargs.get('pipeline_settings', None) - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.mount_mode = kwargs.get('mount_mode', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.enable_os_patching = kwargs.get('enable_os_patching', False) - self.enable_root_access = kwargs.get('enable_root_access', True) - self.enable_sso = kwargs.get('enable_sso', True) - self.release_quota_on_stop = kwargs.get('release_quota_on_stop', False) - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', 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) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = kwargs.get('associated_resource_id', None) - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = kwargs.get('endpoint_uri', None) - self.failure_reason = kwargs.get('failure_reason', None) - self.name = kwargs.get('name', None) - self.provisioning_state = None - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = kwargs.get('credentials', None) - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class CustomModelFineTuning(FineTuningVertical): - """CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning custom model. - :paramtype hyper_parameters: dict[str, str] - """ - super(CustomModelFineTuning, self).__init__(**kwargs) - self.model_provider = 'Custom' # type: str - self.hyper_parameters = kwargs.get('hyper_parameters', None) - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, GenerationSafetyQualityMonitoringSignal, GenerationTokenUsageSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenUsageSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = kwargs.get('notification_types', None) - self.properties = kwargs.get('properties', None) - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :ivar workspace_connection: A list of metrics to calculate and their associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :keyword workspace_connection: A list of metrics to calculate and their associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.inputs = kwargs.get('inputs', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.workspace_connection = kwargs.get('workspace_connection', None) - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) - self.kernel = kwargs.get('kernel', None) - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = kwargs.get('connection', None) - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(**kwargs) - self.source_type = 'database' # type: str - self.query = kwargs.get('query', None) - self.stored_procedure = kwargs.get('stored_procedure', None) - self.stored_procedure_params = kwargs.get('stored_procedure_params', None) - self.table_name = kwargs.get('table_name', None) - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.stage = kwargs.get('stage', None) - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = kwargs.get('asset_name', None) - self.source = kwargs.get('source', None) - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.locations = kwargs.get('locations', None) - self.max_instance_count = kwargs.get('max_instance_count', None) - self.properties = kwargs.get('properties', None) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = kwargs.get('destination_name', None) - self.destination_version = kwargs.get('destination_version', None) - self.registry_name = kwargs.get('registry_name', None) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.key_vault = kwargs.get('key_vault', None) - self.nsg = kwargs.get('nsg', None) - self.others = kwargs.get('others', None) - self.required_resource_providers = kwargs.get('required_resource_providers', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.storage_account = kwargs.get('storage_account', None) - self.udr = kwargs.get('udr', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = kwargs.get('password', None) - self.user_name = kwargs.get('user_name', None) - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) - self.status = kwargs['status'] - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - self.version = kwargs.get('version', None) - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[AccountModel]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs['feature_importance_settings'] - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.target_column = kwargs.get('target_column', None) - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = kwargs.get('data_availability_status', None) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.properties = kwargs.get('properties', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = kwargs.get('job_ids', None) - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) - self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(**kwargs) - self.source_type = 'file_system' # type: str - self.path = kwargs.get('path', None) - - -class FineTuningJob(JobBaseProperties): - """FineTuning Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar fine_tuning_details: Required. [Required]. - :vartype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'fine_tuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'fine_tuning_details': {'key': 'fineTuningDetails', 'type': 'FineTuningVertical'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword fine_tuning_details: Required. [Required]. - :paramtype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - super(FineTuningJob, self).__init__(**kwargs) - self.job_type = 'FineTuning' # type: str - self.fine_tuning_details = kwargs['fine_tuning_details'] - self.outputs = kwargs['outputs'] - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - self.data_context = kwargs.get('data_context', None) - self.input_data_type = None # type: Optional[str] - self.job_input_type = kwargs['job_input_type'] - self.uri = kwargs['uri'] - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(**kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.features_unknown_at_forecast_time = kwargs.get('features_unknown_at_forecast_time', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.status = kwargs.get('status', None) - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) - - -class GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - self.workspace_connection_id = kwargs.get('workspace_connection_id', None) - - -class GenerationTokenUsageMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenUsageMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationTokenUsageSignal(MonitoringSignalBase): - """Generation token usage signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenUsageMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenUsageSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.blob_uri = kwargs.get('blob_uri', None) - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :vartype bonus_extra_capacity: int - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :paramtype bonus_extra_capacity: int - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = kwargs.get('actual_capacity_info', None) - self.bonus_extra_capacity = kwargs.get('bonus_extra_capacity', 0) - self.endpoint_count = kwargs.get('endpoint_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) - self.version = kwargs.get('version', None) - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.log_training_metrics = kwargs.get('log_training_metrics', None) - self.log_validation_loss = kwargs.get('log_validation_loss', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = kwargs['data_import_definition'] - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_id: Required. [Required] Group within the same pool with which this endpoint needs - to be associated with. - :vartype group_id: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_id: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_id: str - """ - super(InferenceEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.endpoint_uri = None - self.group_id = kwargs['group_id'] - self.provisioning_state = None - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :vartype bonus_extra_capacity: int - :ivar metadata: Metadata for the inference group. - :vartype metadata: str - :ivar priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :vartype priority: int - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'metadata': {'key': 'metadata', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :paramtype bonus_extra_capacity: int - :keyword metadata: Metadata for the inference group. - :paramtype metadata: str - :keyword priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :paramtype priority: int - """ - super(InferenceGroupProperties, self).__init__(**kwargs) - self.bonus_extra_capacity = kwargs.get('bonus_extra_capacity', 0) - self.metadata = kwargs.get('metadata', None) - self.priority = kwargs.get('priority', 0) - self.provisioning_state = None - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar code_configuration: Code configuration for the inference pool. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar environment_configuration: EnvironmentConfiguration for the inference pool. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :ivar model_configuration: ModelConfiguration for the inference pool. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :ivar node_sku_type: Required. [Required] Compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: Request configuration for the inference pool. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'node_sku_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'PoolEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'PoolModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword code_configuration: Code configuration for the inference pool. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword environment_configuration: EnvironmentConfiguration for the inference pool. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :keyword model_configuration: ModelConfiguration for the inference pool. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :keyword node_sku_type: Required. [Required] Compute instance type. - :paramtype node_sku_type: str - :keyword request_configuration: Request configuration for the inference pool. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferencePoolProperties, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.environment_configuration = kwargs.get('environment_configuration', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.node_sku_type = kwargs['node_sku_type'] - self.provisioning_state = None - self.request_configuration = kwargs.get('request_configuration', None) - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = kwargs.get('argv', None) - self.display_name = kwargs.get('display_name', None) - self.language = kwargs.get('language', None) - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = kwargs.get('identity_client_id', None) - self.key_identifier = kwargs['key_identifier'] - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) - - -class LabelingJob(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = kwargs.get('container_registry_credentials', None) - self.notebook_access_keys = kwargs.get('notebook_access_keys', None) - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = kwargs.get('identity', None) - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = kwargs.get('managed_identity_type', None) - self.user_managed_identity_client_id = kwargs.get('user_managed_identity_client_id', None) - self.user_managed_identity_principal_id = kwargs.get('user_managed_identity_principal_id', None) - self.user_managed_identity_resource_id = kwargs.get('user_managed_identity_resource_id', None) - self.user_managed_identity_tenant_id = kwargs.get('user_managed_identity_tenant_id', None) - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = kwargs.get('spark_ready', None) - self.status = kwargs.get('status', None) - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) - self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.type = 'managedOnlineEndpoint' # type: str - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword principal_id: Identity principal Id. - :paramtype principal_id: str - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = kwargs.get('assigned_identities', None) - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The Offer ID of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The Plan ID of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The Publisher ID of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = kwargs['model_id'] - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelDeprecationInfo(msrest.serialization.Model): - """Cognitive Services account ModelDeprecationInfo. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: str - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: str - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'str'}, - 'inference': {'key': 'inference', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: str - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: str - """ - super(ModelDeprecationInfo, self).__init__(**kwargs) - self.fine_tune = kwargs.get('fine_tune', None) - self.inference = kwargs.get('inference', None) - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service which - performance will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - which performance will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(ModelPerformanceSignal, self).__init__(**kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. [Required]. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. [Required]. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = kwargs['model_id'] - - -class ModelSku(msrest.serialization.Model): - """Describes an available Cognitive Services Model SKU. - - :ivar name: The name of the model SKU. - :vartype name: str - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar capacity: The capacity configuration. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :ivar rate_limits: The list of rateLimit. - :vartype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'capacity': {'key': 'capacity', 'type': 'CapacityConfig'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[CallRateLimit]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword capacity: The capacity configuration. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :keyword rate_limits: The list of rateLimit. - :paramtype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - super(ModelSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.usage_name = kwargs.get('usage_name', None) - self.deprecation_date = kwargs.get('deprecation_date', None) - self.capacity = kwargs.get('capacity', None) - self.rate_limits = kwargs.get('rate_limits', None) - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = kwargs.get('alert_notification_settings', None) - self.compute_configuration = kwargs['compute_configuration'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = kwargs.get('feature', None) - self.values = kwargs.get('values', None) - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = kwargs.get('deployment_id', None) - self.model_id = kwargs.get('model_id', None) - self.task_type = kwargs['task_type'] - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = kwargs.get('environment_variables', None) - self.secrets = kwargs.get('secrets', None) - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = kwargs.get('email_notification_settings', None) - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = kwargs['compute_identity'] - self.instance_type = kwargs['instance_type'] - self.runtime_version = kwargs['runtime_version'] - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.is_private_link_enabled = kwargs.get('is_private_link_enabled', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - self.resource_id = kwargs.get('resource_id', None) - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = kwargs.get('credentials', None) - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(OpenAIEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = kwargs.get('patch_status', None) - self.latest_patch_time = kwargs.get('latest_patch_time', None) - self.reboot_pending = kwargs.get('reboot_pending', None) - self.scheduled_reboot_time = kwargs.get('scheduled_reboot_time', None) - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Properties can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Property dictionary. Properties can be added, removed, and updated. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.target_environment_id = kwargs['target_environment_id'] - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Tags can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'properties': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = None - self.tags = None - self.target_environment_id = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = kwargs.get('notification_setting', None) - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = kwargs.get('webhooks', None) - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) - - -class PoolEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: dict[str, str] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: dict[str, str] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(PoolEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.readiness_probe = kwargs.get('readiness_probe', None) - self.startup_probe = kwargs.get('startup_probe', None) - - -class PoolModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(PoolModelConfiguration, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - - -class PoolStatus(msrest.serialization.Model): - """PoolStatus. - - :ivar actual_capacity: Gets or sets the actual number of instances in the pool. - :vartype actual_capacity: int - :ivar group_count: Gets or sets the actual number of groups in the pool. - :vartype group_count: int - :ivar requested_capacity: Gets or sets the requested number of instances for the pool. - :vartype requested_capacity: int - :ivar reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :vartype reserved_capacity: int - """ - - _attribute_map = { - 'actual_capacity': {'key': 'actualCapacity', 'type': 'int'}, - 'group_count': {'key': 'groupCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity: Gets or sets the actual number of instances in the pool. - :paramtype actual_capacity: int - :keyword group_count: Gets or sets the actual number of groups in the pool. - :paramtype group_count: int - :keyword requested_capacity: Gets or sets the requested number of instances for the pool. - :paramtype requested_capacity: int - :keyword reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :paramtype reserved_capacity: int - """ - super(PoolStatus, self).__init__(**kwargs) - self.actual_capacity = kwargs.get('actual_capacity', 0) - self.group_count = kwargs.get('group_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - self.reserved_capacity = kwargs.get('reserved_capacity', 0) - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - self.subresource_target = kwargs.get('subresource_target', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - self.priority = kwargs.get('priority', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = kwargs.get('address', None) - self.dashboard_port = kwargs.get('dashboard_port', None) - self.head_node_additional_args = kwargs.get('head_node_additional_args', None) - self.include_dashboard = kwargs.get('include_dashboard', None) - self.port = kwargs.get('port', None) - self.worker_node_additional_args = kwargs.get('worker_node_additional_args', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.managed_resource_group_settings = kwargs.get('managed_resource_group_settings', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.registry_private_endpoint_connections = kwargs.get('registry_private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = kwargs.get('passwords', None) - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(**kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.registry_private_link_service_connection_state = kwargs.get('registry_private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Regression' # type: str - self.metric = kwargs['metric'] - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) - - -class RequestMatchPattern(msrest.serialization.Model): - """RequestMatchPattern. - - :ivar path: - :vartype path: str - :ivar method: - :vartype method: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: - :paramtype path: str - :keyword method: - :paramtype method: str - """ - super(RequestMatchPattern, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - self.method = kwargs.get('method', None) - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = kwargs.get('target_vm_size', None) - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the trailing data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(**kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_offset = kwargs['window_offset'] - self.window_size = kwargs['window_size'] - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) - self.provisioning_state = None - self.trigger = kwargs['trigger'] - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.workspace_secret_name = kwargs.get('workspace_secret_name', None) - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = kwargs.get('serverless_compute_custom_subnet', None) - self.serverless_compute_no_public_ip = kwargs.get('serverless_compute_no_public_ip', None) - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = kwargs['capacity_reservation_group_id'] - self.endpoint_reserved_capacity = kwargs.get('endpoint_reserved_capacity', None) - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible values - include: "Key", "AAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription ARM ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar offer: The publisher-defined Serverless Offer to provision the endpoint with. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - """ - - _validation = { - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible - values include: "Key", "AAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :keyword offer: The publisher-defined Serverless Offer to provision the endpoint with. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs.get('auth_mode', None) - self.capacity_reservation = kwargs.get('capacity_reservation', None) - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = kwargs.get('model_settings', None) - self.offer = kwargs.get('offer', None) - self.provisioning_state = None - self.endpoint_state = None - - -class ServerlessEndpointStatus(msrest.serialization.Model): - """ServerlessEndpointStatus. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metrics: The model-specific metrics from the backing inference endpoint. - :vartype metrics: dict[str, str] - """ - - _validation = { - 'metrics': {'readonly': True}, - } - - _attribute_map = { - 'metrics': {'key': 'metrics', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ServerlessEndpointStatus, self).__init__(**kwargs) - self.metrics = None - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. [Required] The name of the Serverless Offer. - :vartype offer_name: str - :ivar publisher: Required. [Required] Publisher name of the Serverless Offer. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer_name: Required. [Required] The name of the Serverless Offer. - :paramtype offer_name: str - :keyword publisher: Required. [Required] Publisher name of the Serverless Offer. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = kwargs['offer_name'] - self.publisher = kwargs['publisher'] - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.address_prefixes = None - self.port_ranges = kwargs.get('port_ranges', None) - self.protocol = kwargs.get('protocol', None) - self.service_tag = kwargs.get('service_tag', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.group_id = kwargs.get('group_id', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.Speech' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(SpeechEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(**kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_end = kwargs['window_end'] - self.window_start = kwargs['window_start'] - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar component_configuration: Component Configuration for sweep over component. - :vartype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'component_configuration': {'key': 'componentConfiguration', 'type': 'ComponentConfiguration'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword component_configuration: Component Configuration for sweep over component. - :paramtype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.component_configuration = kwargs.get('component_configuration', None) - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ThrottlingRule(msrest.serialization.Model): - """ThrottlingRule. - - :ivar key: - :vartype key: str - :ivar renewal_period: - :vartype renewal_period: float - :ivar count: - :vartype count: float - :ivar min_count: - :vartype min_count: float - :ivar dynamic_throttling_enabled: - :vartype dynamic_throttling_enabled: bool - :ivar match_patterns: - :vartype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'float'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[RequestMatchPattern]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - :keyword renewal_period: - :paramtype renewal_period: float - :keyword count: - :paramtype count: float - :keyword min_count: - :paramtype min_count: float - :keyword dynamic_throttling_enabled: - :paramtype dynamic_throttling_enabled: bool - :keyword match_patterns: - :paramtype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - super(ThrottlingRule, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.renewal_period = kwargs.get('renewal_period', None) - self.count = kwargs.get('count', None) - self.min_count = kwargs.get('min_count', None) - self.dynamic_throttling_enabled = kwargs.get('dynamic_throttling_enabled', None) - self.match_patterns = kwargs.get('match_patterns', None) - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TriggerOnceRequest(msrest.serialization.Model): - """TriggerOnceRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar schedule_time: Required. [Required] Specify the schedule time for trigger once. - :vartype schedule_time: str - """ - - _validation = { - 'schedule_time': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'schedule_time': {'key': 'scheduleTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword schedule_time: Required. [Required] Specify the schedule time for trigger once. - :paramtype schedule_time: str - """ - super(TriggerOnceRequest, self).__init__(**kwargs) - self.schedule_time = kwargs['schedule_time'] - - -class TriggerRunSubmissionDto(msrest.serialization.Model): - """TriggerRunSubmissionDto. - - :ivar schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :vartype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar submission_id: - :vartype submission_id: str - """ - - _attribute_map = { - 'schedule_action_type': {'key': 'scheduleActionType', 'type': 'str'}, - 'submission_id': {'key': 'submissionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :paramtype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :keyword submission_id: - :paramtype submission_id: str - """ - super(TriggerRunSubmissionDto, self).__init__(**kwargs) - self.schedule_action_type = kwargs.get('schedule_action_type', None) - self.submission_id = kwargs.get('submission_id', None) - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', None) - self.application_insights = kwargs.get('application_insights', None) - self.associated_workspaces = kwargs.get('associated_workspaces', None) - self.container_registries = kwargs.get('container_registries', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.hbi_workspace = kwargs.get('hbi_workspace', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.key_vault = kwargs.get('key_vault', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.managed_network = kwargs.get('managed_network', None) - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.service_provisioned_resource_group = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.storage_account = kwargs.get('storage_account', None) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.storage_hns_enabled = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.tenant_id = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) - self.workspace_hub_config = kwargs.get('workspace_hub_config', None) - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = kwargs.get('auth_url', None) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.developer_token = kwargs.get('developer_token', None) - self.password = kwargs.get('password', None) - self.refresh_token = kwargs.get('refresh_token', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.username = kwargs.get('username', None) - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = kwargs.get('password', None) - self.security_token = kwargs.get('security_token', None) - self.username = kwargs.get('username', None) - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = kwargs.get('additional_workspace_storage_accounts', None) - self.default_workspace_resource_group = kwargs.get('default_workspace_resource_group', None) - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.managed_network = kwargs.get('managed_network', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py deleted file mode 100644 index 0cce7c2c64a8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/models/_models_py3.py +++ /dev/null @@ -1,38826 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -import msrest.serialization - -from azure.core.exceptions import HttpResponseError - -from ._azure_machine_learning_workspaces_enums import * - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.created_by_workspace_arm_id = None - self.expiry_time = expiry_time - self.group = None - self.is_shared_to_all = is_shared_to_all - self.metadata = metadata - self.shared_user_list = shared_user_list - self.target = target - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = credentials - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - *, - key1: Optional[str] = None, - key2: Optional[str] = None, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = credentials - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class DeploymentModel(msrest.serialization.Model): - """Properties of Cognitive Services account deployment model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - version: Optional[str] = None, - source: Optional[str] = None, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - """ - super(DeploymentModel, self).__init__(**kwargs) - self.format = format - self.name = name - self.version = version - self.source = source - self.call_rate_limit = None - - -class AccountModel(DeploymentModel): - """Cognitive Services account Model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - :ivar base_model: Base Model Identifier. - :vartype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar deprecation: Cognitive Services account ModelDeprecationInfo. - :vartype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - 'base_model': {'key': 'baseModel', 'type': 'DeploymentModel'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'skus': {'key': 'skus', 'type': '[ModelSku]'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'ModelDeprecationInfo'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - version: Optional[str] = None, - source: Optional[str] = None, - base_model: Optional["DeploymentModel"] = None, - is_default_version: Optional[bool] = None, - skus: Optional[List["ModelSku"]] = None, - max_capacity: Optional[int] = None, - capabilities: Optional[Dict[str, str]] = None, - finetune_capabilities: Optional[Dict[str, str]] = None, - deprecation: Optional["ModelDeprecationInfo"] = None, - lifecycle_status: Optional[Union[str, "ModelLifecycleStatus"]] = None, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword base_model: Base Model Identifier. - :paramtype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword deprecation: Cognitive Services account ModelDeprecationInfo. - :paramtype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - """ - super(AccountModel, self).__init__(format=format, name=name, version=version, source=source, **kwargs) - self.base_model = base_model - self.is_default_version = is_default_version - self.skus = skus - self.max_capacity = max_capacity - self.capabilities = capabilities - self.finetune_capabilities = finetune_capabilities - self.deprecation = deprecation - self.lifecycle_status = lifecycle_status - self.system_data = None - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - *, - system_created_acr_account: Optional["SystemCreatedAcrAccount"] = None, - user_created_acr_account: Optional["UserCreatedAcrAccount"] = None, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = system_created_acr_account - self.user_created_acr_account = user_created_acr_account - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar allocated: Gets or sets the total number of instances for the group. - :vartype allocated: int - :ivar assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :vartype assignment_failed: int - :ivar assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :vartype assignment_success: int - """ - - _attribute_map = { - 'allocated': {'key': 'allocated', 'type': 'int'}, - 'assignment_failed': {'key': 'assignmentFailed', 'type': 'int'}, - 'assignment_success': {'key': 'assignmentSuccess', 'type': 'int'}, - } - - def __init__( - self, - *, - allocated: Optional[int] = 0, - assignment_failed: Optional[int] = 0, - assignment_success: Optional[int] = 0, - **kwargs - ): - """ - :keyword allocated: Gets or sets the total number of instances for the group. - :paramtype allocated: int - :keyword assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :paramtype assignment_failed: int - :keyword assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :paramtype assignment_success: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.allocated = allocated - self.assignment_failed = assignment_failed - self.assignment_success = assignment_success - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = properties - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = properties - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - property_bag: Optional[Any] = None, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - self.property_bag = property_bag - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionApiKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = credentials - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = resource_id - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.auto_delete_setting = auto_delete_setting - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - condition: Optional[Union[str, "AutoDeleteCondition"]] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = condition - self.value = value - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, FineTuningJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'FineTuning': 'FineTuningJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = notification_setting - self.secrets_configuration = secrets_configuration - self.services = services - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.task_type = None # type: Optional[str] - self.training_data = training_data - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = event_type - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = code_configuration - - -class FineTuningVertical(msrest.serialization.Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOpenAiFineTuning, CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - _subtype_map = { - 'model_provider': {'AzureOpenAI': 'AzureOpenAiFineTuning', 'Custom': 'CustomModelFineTuning'} - } - - def __init__( - self, - *, - model: "MLFlowModelJobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FineTuningVertical, self).__init__(**kwargs) - self.model = model - self.model_provider = None # type: Optional[str] - self.task_type = task_type - self.training_data = training_data - self.validation_data = validation_data - - -class AzureOpenAiFineTuning(FineTuningVertical): - """AzureOpenAiFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': 'AzureOpenAiHyperParameters'}, - } - - def __init__( - self, - *, - model: "MLFlowModelJobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - hyper_parameters: Optional["AzureOpenAiHyperParameters"] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :paramtype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - super(AzureOpenAiFineTuning, self).__init__(model=model, task_type=task_type, training_data=training_data, validation_data=validation_data, **kwargs) - self.model_provider = 'AzureOpenAI' # type: str - self.hyper_parameters = hyper_parameters - - -class AzureOpenAiHyperParameters(msrest.serialization.Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'learning_rate_multiplier': {'key': 'learningRateMultiplier', 'type': 'float'}, - 'n_epochs': {'key': 'nEpochs', 'type': 'int'}, - } - - def __init__( - self, - *, - batch_size: Optional[int] = None, - learning_rate_multiplier: Optional[float] = None, - n_epochs: Optional[int] = None, - **kwargs - ): - """ - :keyword batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :paramtype batch_size: int - :keyword learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning - rate may be useful to avoid over fitting. - :paramtype learning_rate_multiplier: float - :keyword n_epochs: The number of epochs to train the model for. An epoch refers to one full - cycle through the training dataset. - :paramtype n_epochs: int - """ - super(AzureOpenAiHyperParameters, self).__init__(**kwargs) - self.batch_size = batch_size - self.learning_rate_multiplier = learning_rate_multiplier - self.n_epochs = n_epochs - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = resource_id - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["DeploymentResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.deployment_configuration = deployment_configuration - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - component_id: Optional["IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = component_id - self.description = description - self.settings = settings - self.tags = tags - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = propagation - self.create_host_path = create_host_path - self.selinux = selinux - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class CallRateLimit(msrest.serialization.Model): - """The call rate limit Cognitive Services account. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: - :vartype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, - } - - def __init__( - self, - *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[List["ThrottlingRule"]] = None, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: - :paramtype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - super(CallRateLimit, self).__init__(**kwargs) - self.count = count - self.renewal_period = renewal_period - self.rules = rules - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - *, - minimum: Optional[int] = None, - maximum: Optional[int] = None, - step: Optional[int] = None, - default: Optional[int] = None, - allowed_values: Optional[List[int]] = None, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = minimum - self.maximum = maximum - self.step = step - self.default = default - self.allowed_values = allowed_values - - -class CapacityReservationGroup(TrackedResource): - """CapacityReservationGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'CapacityReservationGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "CapacityReservationGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(CapacityReservationGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class CapacityReservationGroupProperties(msrest.serialization.Model): - """CapacityReservationGroupProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar offer: Offer used by this capacity reservation group. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :vartype reserved_capacity: int - """ - - _validation = { - 'reserved_capacity': {'required': True}, - } - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - reserved_capacity: int, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword offer: Offer used by this capacity reservation group. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :keyword reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :paramtype reserved_capacity: int - """ - super(CapacityReservationGroupProperties, self).__init__(**kwargs) - self.offer = offer - self.reserved_capacity = reserved_capacity - - -class CapacityReservationGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CapacityReservationGroup entities. - - :ivar next_link: The link to the next page of CapacityReservationGroup objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CapacityReservationGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CapacityReservationGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CapacityReservationGroup objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CapacityReservationGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - super(CapacityReservationGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["ClassificationTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = threshold - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "ClassificationModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Classification' # type: str - self.metric = metric - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - self.training_mode = training_mode - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[str] = None, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = 1, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = client_id - self.data_collection_mode = data_collection_mode - self.data_id = data_id - self.sampling_rate = sampling_rate - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.queue_settings = queue_settings - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentConfiguration(msrest.serialization.Model): - """Used for sweep over component. - - :ivar pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype pipeline_settings: any - """ - - _attribute_map = { - 'pipeline_settings': {'key': 'pipelineSettings', 'type': 'object'}, - } - - def __init__( - self, - *, - pipeline_settings: Optional[Any] = None, - **kwargs - ): - """ - :keyword pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype pipeline_settings: any - """ - super(ComponentConfiguration, self).__init__(**kwargs) - self.pipeline_settings = pipeline_settings - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - self.stage = stage - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "Network"]] = None, - environment: Optional["ComputeInstanceEnvironmentInfo"] = None, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = name - self.autosave = autosave - self.gpu = gpu - self.network = network - self.environment = environment - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - caching: Optional[Union[str, "Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = caching - self.disk_size_gb = disk_size_gb - self.lun = lun - self.storage_account_type = storage_account_type - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "MountAction"]] = None, - mount_mode: Optional[Union[str, "MountMode"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = source - self.source_type = source_type - self.mount_name = mount_name - self.mount_action = mount_action - self.mount_mode = mount_mode - self.created_by = created_by - self.mount_path = mount_path - self.mount_state = mount_state - self.mounted_on = mounted_on - self.error = error - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = name - self.version = version - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "OperationTrigger"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - self.operation_trigger = operation_trigger - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - enable_os_patching: Optional[bool] = False, - enable_root_access: Optional[bool] = True, - enable_sso: Optional[bool] = True, - release_quota_on_stop: Optional[bool] = False, - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.autologger_settings = autologger_settings - self.ssh_settings = ssh_settings - self.custom_services = custom_services - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.enable_os_patching = enable_os_patching - self.enable_root_access = enable_root_access - self.enable_sso = enable_sso - self.release_quota_on_stop = release_quota_on_stop - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - self.idle_time_before_shutdown = idle_time_before_shutdown - self.enable_node_public_ip = enable_node_public_ip - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = runtime - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "ComputeWeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = spark_runtime_version - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "ComputeTriggerType"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - schedule: Optional["ScheduleBase"] = None, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.action = action - self.trigger_type = trigger_type - self.recurrence = recurrence - self.cron = cron - self.schedule = schedule - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = failure_reason - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties'} - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = associated_resource_id - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = endpoint_uri - self.failure_reason = failure_reason - self.name = name - self.provisioning_state = None - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, **kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = monitor_definition - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - *, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = end_time - self.start_time = start_time - self.time_zone = time_zone - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = expression - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = inference_configuration - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - *, - keys: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = keys - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["CustomKeys"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = credentials - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: str, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class CustomModelFineTuning(FineTuningVertical): - """CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - } - - def __init__( - self, - *, - model: "MLFlowModelJobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - hyper_parameters: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning custom model. - :paramtype hyper_parameters: dict[str, str] - """ - super(CustomModelFineTuning, self).__init__(model=model, task_type=task_type, training_data=training_data, validation_data=validation_data, **kwargs) - self.model_provider = 'Custom' # type: str - self.hyper_parameters = hyper_parameters - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'custom_model' # type: str - self.description = description - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, GenerationSafetyQualityMonitoringSignal, GenerationTokenUsageSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenUsageSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = notification_types - self.properties = properties - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :ivar workspace_connection: A list of metrics to calculate and their associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - input_assets: Optional[Dict[str, "MonitoringInputDataBase"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - workspace_connection: Optional["MonitoringWorkspaceConnection"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :keyword workspace_connection: A list of metrics to calculate and their associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = component_id - self.input_assets = input_assets - self.inputs = inputs - self.metric_thresholds = metric_thresholds - self.workspace_connection = workspace_connection - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - name: Optional[str] = None, - image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, - docker: Optional["Docker"] = None, - endpoints: Optional[List["Endpoint"]] = None, - volumes: Optional[List["VolumeDefinition"]] = None, - kernel: Optional["JupyterKernelConfig"] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.image = image - self.environment_variables = environment_variables - self.docker = docker - self.endpoints = endpoints - self.volumes = volumes - self.kernel = kernel - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - *, - connection: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = connection - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - query: Optional[str] = None, - stored_procedure: Optional[str] = None, - stored_procedure_params: Optional[List[Dict[str, str]]] = None, - table_name: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'database' # type: str - self.query = query - self.stored_procedure = stored_procedure - self.stored_procedure_params = stored_procedure_params - self.table_name = table_name - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = properties - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - *, - collections: Dict[str, "Collection"], - request_logging: Optional["RequestLogging"] = None, - rolling_rate: Optional[Union[str, "RollingRateType"]] = None, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = collections - self.request_logging = request_logging - self.rolling_rate = rolling_rate - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = data_segment - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - self.intellectual_property = intellectual_property - self.stage = stage - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - asset_name: Optional[str] = None, - source: Optional["DataImportSource"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = asset_name - self.source = source - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = properties - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataQualityMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Datastore"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.locations = locations - self.max_instance_count = max_instance_count - self.properties = properties - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - *, - destination_name: Optional[str] = None, - destination_version: Optional[str] = None, - registry_name: Optional[str] = None, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = destination_name - self.destination_version = destination_version - self.registry_name = registry_name - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - *, - application_insights: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - required_resource_providers: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - udr: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = application_insights - self.container_registry = container_registry - self.dns_resolution = dns_resolution - self.key_vault = key_vault - self.nsg = nsg - self.others = others - self.required_resource_providers = required_resource_providers - self.resource_lock = resource_lock - self.storage_account = storage_account - self.udr = udr - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - privileged: Optional[bool] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.privileged = privileged - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - user_name: Optional[str] = None, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = password - self.user_name = user_name - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_properties: "KeyVaultProperties", - status: Union[str, "EncryptionStatus"], - cosmos_db_resource_id: Optional[str] = None, - identity: Optional["IdentityForCmk"] = None, - search_account_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = cosmos_db_resource_id - self.identity = identity - self.key_vault_properties = key_vault_properties - self.search_account_resource_id = search_account_resource_id - self.status = status - self.storage_account_resource_id = storage_account_resource_id - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - *, - key_vault_properties: "EncryptionKeyVaultUpdateProperties", - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = key_vault_properties - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "Protocol"]] = "tcp", - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = protocol - self.name = name - self.target = target - self.published = published - self.host_ip = host_ip - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - source: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = format - self.name = name - self.source = source - self.version = version - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointDeploymentResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - *, - keys: Optional["AccountApiKeys"] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = keys - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[AccountModel]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["AccountModel"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = endpoint_invocation_definition - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "EnvironmentVariableType"]] = "local", - value: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.value = value - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - auto_rebuild: Optional[Union[str, "AutoRebuildSetting"]] = None, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.auto_rebuild = auto_rebuild - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.intellectual_property = intellectual_property - self.os_type = os_type - self.provisioning_state = None - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpointsPropertyBag"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = properties - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - feature_importance_settings: "FeatureImportanceSettings", - metric_threshold: "FeatureAttributionMetricThreshold", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "FeatureAttributionMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "FeatureImportanceMode"]] = None, - target_column: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = mode - self.target_column = target_column - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - feature_name: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.data_type = data_type - self.feature_name = feature_name - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Feature"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = path - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - data_availability_status: Optional[List[Union[str, "DataAvailabilityStatus"]]] = None, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = data_availability_status - self.description = description - self.display_name = display_name - self.feature_window = feature_window - self.job_id = job_id - self.properties = properties - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - job_ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = job_ids - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - entities: Optional[List[str]] = None, - materialization_settings: Optional["MaterializationSettings"] = None, - specification: Optional["FeaturesetSpecification"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.entities = entities - self.materialization_settings = materialization_settings - self.provisioning_state = None - self.specification = specification - self.stage = stage - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - index_columns: Optional[List["IndexColumn"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.index_columns = index_columns - self.provisioning_state = None - self.stage = stage - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = compute_runtime - self.offline_store_connection_name = offline_store_connection_name - self.online_store_connection_name = online_store_connection_name - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - *, - features: List[str], - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = features - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = feature_window_end - self.feature_window_start = feature_window_start - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'file_system' # type: str - self.path = path - - -class FineTuningJob(JobBaseProperties): - """FineTuning Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar fine_tuning_details: Required. [Required]. - :vartype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'fine_tuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'fine_tuning_details': {'key': 'fineTuningDetails', 'type': 'FineTuningVertical'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - } - - def __init__( - self, - *, - fine_tuning_details: "FineTuningVertical", - outputs: Dict[str, "JobOutput"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword fine_tuning_details: Required. [Required]. - :paramtype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - super(FineTuningJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'FineTuning' # type: str - self.fine_tuning_details = fine_tuning_details - self.outputs = outputs - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = columns - self.data_context = data_context - self.input_data_type = None # type: Optional[str] - self.job_input_type = job_input_type - self.uri = uri - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["ForecastingTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - features_unknown_at_forecast_time: Optional[List[str]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.features_unknown_at_forecast_time = features_unknown_at_forecast_time - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpoints"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = category - self.status = status - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -class GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "GenerationSafetyQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationSafetyQualityMetricThreshold"], - sampling_rate: float, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - workspace_connection_id: Optional[str] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - self.workspace_connection_id = workspace_connection_id - - -class GenerationTokenUsageMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "GenerationTokenUsageMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenUsageMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationTokenUsageSignal(MonitoringSignalBase): - """Generation token usage signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenUsageMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationTokenUsageMetricThreshold"], - sampling_rate: float, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenUsageSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["DataReferenceCredential"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - blob_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = asset_id - self.blob_uri = blob_uri - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["GetBlobReferenceForConsumptionDto"] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :vartype bonus_extra_capacity: int - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity_info: Optional["ActualCapacityInfo"] = None, - bonus_extra_capacity: Optional[int] = 0, - endpoint_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :paramtype bonus_extra_capacity: int - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = actual_capacity_info - self.bonus_extra_capacity = bonus_extra_capacity - self.endpoint_count = endpoint_count - self.requested_capacity = requested_capacity - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - name_node_address: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - hdfs_server_certificate: Optional[str] = None, - protocol: Optional[str] = "http", - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = hdfs_server_certificate - self.name_node_address = name_node_address - self.protocol = protocol - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = properties - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = idle_time_before_shutdown - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - self.version = version - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = current_image_version - self.latest_image_version = latest_image_version - self.is_latest_os_image_version = is_latest_os_image_version - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_model = checkpoint_model - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - log_training_metrics: Optional[Union[str, "LogTrainingMetrics"]] = None, - log_validation_loss: Optional[Union[str, "LogValidationLoss"]] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.log_training_metrics = log_training_metrics - self.log_validation_loss = log_validation_loss - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - *, - data_import_definition: "DataImport", - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = data_import_definition - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = column_name - self.data_type = data_type - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_id: Required. [Required] Group within the same pool with which this endpoint needs - to be associated with. - :vartype group_id: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "AuthMode"], - group_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_id: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_id: str - """ - super(InferenceEndpointProperties, self).__init__(description=description, properties=properties, **kwargs) - self.auth_mode = auth_mode - self.endpoint_uri = None - self.group_id = group_id - self.provisioning_state = None - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :vartype bonus_extra_capacity: int - :ivar metadata: Metadata for the inference group. - :vartype metadata: str - :ivar priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :vartype priority: int - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'metadata': {'key': 'metadata', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - bonus_extra_capacity: Optional[int] = 0, - metadata: Optional[str] = None, - priority: Optional[int] = 0, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :paramtype bonus_extra_capacity: int - :keyword metadata: Metadata for the inference group. - :paramtype metadata: str - :keyword priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :paramtype priority: int - """ - super(InferenceGroupProperties, self).__init__(description=description, properties=properties, **kwargs) - self.bonus_extra_capacity = bonus_extra_capacity - self.metadata = metadata - self.priority = priority - self.provisioning_state = None - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferencePoolProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar code_configuration: Code configuration for the inference pool. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar environment_configuration: EnvironmentConfiguration for the inference pool. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :ivar model_configuration: ModelConfiguration for the inference pool. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :ivar node_sku_type: Required. [Required] Compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: Request configuration for the inference pool. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'node_sku_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'PoolEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'PoolModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - *, - node_sku_type: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - code_configuration: Optional["CodeConfiguration"] = None, - environment_configuration: Optional["PoolEnvironmentConfiguration"] = None, - model_configuration: Optional["PoolModelConfiguration"] = None, - request_configuration: Optional["RequestConfiguration"] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword code_configuration: Code configuration for the inference pool. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword environment_configuration: EnvironmentConfiguration for the inference pool. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :keyword model_configuration: ModelConfiguration for the inference pool. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :keyword node_sku_type: Required. [Required] Compute instance type. - :paramtype node_sku_type: str - :keyword request_configuration: Request configuration for the inference pool. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferencePoolProperties, self).__init__(description=description, properties=properties, **kwargs) - self.code_configuration = code_configuration - self.environment_configuration = environment_configuration - self.model_configuration = model_configuration - self.node_sku_type = node_sku_type - self.provisioning_state = None - self.request_configuration = request_configuration - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferencePool"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - publisher: str, - protection_level: Optional[Union[str, "ProtectionLevel"]] = None, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = protection_level - self.publisher = publisher - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - docker_args: Optional[str] = None, - shm_size: Optional[str] = "2g", - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - self.docker_args = docker_args - self.shm_size = shm_size - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = job_definition - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["Nodes"] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.nodes = nodes - self.port = port - self.properties = properties - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - argv: Optional[List[str]] = None, - display_name: Optional[str] = None, - language: Optional[str] = None, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = argv - self.display_name = display_name - self.language = language - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosKeytabSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kerberos_keytab - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosPasswordSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kerberos_password - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - key_vault_arm_id: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = identity_client_id - self.key_identifier = key_identifier - self.key_vault_arm_id = key_vault_arm_id - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.data_collector = data_collector - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - *, - container_registry_credentials: Optional["RegistryListCredentialsResult"] = None, - notebook_access_keys: Optional["ListNotebookKeysResult"] = None, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = container_registry_credentials - self.notebook_access_keys = notebook_access_keys - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str - self.value = value - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = identity - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - managed_identity_type: Optional[str] = None, - user_managed_identity_client_id: Optional[str] = None, - user_managed_identity_principal_id: Optional[str] = None, - user_managed_identity_resource_id: Optional[str] = None, - user_managed_identity_tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = managed_identity_type - self.user_managed_identity_client_id = user_managed_identity_client_id - self.user_managed_identity_principal_id = user_managed_identity_principal_id - self.user_managed_identity_resource_id = user_managed_identity_resource_id - self.user_managed_identity_tenant_id = user_managed_identity_tenant_id - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = include_spark - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_ready: Optional[bool] = None, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = spark_ready - self.status = status - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - *, - isolation_mode: Optional[Union[str, "IsolationMode"]] = None, - outbound_rules: Optional[Dict[str, "OutboundRule"]] = None, - status: Optional["ManagedNetworkProvisionStatus"] = None, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = isolation_mode - self.network_id = None - self.outbound_rules = outbound_rules - self.status = status - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, **kwargs) - self.type = 'managedOnlineEndpoint' # type: str - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, **kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - *, - principal_id: Optional[str] = None, - **kwargs - ): - """ - :keyword principal_id: Identity principal Id. - :paramtype principal_id: str - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = principal_id - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - *, - assigned_identities: Optional[List["ManagedResourceGroupAssignedIdentities"]] = None, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = assigned_identities - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The Offer ID of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The Plan ID of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The Publisher ID of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - *, - properties: "MarketplaceSubscriptionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = properties - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = model_id - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["MarketplaceSubscription"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = instance_type - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - *, - notification: Optional["NotificationSetting"] = None, - resource: Optional["MaterializationComputeResource"] = None, - schedule: Optional["RecurrenceTrigger"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "MaterializationStoreType"]] = None, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = notification - self.resource = resource - self.schedule = schedule - self.spark_configuration = spark_configuration - self.store_type = store_type - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'mlflow_model' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'mlflow_model' # type: str - self.description = description - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'mltable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelDeprecationInfo(msrest.serialization.Model): - """Cognitive Services account ModelDeprecationInfo. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: str - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: str - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'str'}, - 'inference': {'key': 'inference', 'type': 'str'}, - } - - def __init__( - self, - *, - fine_tune: Optional[str] = None, - inference: Optional[str] = None, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: str - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: str - """ - super(ModelDeprecationInfo, self).__init__(**kwargs) - self.fine_tune = fine_tune - self.inference = inference - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service which - performance will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_threshold: "ModelPerformanceMetricThresholdBase", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - which performance will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(ModelPerformanceSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = data_segment - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. [Required]. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. [Required]. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = model_id - - -class ModelSku(msrest.serialization.Model): - """Describes an available Cognitive Services Model SKU. - - :ivar name: The name of the model SKU. - :vartype name: str - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar capacity: The capacity configuration. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :ivar rate_limits: The list of rateLimit. - :vartype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'capacity': {'key': 'capacity', 'type': 'CapacityConfig'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[CallRateLimit]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - usage_name: Optional[str] = None, - deprecation_date: Optional[datetime.datetime] = None, - capacity: Optional["CapacityConfig"] = None, - rate_limits: Optional[List["CallRateLimit"]] = None, - **kwargs - ): - """ - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword capacity: The capacity configuration. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :keyword rate_limits: The list of rateLimit. - :paramtype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - super(ModelSku, self).__init__(**kwargs) - self.name = name - self.usage_name = usage_name - self.deprecation_date = deprecation_date - self.capacity = capacity - self.rate_limits = rate_limits - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.intellectual_property = intellectual_property - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.provisioning_state = None - self.stage = stage - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - *, - compute_configuration: "MonitorComputeConfigurationBase", - signals: Dict[str, "MonitoringSignalBase"], - alert_notification_settings: Optional["MonitorNotificationSettings"] = None, - monitoring_target: Optional["MonitoringTarget"] = None, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = alert_notification_settings - self.compute_configuration = compute_configuration - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - *, - emails: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = emails - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - *, - feature: Optional[str] = None, - values: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = feature - self.values = values - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - *, - task_type: Union[str, "ModelTaskType"], - deployment_id: Optional[str] = None, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = deployment_id - self.model_id = model_id - self.task_type = task_type - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = value - - -class MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - *, - environment_variables: Optional[Dict[str, str]] = None, - secrets: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = environment_variables - self.secrets = secrets - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - *, - email_notification_settings: Optional["MonitorEmailNotificationSettings"] = None, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = email_notification_settings - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_identity: "MonitorComputeIdentityBase", - instance_type: str, - runtime_version: str, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = compute_identity - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - is_private_link_enabled: Optional[bool] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.is_private_link_enabled = is_private_link_enabled - self.notebook_preparation_error = notebook_preparation_error - self.resource_id = resource_id - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - self.webhooks = webhooks - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionOAuth2"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = credentials - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - artifact: "OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = artifact - self.endpoint = endpoint - self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(OpenAIEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, **kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - } - - def __init__( - self, - *, - patch_status: Optional[Union[str, "PatchStatus"]] = None, - latest_patch_time: Optional[str] = None, - reboot_pending: Optional[bool] = None, - scheduled_reboot_time: Optional[str] = None, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = patch_status - self.latest_patch_time = latest_patch_time - self.reboot_pending = reboot_pending - self.scheduled_reboot_time = scheduled_reboot_time - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OutboundRuleBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_name: Optional[str] = None, - resource_version: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Properties can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_id: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Property dictionary. Properties can be added, removed, and updated. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.properties = properties - self.tags = tags - self.target_environment_id = target_environment_id - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Tags can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'properties': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = None - self.tags = None - self.target_environment_id = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = description - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Optional["PartialBatchDeployment"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - *, - notification_setting: Optional["PartialNotificationSetting"] = None, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = notification_setting - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - *, - properties: Optional["PartialJobBase"] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = properties - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = tags - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) - self.sku = sku - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - self.sku = sku - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = webhooks - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["RegistryPartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - self.source_job_id = source_job_id - - -class PoolEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: dict[str, str] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - *, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - liveness_probe: Optional["ProbeSettings"] = None, - readiness_probe: Optional["ProbeSettings"] = None, - startup_probe: Optional["ProbeSettings"] = None, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: dict[str, str] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(PoolEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = environment_id - self.environment_variables = environment_variables - self.liveness_probe = liveness_probe - self.readiness_probe = readiness_probe - self.startup_probe = startup_probe - - -class PoolModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(PoolModelConfiguration, self).__init__(**kwargs) - self.model_id = model_id - - -class PoolStatus(msrest.serialization.Model): - """PoolStatus. - - :ivar actual_capacity: Gets or sets the actual number of instances in the pool. - :vartype actual_capacity: int - :ivar group_count: Gets or sets the actual number of groups in the pool. - :vartype group_count: int - :ivar requested_capacity: Gets or sets the requested number of instances for the pool. - :vartype requested_capacity: int - :ivar reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :vartype reserved_capacity: int - """ - - _attribute_map = { - 'actual_capacity': {'key': 'actualCapacity', 'type': 'int'}, - 'group_count': {'key': 'groupCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity: Optional[int] = 0, - group_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - reserved_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity: Gets or sets the actual number of instances in the pool. - :paramtype actual_capacity: int - :keyword group_count: Gets or sets the actual number of groups in the pool. - :paramtype group_count: int - :keyword requested_capacity: Gets or sets the requested number of instances for the pool. - :paramtype requested_capacity: int - :keyword reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :paramtype reserved_capacity: int - """ - super(PoolStatus, self).__init__(**kwargs) - self.actual_capacity = actual_capacity - self.group_count = group_count - self.requested_capacity = requested_capacity - self.reserved_capacity = reserved_capacity - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - private_endpoint: Optional["WorkspacePrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[Union[str, "PrivateEndpointConnectionProvisioningState"]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - subresource_target: Optional[str] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.spark_enabled = spark_enabled - self.spark_status = spark_status - self.subresource_target = subresource_target - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = subnet_arm_id - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - group_id: Optional[str] = None, - required_members: Optional[List[str]] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.group_id = group_id - self.required_members = required_members - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - priority: Optional[int] = None, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - self.priority = priority - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = logbase - self.rule = rule - self.seed = seed - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - *, - address: Optional[str] = None, - dashboard_port: Optional[int] = None, - head_node_additional_args: Optional[str] = None, - include_dashboard: Optional[bool] = None, - port: Optional[int] = None, - worker_node_additional_args: Optional[str] = None, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = address - self.dashboard_port = dashboard_port - self.head_node_additional_args = head_node_additional_args - self.include_dashboard = include_dashboard - self.port = port - self.worker_node_additional_args = worker_node_additional_args - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "ComputeRecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["ComputeRecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "WeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.schedule = schedule - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - *, - key_name: Optional[Union[str, "ServiceAccountKeyName"]] = None, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = key_name - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - managed_resource_group_settings: Optional["ManagedResourceGroupSettings"] = None, - ml_flow_registry_uri: Optional[str] = None, - registry_private_endpoint_connections: Optional[List["RegistryPrivateEndpointConnection"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.sku = sku - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.managed_resource_group_settings = managed_resource_group_settings - self.ml_flow_registry_uri = ml_flow_registry_uri - self.registry_private_endpoint_connections = registry_private_endpoint_connections - self.public_network_access = public_network_access - self.region_details = region_details - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = passwords - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - group_ids: Optional[List[str]] = None, - private_endpoint: Optional["PrivateEndpointResource"] = None, - registry_private_link_service_connection_state: Optional["RegistryPrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = id - self.location = location - self.group_ids = group_ids - self.private_endpoint = private_endpoint - self.registry_private_link_service_connection_state = registry_private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - *, - acr_details: Optional[List["AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = acr_details - self.location = location - self.storage_account_details = storage_account_details - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Registry"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - training_settings: Optional["RegressionTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "RegressionModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Regression' # type: str - self.metric = metric - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.request_timeout = request_timeout - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = capture_headers - - -class RequestMatchPattern(msrest.serialization.Model): - """RequestMatchPattern. - - :ivar path: - :vartype path: str - :ivar method: - :vartype method: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - method: Optional[str] = None, - **kwargs - ): - """ - :keyword path: - :paramtype path: str - :keyword method: - :paramtype method: str - """ - super(RequestMatchPattern, self).__init__(**kwargs) - self.path = path - self.method = method - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - *, - target_vm_size: Optional[str] = None, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = target_vm_size - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the trailing data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_offset: datetime.timedelta, - window_size: datetime.timedelta, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_offset = window_offset - self.window_size = window_size - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = properties - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "ScheduleStatus"]] = None, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = id - self.provisioning_status = provisioning_status - self.status = status - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - *, - action: "ScheduleActionBase", - trigger: "TriggerBase", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = True, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.action = action - self.display_name = display_name - self.is_enabled = is_enabled - self.provisioning_state = None - self.trigger = trigger - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Schedule"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - workspace_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = uri - self.workspace_secret_name = workspace_secret_name - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - *, - serverless_compute_custom_subnet: Optional[str] = None, - serverless_compute_no_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = serverless_compute_custom_subnet - self.serverless_compute_no_public_ip = serverless_compute_no_public_ip - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "ServerlessEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - capacity_reservation_group_id: str, - endpoint_reserved_capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = capacity_reservation_group_id - self.endpoint_reserved_capacity = endpoint_reserved_capacity - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible values - include: "Key", "AAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription ARM ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar offer: The publisher-defined Serverless Offer to provision the endpoint with. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - """ - - _validation = { - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Optional[Union[str, "ServerlessInferenceEndpointAuthMode"]] = None, - capacity_reservation: Optional["ServerlessEndpointCapacityReservation"] = None, - model_settings: Optional["ModelSettings"] = None, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible - values include: "Key", "AAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :keyword offer: The publisher-defined Serverless Offer to provision the endpoint with. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.capacity_reservation = capacity_reservation - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = model_settings - self.offer = offer - self.provisioning_state = None - self.endpoint_state = None - - -class ServerlessEndpointStatus(msrest.serialization.Model): - """ServerlessEndpointStatus. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metrics: The model-specific metrics from the backing inference endpoint. - :vartype metrics: dict[str, str] - """ - - _validation = { - 'metrics': {'readonly': True}, - } - - _attribute_map = { - 'metrics': {'key': 'metrics', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ServerlessEndpointStatus, self).__init__(**kwargs) - self.metrics = None - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ServerlessEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. [Required] The name of the Serverless Offer. - :vartype offer_name: str - :ivar publisher: Required. [Required] Publisher name of the Serverless Offer. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - offer_name: str, - publisher: str, - **kwargs - ): - """ - :keyword offer_name: Required. [Required] The name of the Serverless Offer. - :paramtype offer_name: str - :keyword publisher: Required. [Required] Publisher name of the Serverless Offer. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = offer_name - self.publisher = publisher - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - *, - action: Optional[Union[str, "RuleAction"]] = None, - port_ranges: Optional[str] = None, - protocol: Optional[str] = None, - service_tag: Optional[str] = None, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = action - self.address_prefixes = None - self.port_ranges = port_ranges - self.protocol = protocol - self.service_tag = service_tag - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'ServiceTag' # type: str - self.destination = destination - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - group_id: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.group_id = group_id - self.private_link_resource_id = private_link_resource_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - *, - code_id: str, - entry: "SparkJobEntry", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - archives: Optional[List[str]] = None, - args: Optional[str] = None, - conf: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - files: Optional[List[str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jars: Optional[List[str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - py_files: Optional[List[str]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["SparkResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Spark' # type: str - self.archives = archives - self.args = args - self.code_id = code_id - self.conf = conf - self.entry = entry - self.environment_id = environment_id - self.environment_variables = environment_variables - self.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - self.queue_settings = queue_settings - self.resources = resources - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - *, - file: str, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = file - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - *, - class_name: str, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = class_name - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = "3.1", - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.Speech' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - """ - super(SpeechEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, **kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_end: datetime.datetime, - window_start: datetime.datetime, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_end = window_end - self.window_start = window_start - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = system_created_storage_account - self.user_created_storage_account = user_created_storage_account - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar component_configuration: Component Configuration for sweep over component. - :vartype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'component_configuration': {'key': 'componentConfiguration', 'type': 'ComponentConfiguration'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - component_configuration: Optional["ComponentConfiguration"] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword component_configuration: Component Configuration for sweep over component. - :paramtype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.component_configuration = component_configuration - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = acr_account_name - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = allow_blob_public_access - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_name = storage_account_name - self.storage_account_type = storage_account_type - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ThrottlingRule(msrest.serialization.Model): - """ThrottlingRule. - - :ivar key: - :vartype key: str - :ivar renewal_period: - :vartype renewal_period: float - :ivar count: - :vartype count: float - :ivar min_count: - :vartype min_count: float - :ivar dynamic_throttling_enabled: - :vartype dynamic_throttling_enabled: bool - :ivar match_patterns: - :vartype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'float'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[RequestMatchPattern]'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - renewal_period: Optional[float] = None, - count: Optional[float] = None, - min_count: Optional[float] = None, - dynamic_throttling_enabled: Optional[bool] = None, - match_patterns: Optional[List["RequestMatchPattern"]] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - :keyword renewal_period: - :paramtype renewal_period: float - :keyword count: - :paramtype count: float - :keyword min_count: - :paramtype min_count: float - :keyword dynamic_throttling_enabled: - :paramtype dynamic_throttling_enabled: bool - :keyword match_patterns: - :paramtype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - super(ThrottlingRule, self).__init__(**kwargs) - self.key = key - self.renewal_period = renewal_period - self.count = count - self.min_count = min_count - self.dynamic_throttling_enabled = dynamic_throttling_enabled - self.match_patterns = match_patterns - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = size - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = top - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TriggerOnceRequest(msrest.serialization.Model): - """TriggerOnceRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar schedule_time: Required. [Required] Specify the schedule time for trigger once. - :vartype schedule_time: str - """ - - _validation = { - 'schedule_time': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'schedule_time': {'key': 'scheduleTime', 'type': 'str'}, - } - - def __init__( - self, - *, - schedule_time: str, - **kwargs - ): - """ - :keyword schedule_time: Required. [Required] Specify the schedule time for trigger once. - :paramtype schedule_time: str - """ - super(TriggerOnceRequest, self).__init__(**kwargs) - self.schedule_time = schedule_time - - -class TriggerRunSubmissionDto(msrest.serialization.Model): - """TriggerRunSubmissionDto. - - :ivar schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :vartype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar submission_id: - :vartype submission_id: str - """ - - _attribute_map = { - 'schedule_action_type': {'key': 'scheduleActionType', 'type': 'str'}, - 'submission_id': {'key': 'submissionId', 'type': 'str'}, - } - - def __init__( - self, - *, - schedule_action_type: Optional[Union[str, "ScheduleType"]] = None, - submission_id: Optional[str] = None, - **kwargs - ): - """ - :keyword schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :paramtype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :keyword submission_id: - :paramtype submission_id: str - """ - super(TriggerRunSubmissionDto, self).__init__(**kwargs) - self.schedule_action_type = schedule_action_type - self.submission_id = submission_id - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = inference_configuration - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'triton_model' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'triton_model' # type: str - self.description = description - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'uri_file' # type: str - self.description = description - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'uri_file' # type: str - self.description = description - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'uri_folder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'uri_folder' # type: str - self.description = description - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = properties - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.notebook_server_port = notebook_server_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = administrator_account - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) - self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "VolumeDefinitionType"]] = "bind", - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["BindOptions"] = None, - volume: Optional["VolumeOptions"] = None, - tmpfs: Optional["TmpfsOptions"] = None, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = type - self.read_only = read_only - self.source = source - self.target = target - self.consistency = consistency - self.bind = bind - self.volume = volume - self.tmpfs = tmpfs - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = nocopy - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_public_access_when_behind_vnet: Optional[bool] = None, - application_insights: Optional[str] = None, - associated_workspaces: Optional[List[str]] = None, - container_registries: Optional[List[str]] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - discovery_url: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionProperty"] = None, - existing_workspaces: Optional[List[str]] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - hbi_workspace: Optional[bool] = None, - hub_resource_id: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - key_vault: Optional[str] = None, - key_vaults: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - soft_delete_retention_in_days: Optional[int] = None, - storage_account: Optional[str] = None, - storage_accounts: Optional[List[str]] = None, - system_datastores_auth_mode: Optional[str] = None, - v1_legacy_mode: Optional[bool] = None, - workspace_hub_config: Optional["WorkspaceHubConfig"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.sku = sku - self.tags = tags - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.application_insights = application_insights - self.associated_workspaces = associated_workspaces - self.container_registries = container_registries - self.container_registry = container_registry - self.description = description - self.discovery_url = discovery_url - self.enable_data_isolation = enable_data_isolation - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.existing_workspaces = existing_workspaces - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.hbi_workspace = hbi_workspace - self.hub_resource_id = hub_resource_id - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.key_vault = key_vault - self.key_vaults = key_vaults - self.managed_network = managed_network - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = primary_user_assigned_identity - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.service_provisioned_resource_group = None - self.shared_private_link_resources = shared_private_link_resources - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.storage_account = storage_account - self.storage_accounts = storage_accounts - self.storage_hns_enabled = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.tenant_id = None - self.v1_legacy_mode = v1_legacy_mode - self.workspace_hub_config = workspace_hub_config - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = access_key_id - self.secret_access_key = secret_access_key - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = client_id - self.resource_id = resource_id - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_url: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - developer_token: Optional[str] = None, - password: Optional[str] = None, - refresh_token: Optional[str] = None, - tenant_id: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = auth_url - self.client_id = client_id - self.client_secret = client_secret - self.developer_token = developer_token - self.password = password - self.refresh_token = refresh_token - self.tenant_id = tenant_id - self.username = username - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: Optional["WorkspaceConnectionPropertiesV2"] = None, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - security_token: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = password - self.security_token = security_token - self.username = username - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_workspace_storage_accounts: Optional[List[str]] = None, - default_workspace_resource_group: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = additional_workspace_storage_accounts - self.default_workspace_resource_group = default_workspace_resource_group - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Workspace"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - v1_legacy_mode: Optional[bool] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterial should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - self.application_insights = application_insights - self.container_registry = container_registry - self.description = description - self.enable_data_isolation = enable_data_isolation - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.managed_network = managed_network - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.v1_legacy_mode = v1_legacy_mode diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/__init__.py deleted file mode 100644 index ed0728892746..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/__init__.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._compute_operations import ComputeOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._features_operations import FeaturesOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._operations import Operations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._quotas_operations import QuotasOperations -from ._registries_operations import RegistriesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._workspaces_operations import WorkspacesOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'CapacityReservationGroupsOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'MarketplaceSubscriptionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index beb88d57dd8e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,876 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index f80d0e44859a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_capacity_reservation_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_capacity_reservation_groups_operations.py deleted file mode 100644 index 3f227b4ce763..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_capacity_reservation_groups_operations.py +++ /dev/null @@ -1,714 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups") # 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) - - # Construct parameters - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups") # 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) - - # Construct parameters - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CapacityReservationGroupsOperations(object): - """CapacityReservationGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - """List CapacityReservationGroups by subscription. - - List CapacityReservationGroups by subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - """Lists CapacityReservationGroups. - - Lists CapacityReservationGroups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete CapacityReservationGroup. - - Delete CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """Get CapacityReservationGroup. - - Get CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - group_id, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """Update CapacityReservationGroup. - - Update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to update. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - group_id, # type: str - body, # type: "_models.CapacityReservationGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """Create or update CapacityReservationGroup. - - Create or update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to create. - :type body: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapacityReservationGroup') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index 5b87ba27a849..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index e6ae340cc4ef..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,878 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - hash = kwargs.pop('hash', None) # type: Optional[str] - hash_version = kwargs.pop('hash_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if hash is not None: - _query_parameters['hash'] = _SERIALIZER.query("hash", hash, 'str') - if hash_version is not None: - _query_parameters['hashVersion'] = _SERIALIZER.query("hash_version", hash_version, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - hash=None, # type: Optional[str] - hash_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index ed69d142e200..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index dbac04004b2a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,756 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_compute_operations.py deleted file mode 100644 index c4da6c730471..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,2101 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_custom_services_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_data_mounts_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_idle_shutdown_setting_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_allowed_resize_sizes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resize_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): # pylint: disable=too-many-public-methods - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - custom_services, # type: List["_models.CustomService"] - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace - def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - data_mounts, # type: List["_models.ComputeInstanceDataMount"] - **kwargs # type: Any - ): - # type: (...) -> None - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace - def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace - def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace - def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.IdleShutdownSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get_allowed_resize_sizes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace - def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 478116370a45..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index f6ddca244ba7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,768 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param stage: data stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_datastores_operations.py deleted file mode 100644 index f542fa4eb39d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - _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') - if order_by is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Datastore" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_deployment_operations.py deleted file mode 100644 index 359b2b793d6b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,801 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_in_workspace_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointDeploymentOperations(object): - """EndpointDeploymentOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_operations.py deleted file mode 100644 index 0bbf9893f731..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_endpoint_operations.py +++ /dev/null @@ -1,834 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_regenerate_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointOperations(object): - """EndpointOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointResourcePropertiesBasicResource" - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointResourcePropertiesBasicResource"] - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointResourcePropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointKeys" - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace - def regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateServiceAccountKeyContent" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountApiKeys" - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index 7dbb8d9e25ac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 5b700ab6a1a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,757 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_features_operations.py deleted file mode 100644 index d2e015da3fc7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,359 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - feature_name = kwargs.pop('feature_name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 1000) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if feature_name is not None: - _query_parameters['featureName'] = _SERIALIZER.query("feature_name", feature_name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - "featureName": _SERIALIZER.url("feature_name", feature_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - feature_name=None, # type: Optional[str] - description=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=1000, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureResourceArmPaginatedResult"] - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :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 - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Feature" - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index 6a02bab891cb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetContainersOperations(object): - """FeaturesetContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 8aa7508b5591..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,924 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_backfill_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetVersionsOperations(object): - """FeaturesetVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - def _backfill_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.FeaturesetVersionBackfillResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace - def begin_backfill( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersionBackfillResponse"] - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersionBackfillResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 7b5ad125457a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityContainersOperations(object): - """FeaturestoreEntityContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 3d93d694cfc9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityVersionsOperations(object): - """FeaturestoreEntityVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_endpoints_operations.py deleted file mode 100644 index e23116802ff9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,894 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceEndpointsOperations(object): - """InferenceEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_groups_operations.py deleted file mode 100644 index c495de10c3da..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_groups_operations.py +++ /dev/null @@ -1,1159 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceGroupsOperations(object): - """InferenceGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceGroup"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.GroupStatus" - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_pools_operations.py deleted file mode 100644 index 01e460297762..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_inference_pools_operations.py +++ /dev/null @@ -1,1108 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferencePoolsOperations(object): - """InferencePoolsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferencePoolTrackedResourceArmPaginatedResult"] - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferencePool"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PoolStatus" - """Retrieve inference pool status. - - Retrieve inference pool status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PoolStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PoolStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PoolStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PoolStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Pool Skus. - - List Inference Pool Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Inference Group name. - :type inference_pool_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 8f178960a4fa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,911 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - properties = kwargs.pop('properties', None) # type: Optional[str] - asset_name = kwargs.pop('asset_name', None) # type: Optional[str] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - _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') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if asset_name is not None: - _query_parameters['assetName'] = _SERIALIZER.query("asset_name", asset_name, 'str') - if scheduled is not None: - _query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') - if schedule_id is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_cancel_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - properties=None, # type: Optional[str] - asset_name=None, # type: Optional[str] - scheduled=None, # type: Optional[bool] - schedule_id=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.PartialJobBasePartialResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index 5b724fa1430b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1045 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_export_labels_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_pause_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resume_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def pause( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJobProperties" - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJobProperties, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.LabelingJobProperties"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LabelingJobProperties"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace - def begin_resume( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJobProperties"] - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJobProperties or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJobProperties] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 6bb565e40103..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_provision_managed_network_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkProvisionsOperations(object): - """ManagedNetworkProvisionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _provision_managed_network_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 56cb66df9689..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,629 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkSettingsRuleOperations(object): - """ManagedNetworkSettingsRuleOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundRuleListResult"] - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OutboundRuleBasicResource" - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OutboundRuleBasicResource"] - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OutboundRuleBasicResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index dfbdcf30b2d5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class MarketplaceSubscriptionsOperations(object): - """MarketplaceSubscriptionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MarketplaceSubscription"] - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either MarketplaceSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 0fd5ea63ca3f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index 09db84bda340..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,998 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :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 - :param stage: Model stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - def _package_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 4da691319dfe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index 32c7fac8eed0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_operations.py deleted file mode 100644 index 14e9d807bb0c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index f62a169e0c3f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,501 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - body, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.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/v2024_01_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index 76076927c0b6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,190 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateLinkResourceListResult"] - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - 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/v2024_01_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_quotas_operations.py deleted file mode 100644 index 803a5085607a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registries_operations.py deleted file mode 100644 index 6f2aadc0bb95..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_remove_regions_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") # 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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistriesOperations(object): - """RegistriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _remove_regions_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 3e4079776293..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,636 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeContainersOperations(object): - """RegistryCodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeContainer"] - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index eab9d683e289..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,802 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeVersionsOperations(object): - """RegistryCodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index 2dc22e36093a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentContainersOperations(object): - """RegistryComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 546760e126ca..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentVersionsOperations(object): - """RegistryComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index 1be24eae29a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataContainersOperations(object): - """RegistryDataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_references_operations.py deleted file mode 100644 index fc7a41ea4354..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,180 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_blob_reference_sas_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataReferencesOperations(object): - """RegistryDataReferencesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_blob_reference_sas( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.GetBlobReferenceSASRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.GetBlobReferenceSASResponseDto" - """Get blob reference SAS Uri value. - - Get blob reference SAS Uri value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index d8aab3c1c113..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataVersionsOperations(object): - """RegistryDataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataVersionBase"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 43ee8e4b9eb6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentContainersOperations(object): - """RegistryEnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index bf7a7185a687..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,699 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentVersionsOperations(object): - """RegistryEnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 631e53e11aa1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelContainersOperations(object): - """RegistryModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainer"] - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index 73d3f7058fed..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,1036 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelVersionsOperations(object): - """RegistryModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - def _package_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_schedules_operations.py deleted file mode 100644 index f996d8189119..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,764 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ScheduleListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_trigger_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SchedulesOperations(object): - """SchedulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ScheduleListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ScheduleResourceArmPaginatedResult"] - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Schedule"] - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Schedule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def trigger( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.TriggerOnceRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.TriggerRunSubmissionDto" - """Trigger run. - - Trigger run. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Request body for trigger once. - :type body: ~azure.mgmt.machinelearningservices.models.TriggerOnceRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TriggerRunSubmissionDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.TriggerRunSubmissionDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerRunSubmissionDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'TriggerOnceRequest') - - request = build_trigger_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.trigger.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('TriggerRunSubmissionDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - trigger.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 0f309e3e5a1e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,1223 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9-]{0,51}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ServerlessEndpointsOperations(object): - """ServerlessEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ServerlessEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpointStatus" - """Status of the model backing the Serverless Endpoint. - - Status of the model backing the Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpointStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpointStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus"} # type: ignore - - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointAuthKeys"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointAuthKeys"] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_usages_operations.py deleted file mode 100644 index 9f2b50633ebd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 12adf5cce099..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_01_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 8ed5ca5d4f90..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,943 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - include_all = kwargs.pop('include_all', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - _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') - if include_all is not None: - _query_parameters['includeAll'] = _SERIALIZER.query("include_all", include_all, 'bool') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - aoai_models_to_deploy = kwargs.pop('aoai_models_to_deploy', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if aoai_models_to_deploy is not None: - _query_parameters['aoaiModelsToDeploy'] = _SERIALIZER.query("aoai_models_to_deploy", aoai_models_to_deploy, '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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - aoai_models_to_deploy = kwargs.pop('aoai_models_to_deploy', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if aoai_models_to_deploy is not None: - _query_parameters['aoaiModelsToDeploy'] = _SERIALIZER.query("aoai_models_to_deploy", aoai_models_to_deploy, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_test_connection_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - include_all=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - aoai_models_to_deploy=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionUpdateParameter"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - aoai_models_to_deploy=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace - def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 212460693a78..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 9d7457d0cc5c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1923 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - force_to_purge = kwargs.pop('force_to_purge', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if force_to_purge is not None: - _query_parameters['forceToPurge'] = _SERIALIZER.query("force_to_purge", force_to_purge, 'bool') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace - def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_01_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 19d2b5a222f1..d633d99ec0fe 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -295,12 +295,10 @@ def mock_aml_services_2023_10_01(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2024_01_01_preview(mocker: MockFixture) -> Mock: - # Ensure the submodule is imported so it is an attribute of ``azure.ai.ml._restclient`` for mocker.patch. - # Production code no longer imports v2024_01_01_preview (operations were migrated to arm_ml_service), so the - # attribute would otherwise be absent when a test that never imports it directly requests this fixture. - import azure.ai.ml._restclient.v2024_01_01_preview # noqa: F401 pylint: disable=unused-import - - return mocker.patch("azure.ai.ml._restclient.v2024_01_01_preview") + # Production code no longer imports v2024_01_01_preview (operations were migrated to arm_ml_service). This + # fixture is only used as a passed-in service_client mock, so return a plain mock rather than patching the + # (now removed) module. + return mocker.MagicMock() @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/finetuning_job/e2e_tests/test_azure_openai_finetuning_job.py b/sdk/ml/azure-ai-ml/tests/finetuning_job/e2e_tests/test_azure_openai_finetuning_job.py index de9c6124b5b3..0f08566e1613 100644 --- a/sdk/ml/azure-ai-ml/tests/finetuning_job/e2e_tests/test_azure_openai_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/tests/finetuning_job/e2e_tests/test_azure_openai_finetuning_job.py @@ -13,7 +13,7 @@ from typing import Optional, Dict from azure.ai.ml.entities._job.finetuning.azure_openai_finetuning_job import AzureOpenAIFineTuningJob from azure.ai.ml.entities._job.finetuning.azure_openai_hyperparameters import AzureOpenAIHyperparameters -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( FineTuningTaskType, ) import uuid From ad7c2bf700df4b8ba0d220e485e5a4869098429e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 13:06:04 +0530 Subject: [PATCH 052/146] Apply isort/black import formatting to datastore and job operations --- .../azure/ai/ml/operations/_datastore_operations.py | 9 ++------- .../azure/ai/ml/operations/_job_operations.py | 11 ++++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py index 55b207efe0be..a7f0838e5ef5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py @@ -12,14 +12,9 @@ from marshmallow.exceptions import ValidationError as SchemaValidationError from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.arm_ml_service import ( - MachineLearningServicesMgmtClient as ServiceClient102024Preview, -) +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient102024Preview from azure.ai.ml._restclient.arm_ml_service.models import Datastore as DatastoreData -from azure.ai.ml._restclient.arm_ml_service.models import ( - DatastoreSecrets, - NoneDatastoreCredentials, -) +from azure.ai.ml._restclient.arm_ml_service.models import DatastoreSecrets, NoneDatastoreCredentials from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._experimental import experimental diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index a4b02248ca6b..24e5589e7358 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -23,15 +23,16 @@ _resource_to_scopes, ) from azure.ai.ml._exception_helper import log_and_raise_error +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022023Preview +from azure.ai.ml._restclient.arm_ml_service.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType +from azure.ai.ml._restclient.arm_ml_service.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity +from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as UserIdentityArm from azure.ai.ml._restclient.dataset_dataplane import DatasetDataplaneClient as ServiceClientDatasetDataplane from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataplane from azure.ai.ml._restclient.runhistory import RunHistoryClient as ServiceClientRunHistory from azure.ai.ml._restclient.runhistory.models import Run -from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022023Preview -from azure.ai.ml._restclient.arm_ml_service.models import JobBase, ListViewType, UserIdentity -from azure.ai.ml._restclient.arm_ml_service.models import UserIdentity as UserIdentityArm -from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType - from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, From 99f2146ad18aefb08a5864aac6207ca817bf62b2 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 16:32:08 +0530 Subject: [PATCH 053/146] Migrate connection schema enums (ConnectionCategory/ConnectionAuthType) to arm_ml_service --- .../ai/ml/_schema/workspace/connections/connection_subtypes.py | 2 +- .../azure/ai/ml/_schema/workspace/connections/credentials.py | 2 +- .../ai/ml/_schema/workspace/connections/workspace_connection.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/connection_subtypes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/connection_subtypes.py index d04b3e768558..ab65b9b4f34f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/connection_subtypes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/connection_subtypes.py @@ -8,7 +8,7 @@ from marshmallow.exceptions import ValidationError from marshmallow.decorators import pre_load -from azure.ai.ml._restclient.v2024_04_01_preview.models import ConnectionCategory +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionCategory from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.constants._common import ConnectionTypes diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/credentials.py index 52213c084f30..e3eb6c1a02ca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/credentials.py @@ -12,7 +12,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2024_04_01_preview.models import ConnectionAuthType +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionAuthType from azure.ai.ml._schema.core.fields import StringTransformedEnum from azure.ai.ml._schema.core.schema import PatchedSchemaMeta from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/workspace_connection.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/workspace_connection.py index 20863a5ac087..1794385e8b30 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/workspace_connection.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/connections/workspace_connection.py @@ -6,7 +6,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2024_04_01_preview.models import ConnectionCategory +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionCategory from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.core.resource import ResourceSchema from azure.ai.ml._schema.job import CreationContextSchema From beb2901b454746522792d855d267a2ea13c1b6c9 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 17:41:00 +0530 Subject: [PATCH 054/146] Migrate data-import entity + schedule off v2023_08 to JSON-direct wire (arm-absent models) --- .../ml/entities/_data_import/data_import.py | 78 +++++++++++-------- .../ai/ml/entities/_data_import/schedule.py | 21 +++-- 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py index 4e9d33502fa2..95a9ff4c8da7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py @@ -6,9 +6,6 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_08_01_preview.models import DatabaseSource as RestDatabaseSource -from azure.ai.ml._restclient.v2023_08_01_preview.models import DataImport as RestDataImport -from azure.ai.ml._restclient.v2023_08_01_preview.models import FileSystemSource as RestFileSystemSource from azure.ai.ml._schema import DataImportSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, AssetTypes @@ -79,52 +76,67 @@ def _load( res: DataImport = load_from_dict(DataImportSchema, data, context, **kwargs) return res - def _to_rest_object(self) -> RestDataImport: + def _to_rest_object(self) -> Dict[str, Any]: + # ``DataImport`` / ``DatabaseSource`` / ``FileSystemSource`` are not modeled on the shared + # arm_ml_service client, so emit the wire body as a plain dict (JSON-direct). This is byte-identical + # to the legacy ``RestDataImport(...).serialize()`` output, including the server-pinned + # ``dataType='uri_folder'`` constant and the ``isAnonymous``/``isArchived`` defaults. + source: Dict[str, Any] if isinstance(self.source, Database): - source = RestDatabaseSource( - connection=self.source.connection, - query=self.source.query, - ) + source = {"sourceType": "database"} + if self.source.connection is not None: + source["connection"] = self.source.connection + if self.source.query is not None: + source["query"] = self.source.query else: - source = RestFileSystemSource( - connection=self.source.connection, - path=self.source.path, - ) + source = {"sourceType": "file_system"} + if self.source.connection is not None: + source["connection"] = self.source.connection + if self.source.path is not None: + source["path"] = self.source.path - return RestDataImport( - description=self.description, - properties=self.properties, - tags=self.tags, - data_type=self.type, - data_uri=self.path, - asset_name=self.name, - source=source, - ) + rest_object: Dict[str, Any] = { + "isAnonymous": False, + "isArchived": False, + "dataType": "uri_folder", + "dataUri": self.path, + "source": source, + } + if self.description is not None: + rest_object["description"] = self.description + if self.properties is not None: + rest_object["properties"] = self.properties + if self.tags is not None: + rest_object["tags"] = self.tags + if self.name is not None: + rest_object["assetName"] = self.name + return rest_object @classmethod - def _from_rest_object(cls, data_rest_object: RestDataImport) -> "DataImport": + def _from_rest_object(cls, data_rest_object: Dict[str, Any]) -> "DataImport": source: Any = None - if isinstance(data_rest_object.source, RestDatabaseSource): + source_dict = data_rest_object["source"] + if source_dict.get("sourceType") == "database": source = Database( - connection=data_rest_object.source.connection, - query=data_rest_object.source.query, + connection=source_dict.get("connection"), + query=source_dict.get("query"), ) data_type = AssetTypes.MLTABLE else: source = FileSystem( - connection=data_rest_object.source.connection, - path=data_rest_object.source.path, + connection=source_dict.get("connection"), + path=source_dict.get("path"), ) data_type = AssetTypes.URI_FOLDER data_import = cls( - name=data_rest_object.asset_name, - path=data_rest_object.data_uri, + name=data_rest_object.get("assetName"), + path=data_rest_object.get("dataUri"), source=source, - description=data_rest_object.description, - tags=data_rest_object.tags, - properties=data_rest_object.properties, + description=data_rest_object.get("description"), + tags=data_rest_object.get("tags"), + properties=data_rest_object.get("properties"), type=data_type, - is_anonymous=data_rest_object.is_anonymous, + is_anonymous=data_rest_object.get("isAnonymous"), ) return data_import diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py index 30a1dbb7ead2..b881f02aff15 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py @@ -8,7 +8,6 @@ from azure.ai.ml._restclient.arm_ml_service.models import Schedule as RestSchedule from azure.ai.ml._restclient.arm_ml_service.models import ScheduleProperties -from azure.ai.ml._restclient.v2023_08_01_preview.models import DataImport as RestDataImport from azure.ai.ml._schema._data_import.schedule import ImportDataScheduleSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, ScheduleType @@ -88,18 +87,16 @@ def _create_schema_for_validation(cls, context: Any) -> ImportDataScheduleSchema @classmethod def _from_rest_object(cls, obj: RestSchedule) -> "ImportDataSchedule": - # ``ImportDataAction`` is not in arm_ml_service, so the action is carried as a plain wire dict - # (camelCase keys); read it via mapping access and rehydrate the v2023_08 msrest ``DataImport`` - # model so ``DataImport._from_rest_object`` keeps its typed attribute access. The trigger is a - # present arm model. + # ``ImportDataAction`` / ``DataImport`` are not in arm_ml_service, so the action is carried as a plain + # wire dict (camelCase keys); ``DataImport._from_rest_object`` reads that dict directly. The trigger is + # a present arm model. action = obj.properties.action data_import_definition = action["dataImportDefinition"] if action is not None else None - rest_data_import = ( - RestDataImport.deserialize(data_import_definition) if data_import_definition is not None else None - ) return cls( trigger=TriggerBase._from_rest_object(obj.properties.trigger), - import_data=DataImport._from_rest_object(rest_data_import), + import_data=( + DataImport._from_rest_object(data_import_definition) if data_import_definition is not None else None + ), name=obj.name, display_name=obj.properties.display_name, description=obj.properties.description, @@ -112,8 +109,8 @@ def _from_rest_object(cls, obj: RestSchedule) -> "ImportDataSchedule": def _to_rest_object(self) -> RestSchedule: # ``ImportDataAction`` / ``DataImport`` are not in arm_ml_service; build the shared arm Schedule - # envelope and emit the import-data action as a plain wire dict (JSON-direct). ``data_import`` - # serializes to a v2023_08 msrest model whose ``.serialize()`` yields the camelCase wire body. + # envelope and emit the import-data action as a plain wire dict (JSON-direct). + # ``data_import._to_rest_object()`` returns the camelCase wire dict directly. rest_schedule = RestSchedule( properties=ScheduleProperties( description=self.description, @@ -126,6 +123,6 @@ def _to_rest_object(self) -> RestSchedule: ) rest_schedule.properties["action"] = { "actionType": "ImportData", - "dataImportDefinition": self.import_data._to_rest_object().serialize(), + "dataImportDefinition": self.import_data._to_rest_object(), } return rest_schedule From 7c7640f58815b5f149bafef8472fc809b11d852f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 18:41:14 +0530 Subject: [PATCH 055/146] Migrate registry ManagedServiceIdentity + WorkspaceConnectionAccessKey off v2023_04 to arm_ml_service --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 2024dc36e6b8..0d4a3e35d5fd 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 @@ -52,7 +52,7 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedIdentity as RestJobManagedIdentity, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedServiceIdentity as RestRegistryManagedIdentity, ) from azure.ai.ml._restclient.arm_ml_service.models import ( @@ -73,7 +73,7 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( UserIdentity as RestUserIdentity, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionAccessKey as RestWorkspaceConnectionAccessKey, ) from azure.ai.ml._restclient.arm_ml_service.models import ( From bc2a5a45d7ee435deda63f235aaeb32fde3ff0fd Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 18:44:41 +0530 Subject: [PATCH 056/146] Make datastore credential deserialization arm-only (drop dead v2023_04 branch) --- .../azure/ai/ml/entities/_datastore/utils.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py index 1bf02a443a63..dead042bc543 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py @@ -6,7 +6,6 @@ from typing import Any, Optional, Union, cast -from azure.ai.ml._restclient.v2023_04_01_preview import models from azure.ai.ml._restclient.arm_ml_service import models as models2024 from azure.ai.ml.entities._credentials import ( AccountKeyConfiguration, @@ -19,7 +18,7 @@ def from_rest_datastore_credentials( - rest_credentials: models.DatastoreCredentials, + rest_credentials: "models2024.DatastoreCredentials", ) -> Union[ AccountKeyConfiguration, SasTokenConfiguration, @@ -29,22 +28,18 @@ def from_rest_datastore_credentials( ]: config_class: Any = NoneCredentialConfiguration - if isinstance(rest_credentials, (models.AccountKeyDatastoreCredentials, models2024.AccountKeyDatastoreCredentials)): + if isinstance(rest_credentials, models2024.AccountKeyDatastoreCredentials): # we are no more using key for key base account. # https://github.com/Azure/azure-sdk-for-python/pull/35716 if isinstance(rest_credentials.secrets, models2024.SasDatastoreSecrets): config_class = SasTokenConfiguration else: config_class = AccountKeyConfiguration - elif isinstance(rest_credentials, (models.SasDatastoreCredentials, models2024.SasDatastoreCredentials)): + elif isinstance(rest_credentials, models2024.SasDatastoreCredentials): config_class = SasTokenConfiguration - elif isinstance( - rest_credentials, (models.ServicePrincipalDatastoreCredentials, models2024.ServicePrincipalDatastoreCredentials) - ): + elif isinstance(rest_credentials, models2024.ServicePrincipalDatastoreCredentials): config_class = ServicePrincipalConfiguration - elif isinstance( - rest_credentials, (models.CertificateDatastoreCredentials, models2024.CertificateDatastoreCredentials) - ): + elif isinstance(rest_credentials, models2024.CertificateDatastoreCredentials): config_class = CertificateConfiguration return cast( From 70cf124bc6cf2b4791059b8fe4301e9303f79750 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 18:58:45 +0530 Subject: [PATCH 057/146] Migrate Azure OpenAI deployment list off v2024_04 to arm send_request (JSON-direct) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../_autogen_entities/models/_patch.py | 26 ++++++----- .../_azure_openai_deployment_operations.py | 44 ++++++++++++++----- 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 9a329eb612df..c987fdc2c353 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -782,7 +782,7 @@ def __init__( self._azure_openai_deployments = AzureOpenAIDeploymentOperations( self._operation_scope, self._operation_config, - self._service_client_04_2024_preview, + self._service_client_04_2024_preview_arm, self._connections, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py index 4d5878d01f01..0e2192e647ff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/models/_patch.py @@ -22,10 +22,7 @@ ServerlessEndpointProperties as RestServerlessEndpointProperties, ) from azure.ai.ml._restclient.arm_ml_service.models import Sku as RestSku -from azure.ai.ml._restclient.v2024_04_01_preview.models import ( - EndpointDeploymentResourcePropertiesBasicResource, - OpenAIEndpointDeploymentResourceProperties, -) +from azure.ai.ml._restclient.arm_ml_service.models import SystemData as RestSystemData from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities._system_data import SystemData @@ -95,14 +92,21 @@ class AzureOpenAIDeployment(_AzureOpenAIDeployment): """System data of the deployment.""" @classmethod - def _from_rest_object(cls, obj: EndpointDeploymentResourcePropertiesBasicResource) -> "AzureOpenAIDeployment": - properties: OpenAIEndpointDeploymentResourceProperties = obj.properties + def _from_rest_object(cls, obj: Dict[str, Any]) -> "AzureOpenAIDeployment": + # ``EndpointDeploymentResourcePropertiesBasicResource`` is not modeled on arm_ml_service; the openai + # deployments are listed via a raw ``send_request`` call, so read the camelCase wire dict directly. + # ``systemData`` is rehydrated through the arm ``SystemData`` model to preserve datetime parsing. + properties = obj.get("properties") or {} + model = properties.get("model") or {} + system_data = obj.get("systemData") return cls( - name=obj.name, - model_name=properties.model.name, - model_version=properties.model.version, - id=obj.id, - system_data=SystemData._from_rest_object(obj.system_data), + name=obj.get("name"), + model_name=model.get("name"), + model_version=model.get("version"), + id=obj.get("id"), + system_data=( + SystemData._from_rest_object(RestSystemData._deserialize(system_data, [])) if system_data else None + ), ) def as_dict(self, *, exclude_readonly: bool = False) -> Dict[str, Any]: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py index 542448a99878..1915acfef07b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py @@ -5,11 +5,13 @@ # pylint: disable=protected-access import logging -from typing import Iterable +from typing import Any, Iterable, Optional -from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient2020404Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042024PreviewArm from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations from azure.ai.ml.entities._autogen_entities.models import AzureOpenAIDeployment +from azure.core.paging import ItemPaged +from azure.core.rest import HttpRequest from ._workspace_connections_operations import WorkspaceConnectionsOperations @@ -28,14 +30,14 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: ServiceClient2020404Preview, + service_client: ServiceClient042024PreviewArm, connections_operations: WorkspaceConnectionsOperations, ): super().__init__(operation_scope, operation_config) - self._service_client = service_client.connection + self._service_client = service_client self._workspace_connections_operations = connections_operations - def list(self, connection_name: str, **kwargs) -> Iterable[AzureOpenAIDeployment]: + def list(self, connection_name: str, **kwargs: Any) -> Iterable[AzureOpenAIDeployment]: """List Azure OpenAI deployments of the workspace. :param connection_name: Name of the connection from which to list deployments @@ -45,16 +47,34 @@ def list(self, connection_name: str, **kwargs) -> Iterable[AzureOpenAIDeployment """ connection = self._workspace_connections_operations.get(connection_name) - def _from_rest_add_connection_name(obj): + def _from_rest_add_connection_name(obj: Any) -> AzureOpenAIDeployment: from_rest_deployment = AzureOpenAIDeployment._from_rest_object(obj) from_rest_deployment.connection_name = connection_name from_rest_deployment.target_url = connection.target return from_rest_deployment - return self._service_client.list_deployments( - self._resource_group_name, - self._workspace_name, - connection_name, - cls=lambda objs: [_from_rest_add_connection_name(obj) for obj in objs], - **kwargs, + # ``arm_ml_service`` has no ``connection.list_deployments`` operation, so call the ARM + # ``.../connections/{name}/deployments`` list endpoint directly via ``send_request`` and page over + # the arm-paginated result. On-the-wire request/response is unchanged (api-version 2024-04-01-preview). + base_url = ( + f"/subscriptions/{self._subscription_id}" + f"/resourceGroups/{self._resource_group_name}" + f"/providers/Microsoft.MachineLearningServices/workspaces/{self._workspace_name}" + f"/connections/{connection_name}/deployments" ) + + def get_next(continuation_token: Optional[str] = None) -> Any: + if continuation_token: + request = HttpRequest("GET", continuation_token) + else: + request = HttpRequest("GET", base_url, params={"api-version": "2024-04-01-preview"}) + response = self._service_client.send_request(request) + response.raise_for_status() + return response + + def extract_data(response: Any) -> Any: + body = response.json() + elements = [_from_rest_add_connection_name(obj) for obj in (body.get("value") or [])] + return body.get("nextLink") or None, iter(elements) + + return ItemPaged(get_next, extract_data) From a4c7df1d7b350db9861a415cbbe65f0cdb2eebd5 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 19:02:23 +0530 Subject: [PATCH 058/146] Migrate compute enable_sso off v2024_04 to arm send_request (JSON-direct) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../ai/ml/operations/_compute_operations.py | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index c987fdc2c353..aee61d278e15 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -564,7 +564,7 @@ def __init__( self._operation_scope, self._operation_config, self._service_client_08_2023_preview, - self._service_client_04_2024_preview, + self._service_client_04_2024_preview_arm, ) self._operation_container.add(AzureMLResourceType.COMPUTE, self._compute) self._datastores = DatastoreOperations( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py index 7ab7db73ec6e..6fd9cb1eca0f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py @@ -6,9 +6,8 @@ from typing import Any, Dict, Iterable, Optional, cast +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042024PreviewArm from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient022023Preview -from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview -from azure.ai.ml._restclient.v2024_04_01_preview.models import SsoSetting from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._experimental import experimental @@ -17,6 +16,7 @@ from azure.ai.ml.constants._compute import ComputeType from azure.ai.ml.entities import AmlComputeNodeInfo, Compute, Usage, VmSize from azure.core.polling import LROPoller +from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace ops_logger = OpsLogger(__name__) @@ -42,13 +42,13 @@ def __init__( operation_scope: OperationScope, operation_config: OperationConfig, service_client: ServiceClient022023Preview, - service_client_2024: ServiceClient042024Preview, + service_client_2024_arm: ServiceClient042024PreviewArm, **kwargs: Dict, ) -> None: super(ComputeOperations, self).__init__(operation_scope, operation_config) ops_logger.update_filter() self._operation = service_client.compute - self._operation2024 = service_client_2024.compute + self._sso_service_client = service_client_2024_arm self._workspace_operations = service_client.workspaces self._vmsize_operations = service_client.virtual_machine_sizes self._usage_operations = service_client.usages @@ -434,13 +434,17 @@ def enable_sso(self, *, name: str, enable_sso: bool = True, **kwargs: Any) -> No :paramtype enable_sso: bool """ - self._operation2024.update_sso_settings( - self._operation_scope.resource_group_name, - self._workspace_name, - name, - parameters=SsoSetting(enable_sso=enable_sso), - **kwargs, + # ``arm_ml_service`` has no compute ``update_sso_settings`` operation; POST the ``enableSso`` action + # directly via ``send_request``. Body ({"enableSSO": ...}) and URL are unchanged (2024-04-01-preview). + url = ( + f"/subscriptions/{self._subscription_id}" + f"/resourceGroups/{self._operation_scope.resource_group_name}" + f"/providers/Microsoft.MachineLearningServices/workspaces/{self._workspace_name}" + f"/computes/{name}/enableSso" ) + request = HttpRequest("POST", url, params={"api-version": "2024-04-01-preview"}, json={"enableSSO": enable_sso}) + response = self._sso_service_client.send_request(request, **kwargs) + response.raise_for_status() def _get_workspace_location(self) -> str: workspace = self._workspace_operations.get(self._resource_group_name, self._workspace_name) From e353dd2fdc791f3c27f36107521ec5a68a723dbf Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 19:05:36 +0530 Subject: [PATCH 059/146] Delete v2024_04_01_preview restclient folder (all consumers migrated to arm_ml_service) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 26 +- .../v2024_04_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 336 - .../v2024_04_01_preview/_configuration.py | 76 - .../_restclient/v2024_04_01_preview/_patch.py | 31 - .../v2024_04_01_preview/_vendor.py | 27 - .../v2024_04_01_preview/_version.py | 9 - .../v2024_04_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 333 - .../v2024_04_01_preview/aio/_configuration.py | 72 - .../v2024_04_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 139 - .../_batch_deployments_operations.py | 642 - .../operations/_batch_endpoints_operations.py | 675 - ..._capacity_reservation_groups_operations.py | 472 - .../operations/_code_containers_operations.py | 339 - .../operations/_code_versions_operations.py | 589 - .../_component_containers_operations.py | 344 - .../_component_versions_operations.py | 512 - .../aio/operations/_compute_operations.py | 1531 - .../aio/operations/_connection_operations.py | 567 - ...onnection_rai_blocklist_item_operations.py | 393 - ...nnection_rai_blocklist_items_operations.py | 141 - .../_connection_rai_blocklist_operations.py | 385 - .../_connection_rai_blocklists_operations.py | 136 - .../_connection_rai_policies_operations.py | 136 - .../_connection_rai_policy_operations.py | 381 - .../operations/_data_containers_operations.py | 344 - .../operations/_data_versions_operations.py | 521 - .../aio/operations/_datastores_operations.py | 438 - .../_endpoint_deployment_operations.py | 578 - .../aio/operations/_endpoint_operations.py | 587 - .../_environment_containers_operations.py | 344 - .../_environment_versions_operations.py | 513 - .../aio/operations/_features_operations.py | 247 - .../_featureset_containers_operations.py | 495 - .../_featureset_versions_operations.py | 672 - ...aturestore_entity_containers_operations.py | 495 - ...featurestore_entity_versions_operations.py | 526 - .../_inference_endpoints_operations.py | 654 - .../_inference_groups_operations.py | 829 - .../operations/_inference_pools_operations.py | 794 - .../aio/operations/_jobs_operations.py | 627 - .../operations/_labeling_jobs_operations.py | 746 - .../_managed_network_provisions_operations.py | 183 - ...anaged_network_settings_rule_operations.py | 458 - .../_marketplace_subscriptions_operations.py | 463 - .../_model_containers_operations.py | 349 - .../operations/_model_versions_operations.py | 690 - .../_online_deployments_operations.py | 823 - .../_online_endpoints_operations.py | 897 - .../aio/operations/_operations.py | 118 - ...private_endpoint_connections_operations.py | 332 - .../_private_link_resources_operations.py | 143 - .../aio/operations/_quotas_operations.py | 186 - .../operations/_rai_policies_operations.py | 136 - .../aio/operations/_rai_policy_operations.py | 381 - .../aio/operations/_registries_operations.py | 710 - .../_registry_code_containers_operations.py | 463 - .../_registry_code_versions_operations.py | 570 - ...egistry_component_containers_operations.py | 463 - ..._registry_component_versions_operations.py | 499 - .../_registry_data_containers_operations.py | 468 - .../_registry_data_references_operations.py | 120 - .../_registry_data_versions_operations.py | 584 - ...istry_environment_containers_operations.py | 468 - ...egistry_environment_versions_operations.py | 505 - .../_registry_model_containers_operations.py | 468 - .../_registry_model_versions_operations.py | 743 - .../aio/operations/_schedules_operations.py | 539 - .../_serverless_endpoints_operations.py | 875 - .../aio/operations/_usages_operations.py | 124 - .../_virtual_machine_sizes_operations.py | 99 - .../_workspace_connections_operations.py | 624 - .../_workspace_features_operations.py | 129 - .../aio/operations/_workspaces_operations.py | 1416 - .../v2024_04_01_preview/models/__init__.py | 2451 - ...azure_machine_learning_workspaces_enums.py | 2298 - .../v2024_04_01_preview/models/_models.py | 36317 -------------- .../v2024_04_01_preview/models/_models_py3.py | 39422 ---------------- .../operations/__init__.py | 139 - .../_batch_deployments_operations.py | 876 - .../operations/_batch_endpoints_operations.py | 934 - ..._capacity_reservation_groups_operations.py | 714 - .../operations/_code_containers_operations.py | 511 - .../operations/_code_versions_operations.py | 872 - .../_component_containers_operations.py | 519 - .../_component_versions_operations.py | 750 - .../operations/_compute_operations.py | 2210 - .../operations/_connection_operations.py | 785 - ...onnection_rai_blocklist_item_operations.py | 537 - ...nnection_rai_blocklist_items_operations.py | 192 - .../_connection_rai_blocklist_operations.py | 527 - .../_connection_rai_blocklists_operations.py | 185 - .../_connection_rai_policies_operations.py | 185 - .../_connection_rai_policy_operations.py | 521 - .../operations/_data_containers_operations.py | 519 - .../operations/_data_versions_operations.py | 762 - .../operations/_datastores_operations.py | 671 - .../_endpoint_deployment_operations.py | 801 - .../operations/_endpoint_operations.py | 851 - .../_environment_containers_operations.py | 519 - .../_environment_versions_operations.py | 751 - .../operations/_features_operations.py | 359 - .../_featureset_containers_operations.py | 687 - .../_featureset_versions_operations.py | 924 - ...aturestore_entity_containers_operations.py | 687 - ...featurestore_entity_versions_operations.py | 732 - .../_inference_endpoints_operations.py | 894 - .../_inference_groups_operations.py | 1159 - .../operations/_inference_pools_operations.py | 1108 - .../operations/_jobs_operations.py | 905 - .../operations/_labeling_jobs_operations.py | 1045 - .../_managed_network_provisions_operations.py | 234 - ...anaged_network_settings_rule_operations.py | 629 - .../_marketplace_subscriptions_operations.py | 637 - .../_model_containers_operations.py | 527 - .../operations/_model_versions_operations.py | 992 - .../_online_deployments_operations.py | 1150 - .../_online_endpoints_operations.py | 1257 - .../operations/_operations.py | 155 - ...private_endpoint_connections_operations.py | 501 - .../_private_link_resources_operations.py | 190 - .../operations/_quotas_operations.py | 269 - .../operations/_rai_policies_operations.py | 185 - .../operations/_rai_policy_operations.py | 521 - .../operations/_registries_operations.py | 988 - .../_registry_code_containers_operations.py | 636 - .../_registry_code_versions_operations.py | 802 - ...egistry_component_containers_operations.py | 637 - ..._registry_component_versions_operations.py | 690 - .../_registry_data_containers_operations.py | 644 - .../_registry_data_references_operations.py | 174 - .../_registry_data_versions_operations.py | 823 - ...istry_environment_containers_operations.py | 645 - ...egistry_environment_versions_operations.py | 699 - .../_registry_model_containers_operations.py | 645 - .../_registry_model_versions_operations.py | 1036 - .../operations/_schedules_operations.py | 758 - .../_serverless_endpoints_operations.py | 1217 - .../operations/_usages_operations.py | 169 - .../_virtual_machine_sizes_operations.py | 144 - .../_workspace_connections_operations.py | 929 - .../_workspace_features_operations.py | 176 - .../operations/_workspaces_operations.py | 2020 - .../_restclient/v2024_04_01_preview/py.typed | 1 - .../connection/e2etests/test_connections.py | 2 +- .../unittests/test_connection_entity.py | 2 +- 148 files changed, 5 insertions(+), 158190 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_capacity_reservation_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklists_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_capacity_reservation_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_item_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_items_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklists_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index aee61d278e15..5b9d6d49c239 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -26,7 +26,6 @@ AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, ) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview -from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview from azure.ai.ml._restclient.workspace_dataplane import WorkspaceDataplaneClient as ServiceClientWorkspaceDataplane from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope from azure.ai.ml._telemetry.logging_handler import configure_appinsights_logging @@ -106,10 +105,9 @@ ServiceClient062023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-06-01-preview") ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") ServiceClient102024PreviewTsp = partial(MachineLearningServicesMgmtClient, api_version="2024-10-01-preview") -# arm_ml_service-backed client pinned to the 2024-04-01-preview wire api-version, used only by the workspace -# connections operation (whose entity already builds arm_ml_service bodies and whose operation methods all match -# the arm client). The separate v2024_04_01_preview msrest client is still required by the compute -# (update_sso_settings) and Azure OpenAI deployment (.connection group) operations, which have no arm equivalent. +# arm_ml_service-backed client pinned to the 2024-04-01-preview wire api-version. Used by the workspace +# connections operation, and (via send_request for arm-absent ops) by compute enable_sso and the Azure OpenAI +# deployment list. The legacy v2024_04_01_preview msrest client has been fully retired. ServiceClient042024PreviewArm = partial(MachineLearningServicesMgmtClient, api_version="2024-04-01-preview") # arm_ml_service-backed client pinned to the 2024-01-01-preview wire api-version. Operations whose entities now # build arm_ml_service bodies are being repointed onto this shared arm client (marketplace subscriptions, @@ -370,13 +368,6 @@ def __init__( **kwargs, ) - self._service_client_04_2024_preview = ServiceClient042024Preview( - credential=self._credential, - subscription_id=self._operation_scope._subscription_id, - base_url=base_url, - **kwargs, - ) - self._service_client_10_2024_preview_tsp = ServiceClient102024PreviewTsp( credential=self._credential, subscription_id=( @@ -472,17 +463,6 @@ def __init__( **kwargs, ) - self._service_client_04_2024_preview = ServiceClient042024Preview( - credential=self._credential, - subscription_id=( - self._ws_operation_scope._subscription_id - if registry_reference - else self._operation_scope._subscription_id - ), - base_url=base_url, - **kwargs, - ) - # arm_ml_service-backed client at the 2024-04-01-preview wire api-version, used only by the workspace # connections operation so it deserializes responses into the shared arm_ml_service models it now builds. self._service_client_04_2024_preview_arm = ServiceClient042024PreviewArm( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 7700ce8c40e6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,336 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapacityReservationGroupsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations - :vartype capacity_reservation_groups: - azure.mgmt.machinelearningservices.operations.CapacityReservationGroupsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentVersionsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.operations.MarketplaceSubscriptionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar connection: ConnectionOperations operations - :vartype connection: azure.mgmt.machinelearningservices.operations.ConnectionOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.mgmt.machinelearningservices.operations.ConnectionRaiPoliciesOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.mgmt.machinelearningservices.operations.ConnectionRaiPolicyOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.operations.EndpointOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: azure.mgmt.machinelearningservices.operations.RaiPoliciesOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: azure.mgmt.machinelearningservices.operations.RaiPolicyOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2024-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.capacity_reservation_groups = CapacityReservationGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policies = ConnectionRaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policy = ConnectionRaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_configuration.py deleted file mode 100644 index 36c662aabf31..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2024-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index cc451c63bc02..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,333 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -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 .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapacityReservationGroupsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.aio.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations - :vartype capacity_reservation_groups: - azure.mgmt.machinelearningservices.aio.operations.CapacityReservationGroupsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentVersionsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.aio.operations.MarketplaceSubscriptionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.aio.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.aio.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.aio.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.aio.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.aio.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar connection: ConnectionOperations operations - :vartype connection: azure.mgmt.machinelearningservices.aio.operations.ConnectionOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiPoliciesOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiPolicyOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.aio.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.aio.operations.EndpointOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: azure.mgmt.machinelearningservices.aio.operations.RaiPoliciesOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: azure.mgmt.machinelearningservices.aio.operations.RaiPolicyOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2024-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.capacity_reservation_groups = CapacityReservationGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policies = ConnectionRaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policy = ConnectionRaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_configuration.py deleted file mode 100644 index 0f08a522da17..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2024-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/__init__.py deleted file mode 100644 index a7b6d64ab9dd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._connection_operations import ConnectionOperations -from ._connection_rai_blocklists_operations import ConnectionRaiBlocklistsOperations -from ._connection_rai_blocklist_operations import ConnectionRaiBlocklistOperations -from ._connection_rai_blocklist_item_operations import ConnectionRaiBlocklistItemOperations -from ._connection_rai_blocklist_items_operations import ConnectionRaiBlocklistItemsOperations -from ._connection_rai_policies_operations import ConnectionRaiPoliciesOperations -from ._connection_rai_policy_operations import ConnectionRaiPolicyOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._rai_policies_operations import RaiPoliciesOperations -from ._rai_policy_operations import RaiPolicyOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'CapacityReservationGroupsOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'MarketplaceSubscriptionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ConnectionOperations', - 'ConnectionRaiBlocklistsOperations', - 'ConnectionRaiBlocklistOperations', - 'ConnectionRaiBlocklistItemOperations', - 'ConnectionRaiBlocklistItemsOperations', - 'ConnectionRaiPoliciesOperations', - 'ConnectionRaiPolicyOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'RaiPoliciesOperations', - 'RaiPolicyOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index b9537c6ab4c5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,642 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeployment": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index f0c9b97ecd87..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpoint": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_capacity_reservation_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_capacity_reservation_groups_operations.py deleted file mode 100644 index c0ad8307090e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_capacity_reservation_groups_operations.py +++ /dev/null @@ -1,472 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._capacity_reservation_groups_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_subscription_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CapacityReservationGroupsOperations: - """CapacityReservationGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"]: - """List CapacityReservationGroups by subscription. - - List CapacityReservationGroups by subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"]: - """Lists CapacityReservationGroups. - - Lists CapacityReservationGroups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - group_id: str, - **kwargs: Any - ) -> None: - """Delete CapacityReservationGroup. - - Delete CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - group_id: str, - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """Get CapacityReservationGroup. - - Get CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - group_id: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """Update CapacityReservationGroup. - - Update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to update. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - group_id: str, - body: "_models.CapacityReservationGroup", - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """Create or update CapacityReservationGroup. - - Create or update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to create. - :type body: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapacityReservationGroup') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index 2046f213b6f9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 246ba37308ca..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,589 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 51ffc8482b1d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 8e6714ed7eef..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,512 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index 38d7133af4d0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1531 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_allowed_resize_sizes_request, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_resize_request_initial, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_data_mounts_request, build_update_idle_shutdown_setting_request, build_update_sso_settings_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List["_models.CustomService"], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List["_models.ComputeInstanceDataMount"], - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.IdleShutdownSetting", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def update_sso_settings( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.SsoSetting", - **kwargs: Any - ) -> None: - """Update single sign-on settings of the compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating sso setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.SsoSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'SsoSetting') - - request = build_update_sso_settings_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_sso_settings.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_sso_settings.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/enableSso"} # type: ignore - - - @distributed_trace_async - async def get_allowed_resize_sizes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - async def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace_async - async def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_operations.py deleted file mode 100644 index ae10545294d2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_operations.py +++ /dev/null @@ -1,567 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_operations import build_create_or_update_deployment_request_initial, build_delete_deployment_request_initial, build_get_deployment_request, build_get_models_request, build_list_deployments_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionOperations: - """ConnectionOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_deployments( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_deployments.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_deployments.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments"} # type: ignore - - async def _delete_deployment_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete_deployment( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_deployment_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get_deployment.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py deleted file mode 100644 index 5608e4a91951..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py +++ /dev/null @@ -1,393 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_item_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistItemOperations: - """ConnectionRaiBlocklistItemOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> "_models.RaiBlocklistPropertiesBasicResource": - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: "_models.RaiBlocklistItemPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiBlocklistItemPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistItemPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: "_models.RaiBlocklistItemPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiBlocklistItemPropertiesBasicResource"]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py deleted file mode 100644 index 378a9cab2f76..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_items_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistItemsOperations: - """ConnectionRaiBlocklistItemsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"]: - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_operations.py deleted file mode 100644 index d64e3d7d2a6a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklist_operations.py +++ /dev/null @@ -1,385 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistOperations: - """ConnectionRaiBlocklistOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: "_models.RaiBlocklistPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiBlocklistPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: "_models.RaiBlocklistPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiBlocklistPropertiesBasicResource"]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiBlocklistPropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> "_models.RaiBlocklistItemPropertiesBasicResource": - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistItemPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklists_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklists_operations.py deleted file mode 100644 index 77e302cfaa5c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_blocklists_operations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklists_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistsOperations: - """ConnectionRaiBlocklistsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"]: - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policies_operations.py deleted file mode 100644 index a4188c3b05de..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policies_operations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_policies_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiPoliciesOperations: - """ConnectionRaiPoliciesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"]: - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policy_operations.py deleted file mode 100644 index 29f21e6eb8b8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_connection_rai_policy_operations.py +++ /dev/null @@ -1,381 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_policy_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiPolicyOperations: - """ConnectionRaiPolicyOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiPolicyPropertiesBasicResource"]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiPolicyPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 5c22ec5d97e0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index 7d2b56a1c860..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param stage: data stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 7c8673e6c35b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Datastore": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Datastore", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.Datastore": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_deployment_operations.py deleted file mode 100644 index 12795921bf09..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,578 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_deployment_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_in_workspace_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointDeploymentOperations: - """EndpointDeploymentOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_operations.py deleted file mode 100644 index 46fffe8d0fe4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_endpoint_operations.py +++ /dev/null @@ -1,587 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_operations import build_create_or_update_request_initial, build_get_models_request, build_get_request, build_list_keys_request, build_list_request, build_regenerate_keys_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointOperations: - """EndpointOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - include_inference_endpoints: Optional[bool] = False, - skip: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"]: - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param include_inference_endpoints: - :type include_inference_endpoints: bool - :param skip: Continuation token for pagination. - :type skip: str - :param expand: Whether the endpoint resource will be expand to include deployment information, - e.g. $expand=deployments. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointResourcePropertiesBasicResource": - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointResourcePropertiesBasicResource"]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointKeys": - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateServiceAccountKeyContent", - **kwargs: Any - ) -> "_models.AccountApiKeys": - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 222d2e3f07a2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 7dbe7dfde0fe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,513 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index d89de99e508f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,247 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesOperations: - """FeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 1000, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureResourceArmPaginatedResult"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :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 - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> "_models.Feature": - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index 7383958e8770..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetContainersOperations: - """FeaturesetContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturesetContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index 1fd49b43d4ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,672 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetVersionsOperations: - """FeaturesetVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturesetVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> Optional["_models.FeaturesetVersionBackfillResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersionBackfillResponse"]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersionBackfillResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index fbce84315176..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityContainersOperations: - """FeaturestoreEntityContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityContainer or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 4aa0ecc3ab94..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityVersionsOperations: - """FeaturestoreEntityVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_endpoints_operations.py deleted file mode 100644 index 37d51f006c88..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,654 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceEndpointsOperations: - """InferenceEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"]: - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.InferenceEndpoint": - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> Optional["_models.InferenceEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> "_models.InferenceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_groups_operations.py deleted file mode 100644 index 7f0f746f94a2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_groups_operations.py +++ /dev/null @@ -1,829 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceGroupsOperations: - """InferenceGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"]: - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.InferenceGroup": - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.InferenceGroup"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> "_models.InferenceGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.GroupStatus": - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_pools_operations.py deleted file mode 100644 index 9feb2204938a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_inference_pools_operations.py +++ /dev/null @@ -1,794 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferencePoolsOperations: - """InferencePoolsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferencePoolTrackedResourceArmPaginatedResult"]: - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.InferencePool": - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.InferencePool"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> "_models.InferencePool": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.PoolStatus": - """Retrieve inference pool status. - - Retrieve inference pool status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PoolStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PoolStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PoolStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PoolStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Pool Skus. - - List Inference Pool Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Inference Group name. - :type inference_pool_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 0d61031d50ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,627 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - properties: Optional[str] = None, - asset_name: Optional[str] = None, - scheduled: Optional[bool] = None, - schedule_id: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBase": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.PartialJobBasePartialResource", - **kwargs: Any - ) -> "_models.JobBase": - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBase", - **kwargs: Any - ) -> "_models.JobBase": - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index 92426b580faf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,746 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def pause( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.LabelingJobProperties": - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJobProperties, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> Optional["_models.LabelingJobProperties"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LabelingJobProperties"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _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( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJobProperties"]: - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJobProperties or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJobProperties] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index a385425716dd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkProvisionsOperations: - """ManagedNetworkProvisionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 6c1442e1c637..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,458 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkSettingsRuleOperations: - """ManagedNetworkSettingsRuleOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.OutboundRuleListResult"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.OutboundRuleBasicResource": - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OutboundRuleBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index 4f5d1d3d153c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._marketplace_subscriptions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MarketplaceSubscriptionsOperations: - """MarketplaceSubscriptionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> AsyncLROPoller["_models.MarketplaceSubscription"]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MarketplaceSubscription or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index e841fec49829..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,349 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 85f3e6426c55..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_package_request_initial, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :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 - :param stage: Model stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - async def _package_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index a2e7f9d54f15..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeployment": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index ef31d1bdb0d6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,897 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpoint": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_operations.py deleted file mode 100644 index 1c48452e6849..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 5e6945db000d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,332 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.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/v2024_04_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 71ae1fb6d9c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,143 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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/v2024_04_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index 824ee6925d02..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,186 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policies_operations.py deleted file mode 100644 index 5762188c5129..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policies_operations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._rai_policies_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RaiPoliciesOperations: - """RaiPoliciesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"]: - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policy_operations.py deleted file mode 100644 index c17360c2f326..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_rai_policy_operations.py +++ /dev/null @@ -1,381 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._rai_policy_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RaiPolicyOperations: - """RaiPolicyOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiPolicyPropertiesBasicResource"]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiPolicyPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 1de3cf10086e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistriesOperations: - """RegistriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.Registry": - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> "_models.Registry": - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 5ae8e941baf7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeContainersOperations: - """RegistryCodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeContainer"]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index cf1804b58b8f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeVersionsOperations: - """RegistryCodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 1872ff5cefaa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentContainersOperations: - """RegistryComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 25266023005f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentVersionsOperations: - """RegistryComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index 2107f32b5485..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataContainersOperations: - """RegistryDataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_references_operations.py deleted file mode 100644 index a51fe315de43..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,120 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_references_operations import build_get_blob_reference_sas_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataReferencesOperations: - """RegistryDataReferencesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.GetBlobReferenceSASRequestDto", - **kwargs: Any - ) -> "_models.GetBlobReferenceSASResponseDto": - """Get blob reference SAS Uri value. - - Get blob reference SAS Uri value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index d43588852a10..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataVersionsOperations: - """RegistryDataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataVersionBase"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 4203ad1c17a3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentContainersOperations: - """RegistryEnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index a3096bd97cfb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,505 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentVersionsOperations: - """RegistryEnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index b9d8c91e205c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelContainersOperations: - """RegistryModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainer"]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index f7a27916781c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelVersionsOperations: - """RegistryModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - async def _package_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index c0d7a4a2165b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,539 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_trigger_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchedulesOperations: - """SchedulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Schedule": - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> AsyncLROPoller["_models.Schedule"]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Schedule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def trigger( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.TriggerOnceRequest", - **kwargs: Any - ) -> "_models.TriggerRunSubmissionDto": - """Trigger run. - - Trigger run. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Request body for trigger once. - :type body: ~azure.mgmt.machinelearningservices.models.TriggerOnceRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TriggerRunSubmissionDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.TriggerRunSubmissionDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerRunSubmissionDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'TriggerOnceRequest') - - request = build_trigger_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.trigger.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('TriggerRunSubmissionDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - trigger.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 3d2db9097fd2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,875 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._serverless_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ServerlessEndpointsOperations: - """ServerlessEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.ServerlessEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpointStatus": - """Status of the model backing the Serverless Endpoint. - - Status of the model backing the Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpointStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpointStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus"} # type: ignore - - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> Optional["_models.EndpointAuthKeys"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointAuthKeys"]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 674946160321..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 5dd7e2800e57..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index f2a41fc5c41c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,624 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, build_test_connection_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionUpdateParameter"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - async def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace_async - async def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 05145c83e3d9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,129 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 28db7f68f12f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1416 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_connection_models_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: # pylint: disable=too-many-public-methods - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_connection_models( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.EndpointModels": - """List available models from all connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointModels, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointModels - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_connection_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_connection_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointModels', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_connection_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels"} # type: ignore - - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/__init__.py deleted file mode 100644 index bc9cfe16018f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/__init__.py +++ /dev/null @@ -1,2451 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AADAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AKS - from ._models_py3 import AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountApiKeys - from ._models_py3 import AccountKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AccountModel - from ._models_py3 import AcrDetails - from ._models_py3 import ActualCapacityInfo - from ._models_py3 import AksComputeSecrets - from ._models_py3 import AksComputeSecretsProperties - from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AllFeatures - from ._models_py3 import AllNodes - from ._models_py3 import AmlCompute - from ._models_py3 import AmlComputeNodeInformation - from ._models_py3 import AmlComputeNodesInformation - from ._models_py3 import AmlComputeProperties - from ._models_py3 import AmlComputeSchema - from ._models_py3 import AmlToken - from ._models_py3 import AmlTokenComputeIdentity - from ._models_py3 import AmlUserFeature - from ._models_py3 import AnonymousAccessCredential - from ._models_py3 import ApiKeyAuthWorkspaceConnectionProperties - from ._models_py3 import ArmResourceId - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AssignedUser - from ._models_py3 import AutoDeleteSetting - from ._models_py3 import AutoForecastHorizon - from ._models_py3 import AutoMLJob - from ._models_py3 import AutoMLVertical - from ._models_py3 import AutoNCrossValidations - from ._models_py3 import AutoPauseProperties - from ._models_py3 import AutoScaleProperties - from ._models_py3 import AutoSeasonality - from ._models_py3 import AutoTargetLags - from ._models_py3 import AutoTargetRollingWindowSize - from ._models_py3 import AutologgerSettings - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureDevOpsWebhook - from ._models_py3 import AzureFileDatastore - from ._models_py3 import AzureMLBatchInferencingServer - from ._models_py3 import AzureMLOnlineInferencingServer - from ._models_py3 import AzureOpenAiFineTuning - from ._models_py3 import AzureOpenAiHyperParameters - from ._models_py3 import BanditPolicy - from ._models_py3 import BaseEnvironmentId - from ._models_py3 import BaseEnvironmentSource - from ._models_py3 import BatchDeployment - from ._models_py3 import BatchDeploymentConfiguration - from ._models_py3 import BatchDeploymentProperties - from ._models_py3 import BatchDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import BatchEndpoint - from ._models_py3 import BatchEndpointDefaults - from ._models_py3 import BatchEndpointProperties - from ._models_py3 import BatchEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import BatchPipelineComponentDeploymentConfiguration - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BlobReferenceForConsumptionDto - from ._models_py3 import BuildContext - from ._models_py3 import CallRateLimit - from ._models_py3 import CapacityConfig - from ._models_py3 import CapacityReservationGroup - from ._models_py3 import CapacityReservationGroupProperties - from ._models_py3 import CapacityReservationGroupTrackedResourceArmPaginatedResult - from ._models_py3 import CategoricalDataDriftMetricThreshold - from ._models_py3 import CategoricalDataQualityMetricThreshold - from ._models_py3 import CategoricalPredictionDriftMetricThreshold - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import Classification - from ._models_py3 import ClassificationModelPerformanceMetricThreshold - from ._models_py3 import ClassificationTrainingSettings - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import CocoExportSummary - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainer - from ._models_py3 import CodeContainerProperties - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersion - from ._models_py3 import CodeVersionProperties - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import CognitiveServiceEndpointDeploymentResourceProperties - from ._models_py3 import CognitiveServicesSku - from ._models_py3 import Collection - from ._models_py3 import ColumnTransformer - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentConfiguration - from ._models_py3 import ComponentContainer - from ._models_py3 import ComponentContainerProperties - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentVersion - from ._models_py3 import ComponentVersionProperties - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import Compute - from ._models_py3 import ComputeInstance - from ._models_py3 import ComputeInstanceApplication - from ._models_py3 import ComputeInstanceAutologgerSettings - from ._models_py3 import ComputeInstanceConnectivityEndpoints - from ._models_py3 import ComputeInstanceContainer - from ._models_py3 import ComputeInstanceCreatedBy - from ._models_py3 import ComputeInstanceDataDisk - from ._models_py3 import ComputeInstanceDataMount - from ._models_py3 import ComputeInstanceEnvironmentInfo - from ._models_py3 import ComputeInstanceLastOperation - from ._models_py3 import ComputeInstanceProperties - from ._models_py3 import ComputeInstanceSchema - from ._models_py3 import ComputeInstanceSshSettings - from ._models_py3 import ComputeInstanceVersion - from ._models_py3 import ComputeRecurrenceSchedule - from ._models_py3 import ComputeResource - from ._models_py3 import ComputeResourceSchema - from ._models_py3 import ComputeRuntimeDto - from ._models_py3 import ComputeSchedules - from ._models_py3 import ComputeSecrets - from ._models_py3 import ComputeStartStopSchedule - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import ContainerResourceSettings - from ._models_py3 import ContentSafetyEndpointDeploymentResourceProperties - from ._models_py3 import ContentSafetyEndpointResourceProperties - from ._models_py3 import CosmosDbSettings - from ._models_py3 import CreateMonitorAction - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomInferencingServer - from ._models_py3 import CustomKeys - from ._models_py3 import CustomKeysWorkspaceConnectionProperties - from ._models_py3 import CustomMetricThreshold - from ._models_py3 import CustomModelFineTuning - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import CustomMonitoringSignal - from ._models_py3 import CustomNCrossValidations - from ._models_py3 import CustomSeasonality - from ._models_py3 import CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataCollector - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataDriftMetricThresholdBase - from ._models_py3 import DataDriftMonitoringSignal - from ._models_py3 import DataFactory - from ._models_py3 import DataImport - from ._models_py3 import DataImportSource - from ._models_py3 import DataLakeAnalytics - from ._models_py3 import DataLakeAnalyticsSchema - from ._models_py3 import DataLakeAnalyticsSchemaProperties - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataQualityMetricThresholdBase - from ._models_py3 import DataQualityMonitoringSignal - from ._models_py3 import DataReferenceCredential - from ._models_py3 import DataVersionBase - from ._models_py3 import DataVersionBaseProperties - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import DatabaseSource - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksComputeSecretsProperties - from ._models_py3 import DatabricksProperties - from ._models_py3 import DatabricksSchema - from ._models_py3 import DatasetExportSummary - from ._models_py3 import Datastore - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreProperties - from ._models_py3 import DatastoreResourceArmPaginatedResult - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DefaultScaleSettings - from ._models_py3 import DeploymentLogs - from ._models_py3 import DeploymentLogsRequest - from ._models_py3 import DeploymentModel - from ._models_py3 import DeploymentResourceConfiguration - from ._models_py3 import DestinationAsset - from ._models_py3 import DiagnoseRequestProperties - from ._models_py3 import DiagnoseResponseResult - from ._models_py3 import DiagnoseResponseResultValue - from ._models_py3 import DiagnoseResult - from ._models_py3 import DiagnoseWorkspaceParameters - from ._models_py3 import DistributionConfiguration - from ._models_py3 import Docker - from ._models_py3 import DockerCredential - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultUpdateProperties - from ._models_py3 import EncryptionProperty - from ._models_py3 import EncryptionUpdateProperties - from ._models_py3 import Endpoint - from ._models_py3 import EndpointAuthKeys - from ._models_py3 import EndpointAuthToken - from ._models_py3 import EndpointDeploymentModel - from ._models_py3 import EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointDeploymentResourceProperties - from ._models_py3 import EndpointDeploymentResourcePropertiesBasicResource - from ._models_py3 import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult - from ._models_py3 import EndpointKeys - from ._models_py3 import EndpointModels - from ._models_py3 import EndpointPropertiesBase - from ._models_py3 import EndpointResourceProperties - from ._models_py3 import EndpointResourcePropertiesBasicResource - from ._models_py3 import EndpointResourcePropertiesBasicResourceArmPaginatedResult - from ._models_py3 import EndpointScheduleAction - from ._models_py3 import EnvironmentContainer - from ._models_py3 import EnvironmentContainerProperties - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVariable - from ._models_py3 import EnvironmentVersion - from ._models_py3 import EnvironmentVersionProperties - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import EstimatedVMPrice - from ._models_py3 import EstimatedVMPrices - from ._models_py3 import ExportSummary - from ._models_py3 import ExternalFQDNResponse - from ._models_py3 import FQDNEndpoint - from ._models_py3 import FQDNEndpointDetail - from ._models_py3 import FQDNEndpoints - from ._models_py3 import FQDNEndpointsPropertyBag - from ._models_py3 import Feature - from ._models_py3 import FeatureAttributionDriftMonitoringSignal - from ._models_py3 import FeatureAttributionMetricThreshold - from ._models_py3 import FeatureImportanceSettings - from ._models_py3 import FeatureProperties - from ._models_py3 import FeatureResourceArmPaginatedResult - from ._models_py3 import FeatureStoreSettings - from ._models_py3 import FeatureSubset - from ._models_py3 import FeatureWindow - from ._models_py3 import FeaturesetContainer - from ._models_py3 import FeaturesetContainerProperties - from ._models_py3 import FeaturesetContainerResourceArmPaginatedResult - from ._models_py3 import FeaturesetSpecification - from ._models_py3 import FeaturesetVersion - from ._models_py3 import FeaturesetVersionBackfillRequest - from ._models_py3 import FeaturesetVersionBackfillResponse - from ._models_py3 import FeaturesetVersionProperties - from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityContainer - from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityVersion - from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult - from ._models_py3 import FeaturizationSettings - from ._models_py3 import FileSystemSource - from ._models_py3 import FineTuningJob - from ._models_py3 import FineTuningVertical - from ._models_py3 import FixedInputData - from ._models_py3 import FlavorData - from ._models_py3 import ForecastHorizon - from ._models_py3 import Forecasting - from ._models_py3 import ForecastingSettings - from ._models_py3 import ForecastingTrainingSettings - from ._models_py3 import FqdnOutboundRule - from ._models_py3 import GenerationSafetyQualityMetricThreshold - from ._models_py3 import GenerationSafetyQualityMonitoringSignal - from ._models_py3 import GenerationTokenUsageMetricThreshold - from ._models_py3 import GenerationTokenUsageSignal - from ._models_py3 import GetBlobReferenceForConsumptionDto - from ._models_py3 import GetBlobReferenceSASRequestDto - from ._models_py3 import GetBlobReferenceSASResponseDto - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import GroupStatus - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import IdentityForCmk - from ._models_py3 import IdleShutdownSetting - from ._models_py3 import Image - from ._models_py3 import ImageClassification - from ._models_py3 import ImageClassificationBase - from ._models_py3 import ImageClassificationMultilabel - from ._models_py3 import ImageInstanceSegmentation - from ._models_py3 import ImageLimitSettings - from ._models_py3 import ImageMetadata - from ._models_py3 import ImageModelDistributionSettings - from ._models_py3 import ImageModelDistributionSettingsClassification - from ._models_py3 import ImageModelDistributionSettingsObjectDetection - from ._models_py3 import ImageModelSettings - from ._models_py3 import ImageModelSettingsClassification - from ._models_py3 import ImageModelSettingsObjectDetection - from ._models_py3 import ImageObjectDetection - from ._models_py3 import ImageObjectDetectionBase - from ._models_py3 import ImageSweepSettings - from ._models_py3 import ImageVertical - from ._models_py3 import ImportDataAction - from ._models_py3 import IndexColumn - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InferenceEndpoint - from ._models_py3 import InferenceEndpointProperties - from ._models_py3 import InferenceEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import InferenceGroup - from ._models_py3 import InferenceGroupProperties - from ._models_py3 import InferenceGroupTrackedResourceArmPaginatedResult - from ._models_py3 import InferencePool - from ._models_py3 import InferencePoolProperties - from ._models_py3 import InferencePoolTrackedResourceArmPaginatedResult - from ._models_py3 import InferencingServer - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import IntellectualProperty - from ._models_py3 import JobBase - from ._models_py3 import JobBaseProperties - from ._models_py3 import JobBaseResourceArmPaginatedResult - from ._models_py3 import JobInput - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobResourceConfiguration - from ._models_py3 import JobScheduleAction - from ._models_py3 import JobService - from ._models_py3 import JupyterKernelConfig - from ._models_py3 import KerberosCredentials - from ._models_py3 import KerberosKeytabCredentials - from ._models_py3 import KerberosKeytabSecrets - from ._models_py3 import KerberosPasswordCredentials - from ._models_py3 import KerberosPasswordSecrets - from ._models_py3 import KeyVaultProperties - from ._models_py3 import Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - from ._models_py3 import LakeHouseArtifact - from ._models_py3 import ListAmlUserFeatureResult - from ._models_py3 import ListNotebookKeysResult - from ._models_py3 import ListStorageAccountKeysResult - from ._models_py3 import ListUsagesResult - from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import ListWorkspaceQuotas - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableData - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import ManagedComputeIdentity - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedIdentityCredential - from ._models_py3 import ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedOnlineEndpointDeploymentResourceProperties - from ._models_py3 import ManagedOnlineEndpointResourceProperties - from ._models_py3 import ManagedResourceGroupAssignedIdentities - from ._models_py3 import ManagedResourceGroupSettings - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MarketplacePlan - from ._models_py3 import MarketplaceSubscription - from ._models_py3 import MarketplaceSubscriptionProperties - from ._models_py3 import MarketplaceSubscriptionResourceArmPaginatedResult - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelConfiguration - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelDeprecationInfo - from ._models_py3 import ModelPackageInput - from ._models_py3 import ModelPerformanceMetricThresholdBase - from ._models_py3 import ModelPerformanceSignal - from ._models_py3 import ModelSettings - from ._models_py3 import ModelSku - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import MonitorComputeConfigurationBase - from ._models_py3 import MonitorComputeIdentityBase - from ._models_py3 import MonitorDefinition - from ._models_py3 import MonitorEmailNotificationSettings - from ._models_py3 import MonitorNotificationSettings - from ._models_py3 import MonitorServerlessSparkCompute - from ._models_py3 import MonitoringDataSegment - from ._models_py3 import MonitoringFeatureFilterBase - from ._models_py3 import MonitoringInputDataBase - from ._models_py3 import MonitoringSignalBase - from ._models_py3 import MonitoringTarget - from ._models_py3 import MonitoringThreshold - from ._models_py3 import MonitoringWorkspaceConnection - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - from ._models_py3 import NlpVertical - from ._models_py3 import NlpVerticalFeaturizationSettings - from ._models_py3 import NlpVerticalLimitSettings - from ._models_py3 import NodeStateCounts - from ._models_py3 import Nodes - from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import NotebookAccessTokenResult - from ._models_py3 import NotebookPreparationError - from ._models_py3 import NotebookResourceInfo - from ._models_py3 import NotificationSetting - from ._models_py3 import NumericalDataDriftMetricThreshold - from ._models_py3 import NumericalDataQualityMetricThreshold - from ._models_py3 import NumericalPredictionDriftMetricThreshold - from ._models_py3 import OAuth2AuthTypeWorkspaceConnectionProperties - from ._models_py3 import Objective - from ._models_py3 import OneLakeArtifact - from ._models_py3 import OneLakeDatastore - from ._models_py3 import OnlineDeployment - from ._models_py3 import OnlineDeploymentProperties - from ._models_py3 import OnlineDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineEndpoint - from ._models_py3 import OnlineEndpointProperties - from ._models_py3 import OnlineEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineInferenceConfiguration - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OpenAIEndpointDeploymentResourceProperties - from ._models_py3 import OpenAIEndpointResourceProperties - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OsPatchingStatus - from ._models_py3 import OutboundRule - from ._models_py3 import OutboundRuleBasicResource - from ._models_py3 import OutboundRuleListResult - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PackageInputPathBase - from ._models_py3 import PackageInputPathId - from ._models_py3 import PackageInputPathUrl - from ._models_py3 import PackageInputPathVersion - from ._models_py3 import PackageRequest - from ._models_py3 import PackageResponse - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - from ._models_py3 import PartialJobBase - from ._models_py3 import PartialJobBasePartialResource - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialMinimalTrackedResource - from ._models_py3 import PartialMinimalTrackedResourceWithIdentity - from ._models_py3 import PartialMinimalTrackedResourceWithSku - from ._models_py3 import PartialMinimalTrackedResourceWithSkuAndIdentity - from ._models_py3 import PartialNotificationSetting - from ._models_py3 import PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PendingUploadCredentialDto - from ._models_py3 import PendingUploadRequestDto - from ._models_py3 import PendingUploadResponseDto - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - from ._models_py3 import PoolEnvironmentConfiguration - from ._models_py3 import PoolModelConfiguration - from ._models_py3 import PoolStatus - from ._models_py3 import PredictionDriftMetricThresholdBase - from ._models_py3 import PredictionDriftMonitoringSignal - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateEndpointDestination - from ._models_py3 import PrivateEndpointOutboundRule - from ._models_py3 import PrivateEndpointResource - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import ProbeSettings - from ._models_py3 import ProgressMetrics - from ._models_py3 import PropertiesBase - from ._models_py3 import ProxyResource - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RaiBlocklistConfig - from ._models_py3 import RaiBlocklistItemProperties - from ._models_py3 import RaiBlocklistItemPropertiesBasicResource - from ._models_py3 import RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RaiBlocklistProperties - from ._models_py3 import RaiBlocklistPropertiesBasicResource - from ._models_py3 import RaiBlocklistPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RaiPolicyContentFilter - from ._models_py3 import RaiPolicyProperties - from ._models_py3 import RaiPolicyPropertiesBasicResource - from ._models_py3 import RaiPolicyPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import Ray - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import RegenerateServiceAccountKeyContent - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryPartialManagedServiceIdentity - from ._models_py3 import RegistryPrivateEndpointConnection - from ._models_py3 import RegistryPrivateLinkServiceConnectionState - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionModelPerformanceMetricThreshold - from ._models_py3 import RegressionTrainingSettings - from ._models_py3 import RequestConfiguration - from ._models_py3 import RequestLogging - from ._models_py3 import RequestMatchPattern - from ._models_py3 import ResizeSchema - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import ResourceId - from ._models_py3 import ResourceName - from ._models_py3 import ResourceQuota - from ._models_py3 import RollingInputData - from ._models_py3 import Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - from ._models_py3 import SASCredential - from ._models_py3 import SASCredentialDto - from ._models_py3 import SamplingAlgorithm - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ScaleSettings - from ._models_py3 import ScaleSettingsInformation - from ._models_py3 import Schedule - from ._models_py3 import ScheduleActionBase - from ._models_py3 import ScheduleBase - from ._models_py3 import ScheduleProperties - from ._models_py3 import ScheduleResourceArmPaginatedResult - from ._models_py3 import ScriptReference - from ._models_py3 import ScriptsToExecute - from ._models_py3 import Seasonality - from ._models_py3 import SecretConfiguration - from ._models_py3 import ServerlessComputeSettings - from ._models_py3 import ServerlessEndpoint - from ._models_py3 import ServerlessEndpointCapacityReservation - from ._models_py3 import ServerlessEndpointProperties - from ._models_py3 import ServerlessEndpointStatus - from ._models_py3 import ServerlessEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import ServerlessInferenceEndpoint - from ._models_py3 import ServerlessOffer - from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import ServiceTagDestination - from ._models_py3 import ServiceTagOutboundRule - from ._models_py3 import SetupScripts - from ._models_py3 import SharedPrivateLinkResource - from ._models_py3 import Sku - from ._models_py3 import SkuCapacity - from ._models_py3 import SkuResource - from ._models_py3 import SkuResourceArmPaginatedResult - from ._models_py3 import SkuSetting - from ._models_py3 import SparkJob - from ._models_py3 import SparkJobEntry - from ._models_py3 import SparkJobPythonEntry - from ._models_py3 import SparkJobScalaEntry - from ._models_py3 import SparkResourceConfiguration - from ._models_py3 import SpeechEndpointDeploymentResourceProperties - from ._models_py3 import SpeechEndpointResourceProperties - from ._models_py3 import SslConfiguration - from ._models_py3 import SsoSetting - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StaticInputData - from ._models_py3 import StatusMessage - from ._models_py3 import StorageAccountDetails - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SynapseSpark - from ._models_py3 import SynapseSparkProperties - from ._models_py3 import SystemCreatedAcrAccount - from ._models_py3 import SystemCreatedStorageAccount - from ._models_py3 import SystemData - from ._models_py3 import SystemService - from ._models_py3 import TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - from ._models_py3 import TableVertical - from ._models_py3 import TableVerticalFeaturizationSettings - from ._models_py3 import TableVerticalLimitSettings - from ._models_py3 import TargetLags - from ._models_py3 import TargetRollingWindowSize - from ._models_py3 import TargetUtilizationScaleSettings - from ._models_py3 import TensorFlow - from ._models_py3 import TextClassification - from ._models_py3 import TextClassificationMultilabel - from ._models_py3 import TextNer - from ._models_py3 import ThrottlingRule - from ._models_py3 import TmpfsOptions - from ._models_py3 import TopNFeaturesByAttribution - from ._models_py3 import TrackedResource - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TriggerOnceRequest - from ._models_py3 import TriggerRunSubmissionDto - from ._models_py3 import TritonInferencingServer - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UpdateWorkspaceQuotas - from ._models_py3 import UpdateWorkspaceQuotasResult - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput - from ._models_py3 import Usage - from ._models_py3 import UsageName - from ._models_py3 import UserAccountCredentials - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UserCreatedAcrAccount - from ._models_py3 import UserCreatedStorageAccount - from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties - from ._models_py3 import VirtualMachine - from ._models_py3 import VirtualMachineImage - from ._models_py3 import VirtualMachineSchema - from ._models_py3 import VirtualMachineSchemaProperties - from ._models_py3 import VirtualMachineSecrets - from ._models_py3 import VirtualMachineSecretsSchema - from ._models_py3 import VirtualMachineSize - from ._models_py3 import VirtualMachineSizeListResult - from ._models_py3 import VirtualMachineSshCredentials - from ._models_py3 import VolumeDefinition - from ._models_py3 import VolumeOptions - from ._models_py3 import Webhook - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionApiKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - from ._models_py3 import WorkspaceConnectionOAuth2 - from ._models_py3 import WorkspaceConnectionPersonalAccessToken - from ._models_py3 import WorkspaceConnectionPropertiesV2 - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult - from ._models_py3 import WorkspaceConnectionServicePrincipal - from ._models_py3 import WorkspaceConnectionSharedAccessSignature - from ._models_py3 import WorkspaceConnectionUpdateParameter - from ._models_py3 import WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceHubConfig - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspacePrivateEndpointResource - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - from ._models import AADAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountApiKeys # type: ignore - from ._models import AccountKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AccountModel # type: ignore - from ._models import AcrDetails # type: ignore - from ._models import ActualCapacityInfo # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AllFeatures # type: ignore - from ._models import AllNodes # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlComputeSchema # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlTokenComputeIdentity # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import AnonymousAccessCredential # type: ignore - from ._models import ApiKeyAuthWorkspaceConnectionProperties # type: ignore - from ._models import ArmResourceId # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoDeleteSetting # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AutologgerSettings # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureDatastore # type: ignore - from ._models import AzureDevOpsWebhook # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import AzureOpenAiFineTuning # type: ignore - from ._models import AzureOpenAiHyperParameters # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentConfiguration # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpoint # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointProperties # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchPipelineComponentDeploymentConfiguration # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CallRateLimit # type: ignore - from ._models import CapacityConfig # type: ignore - from ._models import CapacityReservationGroup # type: ignore - from ._models import CapacityReservationGroupProperties # type: ignore - from ._models import CapacityReservationGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import CategoricalDataDriftMetricThreshold # type: ignore - from ._models import CategoricalDataQualityMetricThreshold # type: ignore - from ._models import CategoricalPredictionDriftMetricThreshold # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import ClassificationModelPerformanceMetricThreshold # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainer # type: ignore - from ._models import CodeContainerProperties # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersion # type: ignore - from ._models import CodeVersionProperties # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import CognitiveServiceEndpointDeploymentResourceProperties # type: ignore - from ._models import CognitiveServicesSku # type: ignore - from ._models import Collection # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentConfiguration # type: ignore - from ._models import ComponentContainer # type: ignore - from ._models import ComponentContainerProperties # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersion # type: ignore - from ._models import ComponentVersionProperties # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceAutologgerSettings # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceContainer # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceDataDisk # type: ignore - from ._models import ComputeInstanceDataMount # type: ignore - from ._models import ComputeInstanceEnvironmentInfo # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSchema # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeInstanceVersion # type: ignore - from ._models import ComputeRecurrenceSchedule # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeResourceSchema # type: ignore - from ._models import ComputeRuntimeDto # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import ContentSafetyEndpointDeploymentResourceProperties # type: ignore - from ._models import ContentSafetyEndpointResourceProperties # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomInferencingServer # type: ignore - from ._models import CustomKeys # type: ignore - from ._models import CustomKeysWorkspaceConnectionProperties # type: ignore - from ._models import CustomMetricThreshold # type: ignore - from ._models import CustomModelFineTuning # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomMonitoringSignal # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataCollector # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataDriftMetricThresholdBase # type: ignore - from ._models import DataDriftMonitoringSignal # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataImport # type: ignore - from ._models import DataImportSource # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsSchema # type: ignore - from ._models import DataLakeAnalyticsSchemaProperties # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataQualityMetricThresholdBase # type: ignore - from ._models import DataQualityMonitoringSignal # type: ignore - from ._models import DataReferenceCredential # type: ignore - from ._models import DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import DatabaseSource # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DatabricksSchema # type: ignore - from ._models import DatasetExportSummary # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreProperties # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DeploymentModel # type: ignore - from ._models import DeploymentResourceConfiguration # type: ignore - from ._models import DestinationAsset # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import Docker # type: ignore - from ._models import DockerCredential # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultUpdateProperties # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import EncryptionUpdateProperties # type: ignore - from ._models import Endpoint # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentModel # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointDeploymentResourceProperties # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResource # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointKeys # type: ignore - from ._models import EndpointModels # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EndpointResourceProperties # type: ignore - from ._models import EndpointResourcePropertiesBasicResource # type: ignore - from ._models import EndpointResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointScheduleAction # type: ignore - from ._models import EnvironmentContainer # type: ignore - from ._models import EnvironmentContainerProperties # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVariable # type: ignore - from ._models import EnvironmentVersion # type: ignore - from ._models import EnvironmentVersionProperties # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExportSummary # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsPropertyBag # type: ignore - from ._models import Feature # type: ignore - from ._models import FeatureAttributionDriftMonitoringSignal # type: ignore - from ._models import FeatureAttributionMetricThreshold # type: ignore - from ._models import FeatureImportanceSettings # type: ignore - from ._models import FeatureProperties # type: ignore - from ._models import FeatureResourceArmPaginatedResult # type: ignore - from ._models import FeatureStoreSettings # type: ignore - from ._models import FeatureSubset # type: ignore - from ._models import FeatureWindow # type: ignore - from ._models import FeaturesetContainer # type: ignore - from ._models import FeaturesetContainerProperties # type: ignore - from ._models import FeaturesetContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # type: ignore - from ._models import FeaturesetVersionBackfillResponse # type: ignore - from ._models import FeaturesetVersionProperties # type: ignore - from ._models import FeaturesetVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityContainer # type: ignore - from ._models import FeaturestoreEntityContainerProperties # type: ignore - from ._models import FeaturestoreEntityContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityVersion # type: ignore - from ._models import FeaturestoreEntityVersionProperties # type: ignore - from ._models import FeaturestoreEntityVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FileSystemSource # type: ignore - from ._models import FineTuningJob # type: ignore - from ._models import FineTuningVertical # type: ignore - from ._models import FixedInputData # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # type: ignore - from ._models import GenerationSafetyQualityMetricThreshold # type: ignore - from ._models import GenerationSafetyQualityMonitoringSignal # type: ignore - from ._models import GenerationTokenUsageMetricThreshold # type: ignore - from ._models import GenerationTokenUsageSignal # type: ignore - from ._models import GetBlobReferenceForConsumptionDto # type: ignore - from ._models import GetBlobReferenceSASRequestDto # type: ignore - from ._models import GetBlobReferenceSASResponseDto # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import GroupStatus # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import HDInsightSchema # type: ignore - from ._models import HdfsDatastore # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import IdleShutdownSetting # type: ignore - from ._models import Image # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageMetadata # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import ImportDataAction # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferenceEndpoint # type: ignore - from ._models import InferenceEndpointProperties # type: ignore - from ._models import InferenceEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferenceGroup # type: ignore - from ._models import InferenceGroupProperties # type: ignore - from ._models import InferenceGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencePool # type: ignore - from ._models import InferencePoolProperties # type: ignore - from ._models import InferencePoolTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencingServer # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import IntellectualProperty # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobBaseProperties # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobResourceConfiguration # type: ignore - from ._models import JobScheduleAction # type: ignore - from ._models import JobService # type: ignore - from ._models import JupyterKernelConfig # type: ignore - from ._models import KerberosCredentials # type: ignore - from ._models import KerberosKeytabCredentials # type: ignore - from ._models import KerberosKeytabSecrets # type: ignore - from ._models import KerberosPasswordCredentials # type: ignore - from ._models import KerberosPasswordSecrets # type: ignore - from ._models import KeyVaultProperties # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # type: ignore - from ._models import LakeHouseArtifact # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedComputeIdentity # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedIdentityCredential # type: ignore - from ._models import ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedOnlineEndpointDeploymentResourceProperties # type: ignore - from ._models import ManagedOnlineEndpointResourceProperties # type: ignore - from ._models import ManagedResourceGroupAssignedIdentities # type: ignore - from ._models import ManagedResourceGroupSettings # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MarketplacePlan # type: ignore - from ._models import MarketplaceSubscription # type: ignore - from ._models import MarketplaceSubscriptionProperties # type: ignore - from ._models import MarketplaceSubscriptionResourceArmPaginatedResult # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelDeprecationInfo # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelPerformanceMetricThresholdBase # type: ignore - from ._models import ModelPerformanceSignal # type: ignore - from ._models import ModelSettings # type: ignore - from ._models import ModelSku # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import MonitorComputeConfigurationBase # type: ignore - from ._models import MonitorComputeIdentityBase # type: ignore - from ._models import MonitorDefinition # type: ignore - from ._models import MonitorEmailNotificationSettings # type: ignore - from ._models import MonitorNotificationSettings # type: ignore - from ._models import MonitorServerlessSparkCompute # type: ignore - from ._models import MonitoringDataSegment # type: ignore - from ._models import MonitoringFeatureFilterBase # type: ignore - from ._models import MonitoringInputDataBase # type: ignore - from ._models import MonitoringSignalBase # type: ignore - from ._models import MonitoringTarget # type: ignore - from ._models import MonitoringThreshold # type: ignore - from ._models import MonitoringWorkspaceConnection # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import Nodes # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import NotificationSetting # type: ignore - from ._models import NumericalDataDriftMetricThreshold # type: ignore - from ._models import NumericalDataQualityMetricThreshold # type: ignore - from ._models import NumericalPredictionDriftMetricThreshold # type: ignore - from ._models import OAuth2AuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import Objective # type: ignore - from ._models import OneLakeArtifact # type: ignore - from ._models import OneLakeDatastore # type: ignore - from ._models import OnlineDeployment # type: ignore - from ._models import OnlineDeploymentProperties # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpoint # type: ignore - from ._models import OnlineEndpointProperties # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineInferenceConfiguration # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OpenAIEndpointDeploymentResourceProperties # type: ignore - from ._models import OpenAIEndpointResourceProperties # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OsPatchingStatus # type: ignore - from ._models import OutboundRule # type: ignore - from ._models import OutboundRuleBasicResource # type: ignore - from ._models import OutboundRuleListResult # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialJobBase # type: ignore - from ._models import PartialJobBasePartialResource # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialMinimalTrackedResource # type: ignore - from ._models import PartialMinimalTrackedResourceWithIdentity # type: ignore - from ._models import PartialMinimalTrackedResourceWithSku # type: ignore - from ._models import PartialMinimalTrackedResourceWithSkuAndIdentity # type: ignore - from ._models import PartialNotificationSetting # type: ignore - from ._models import PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PendingUploadCredentialDto # type: ignore - from ._models import PendingUploadRequestDto # type: ignore - from ._models import PendingUploadResponseDto # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PoolEnvironmentConfiguration # type: ignore - from ._models import PoolModelConfiguration # type: ignore - from ._models import PoolStatus # type: ignore - from ._models import PredictionDriftMetricThresholdBase # type: ignore - from ._models import PredictionDriftMonitoringSignal # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointDestination # type: ignore - from ._models import PrivateEndpointOutboundRule # type: ignore - from ._models import PrivateEndpointResource # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import ProgressMetrics # type: ignore - from ._models import PropertiesBase # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QueueSettings # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RaiBlocklistConfig # type: ignore - from ._models import RaiBlocklistItemProperties # type: ignore - from ._models import RaiBlocklistItemPropertiesBasicResource # type: ignore - from ._models import RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RaiBlocklistProperties # type: ignore - from ._models import RaiBlocklistPropertiesBasicResource # type: ignore - from ._models import RaiBlocklistPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RaiPolicyContentFilter # type: ignore - from ._models import RaiPolicyProperties # type: ignore - from ._models import RaiPolicyPropertiesBasicResource # type: ignore - from ._models import RaiPolicyPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import Ray # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import RegenerateServiceAccountKeyContent # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryPartialManagedServiceIdentity # type: ignore - from ._models import RegistryPrivateEndpointConnection # type: ignore - from ._models import RegistryPrivateLinkServiceConnectionState # type: ignore - from ._models import RegistryRegionArmDetails # type: ignore - from ._models import RegistryTrackedResourceArmPaginatedResult # type: ignore - from ._models import Regression # type: ignore - from ._models import RegressionModelPerformanceMetricThreshold # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestConfiguration # type: ignore - from ._models import RequestLogging # type: ignore - from ._models import RequestMatchPattern # type: ignore - from ._models import ResizeSchema # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import RollingInputData # type: ignore - from ._models import Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import SASCredential # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import Schedule # type: ignore - from ._models import ScheduleActionBase # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import ScheduleProperties # type: ignore - from ._models import ScheduleResourceArmPaginatedResult # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import Seasonality # type: ignore - from ._models import SecretConfiguration # type: ignore - from ._models import ServerlessComputeSettings # type: ignore - from ._models import ServerlessEndpoint # type: ignore - from ._models import ServerlessEndpointCapacityReservation # type: ignore - from ._models import ServerlessEndpointProperties # type: ignore - from ._models import ServerlessEndpointStatus # type: ignore - from ._models import ServerlessEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import ServerlessInferenceEndpoint # type: ignore - from ._models import ServerlessOffer # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import ServiceTagDestination # type: ignore - from ._models import ServiceTagOutboundRule # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import SparkJob # type: ignore - from ._models import SparkJobEntry # type: ignore - from ._models import SparkJobPythonEntry # type: ignore - from ._models import SparkJobScalaEntry # type: ignore - from ._models import SparkResourceConfiguration # type: ignore - from ._models import SpeechEndpointDeploymentResourceProperties # type: ignore - from ._models import SpeechEndpointResourceProperties # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import SsoSetting # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StaticInputData # type: ignore - from ._models import StatusMessage # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemCreatedAcrAccount # type: ignore - from ._models import SystemCreatedStorageAccount # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import ThrottlingRule # type: ignore - from ._models import TmpfsOptions # type: ignore - from ._models import TopNFeaturesByAttribution # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TriggerOnceRequest # type: ignore - from ._models import TriggerRunSubmissionDto # type: ignore - from ._models import TritonInferencingServer # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserCreatedAcrAccount # type: ignore - from ._models import UserCreatedStorageAccount # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineSchema # type: ignore - from ._models import VirtualMachineSchemaProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSecretsSchema # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import VolumeDefinition # type: ignore - from ._models import VolumeOptions # type: ignore - from ._models import Webhook # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionApiKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # type: ignore - from ._models import WorkspaceConnectionOAuth2 # type: ignore - from ._models import WorkspaceConnectionPersonalAccessToken # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceConnectionServicePrincipal # type: ignore - from ._models import WorkspaceConnectionSharedAccessSignature # type: ignore - from ._models import WorkspaceConnectionUpdateParameter # type: ignore - from ._models import WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceHubConfig # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspacePrivateEndpointResource # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - ActionType, - AllocationState, - AllowedContentLevel, - ApplicationSharingPolicy, - AssetProvisioningState, - AuthMode, - AutoDeleteCondition, - AutoRebuildSetting, - Autosave, - BaseEnvironmentSourceType, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModelPerformanceMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeRecurrenceFrequency, - ComputeTriggerType, - ComputeType, - ComputeWeekDay, - ConnectionAuthType, - ConnectionCategory, - ConnectionGroup, - ContainerType, - CreatedByType, - CredentialsType, - DataAvailabilityStatus, - DataCollectionMode, - DataImportSourceType, - DataReferenceCredentialType, - DataType, - DatastoreType, - DefaultResourceProvisioningState, - DeploymentModelVersionUpgradeOption, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EndpointType, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureAttributionMetric, - FeatureDataType, - FeatureImportanceMode, - FeatureLags, - FeaturizationMode, - FineTuningTaskType, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - GenerationSafetyQualityMetric, - GenerationTokenUsageMetric, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InferencingServerType, - InputDeliveryMode, - InputPathType, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogTrainingMetrics, - LogValidationLoss, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedNetworkStatus, - ManagedServiceIdentityType, - MarketplaceSubscriptionProvisioningState, - MarketplaceSubscriptionStatus, - MaterializationStoreType, - MediaType, - MlflowAutologger, - ModelLifecycleStatus, - ModelProvider, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringModelType, - MonitoringNotificationType, - MonitoringSignalType, - MountAction, - MountMode, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - Origin, - OsType, - OutputDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - PatchStatus, - PendingUploadCredentialType, - PendingUploadType, - PoolProvisioningState, - PrivateEndpointConnectionProvisioningState, - ProtectionLevel, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RaiPolicyContentSource, - RaiPolicyMode, - RaiPolicyType, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModelPerformanceMetric, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - ScheduleType, - SeasonalityMode, - SecretsType, - ServerlessEndpointState, - ServerlessInferenceEndpointAuthMode, - ServiceAccountKeyName, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - VmPriority, - VolumeDefinitionType, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AADAuthTypeWorkspaceConnectionProperties', - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountApiKeys', - 'AccountKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AccountModel', - 'AcrDetails', - 'ActualCapacityInfo', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'AnonymousAccessCredential', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'AzureOpenAiFineTuning', - 'AzureOpenAiHyperParameters', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CallRateLimit', - 'CapacityConfig', - 'CapacityReservationGroup', - 'CapacityReservationGroupProperties', - 'CapacityReservationGroupTrackedResourceArmPaginatedResult', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'CognitiveServiceEndpointDeploymentResourceProperties', - 'CognitiveServicesSku', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentConfiguration', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeRecurrenceSchedule', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'ContentSafetyEndpointDeploymentResourceProperties', - 'ContentSafetyEndpointResourceProperties', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelFineTuning', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataReferenceCredential', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentModel', - 'DeploymentResourceConfiguration', - 'DestinationAsset', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'DockerCredential', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentModel', - 'EndpointDeploymentPropertiesBase', - 'EndpointDeploymentResourceProperties', - 'EndpointDeploymentResourcePropertiesBasicResource', - 'EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointKeys', - 'EndpointModels', - 'EndpointPropertiesBase', - 'EndpointResourceProperties', - 'EndpointResourcePropertiesBasicResource', - 'EndpointResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureImportanceSettings', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionBackfillResponse', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FineTuningJob', - 'FineTuningVertical', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GenerationSafetyQualityMetricThreshold', - 'GenerationSafetyQualityMonitoringSignal', - 'GenerationTokenUsageMetricThreshold', - 'GenerationTokenUsageSignal', - 'GetBlobReferenceForConsumptionDto', - 'GetBlobReferenceSASRequestDto', - 'GetBlobReferenceSASResponseDto', - 'GridSamplingAlgorithm', - 'GroupStatus', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferenceEndpoint', - 'InferenceEndpointProperties', - 'InferenceEndpointTrackedResourceArmPaginatedResult', - 'InferenceGroup', - 'InferenceGroupProperties', - 'InferenceGroupTrackedResourceArmPaginatedResult', - 'InferencePool', - 'InferencePoolProperties', - 'InferencePoolTrackedResourceArmPaginatedResult', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'JupyterKernelConfig', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedIdentityCredential', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedOnlineEndpointDeploymentResourceProperties', - 'ManagedOnlineEndpointResourceProperties', - 'ManagedResourceGroupAssignedIdentities', - 'ManagedResourceGroupSettings', - 'ManagedServiceIdentity', - 'MarketplacePlan', - 'MarketplaceSubscription', - 'MarketplaceSubscriptionProperties', - 'MarketplaceSubscriptionResourceArmPaginatedResult', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelDeprecationInfo', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignal', - 'ModelSettings', - 'ModelSku', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorEmailNotificationSettings', - 'MonitorNotificationSettings', - 'MonitorServerlessSparkCompute', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'MonitoringWorkspaceConnection', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'OAuth2AuthTypeWorkspaceConnectionProperties', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OpenAIEndpointDeploymentResourceProperties', - 'OpenAIEndpointResourceProperties', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OsPatchingStatus', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialMinimalTrackedResourceWithSkuAndIdentity', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PoolEnvironmentConfiguration', - 'PoolModelConfiguration', - 'PoolStatus', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PropertiesBase', - 'ProxyResource', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RaiBlocklistConfig', - 'RaiBlocklistItemProperties', - 'RaiBlocklistItemPropertiesBasicResource', - 'RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult', - 'RaiBlocklistProperties', - 'RaiBlocklistPropertiesBasicResource', - 'RaiBlocklistPropertiesBasicResourceArmPaginatedResult', - 'RaiPolicyContentFilter', - 'RaiPolicyProperties', - 'RaiPolicyPropertiesBasicResource', - 'RaiPolicyPropertiesBasicResourceArmPaginatedResult', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'RegenerateServiceAccountKeyContent', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestConfiguration', - 'RequestLogging', - 'RequestMatchPattern', - 'ResizeSchema', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'RollingInputData', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredential', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServerlessComputeSettings', - 'ServerlessEndpoint', - 'ServerlessEndpointCapacityReservation', - 'ServerlessEndpointProperties', - 'ServerlessEndpointStatus', - 'ServerlessEndpointTrackedResourceArmPaginatedResult', - 'ServerlessInferenceEndpoint', - 'ServerlessOffer', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SpeechEndpointDeploymentResourceProperties', - 'SpeechEndpointResourceProperties', - 'SslConfiguration', - 'SsoSetting', - 'StackEnsembleSettings', - 'StaticInputData', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'ThrottlingRule', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TriggerOnceRequest', - 'TriggerRunSubmissionDto', - 'TritonInferencingServer', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionOAuth2', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'ActionType', - 'AllocationState', - 'AllowedContentLevel', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AuthMode', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeRecurrenceFrequency', - 'ComputeTriggerType', - 'ComputeType', - 'ComputeWeekDay', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ConnectionGroup', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataAvailabilityStatus', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataReferenceCredentialType', - 'DataType', - 'DatastoreType', - 'DefaultResourceProvisioningState', - 'DeploymentModelVersionUpgradeOption', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EndpointType', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureImportanceMode', - 'FeatureLags', - 'FeaturizationMode', - 'FineTuningTaskType', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'GenerationSafetyQualityMetric', - 'GenerationTokenUsageMetric', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MarketplaceSubscriptionProvisioningState', - 'MarketplaceSubscriptionStatus', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelLifecycleStatus', - 'ModelProvider', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringModelType', - 'MonitoringNotificationType', - 'MonitoringSignalType', - 'MountAction', - 'MountMode', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'Origin', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PatchStatus', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PoolProvisioningState', - 'PrivateEndpointConnectionProvisioningState', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RaiPolicyContentSource', - 'RaiPolicyMode', - 'RaiPolicyType', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'ScheduleType', - 'SeasonalityMode', - 'SecretsType', - 'ServerlessEndpointState', - 'ServerlessInferenceEndpointAuthMode', - 'ServiceAccountKeyName', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 47d734897076..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,2298 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ - - INTERNAL = "Internal" - -class AllocationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class AllowedContentLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level at which content is filtered. - """ - - LOW = "Low" - MEDIUM = "Medium" - HIGH = "High" - -class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AAD = "AAD" - -class AutoDeleteCondition(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_GREATER_THAN = "CreatedGreaterThan" - LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" - -class AutoRebuildSetting(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -class BaseEnvironmentSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Base environment type. - """ - - ENVIRONMENT_ASSET = "EnvironmentAsset" - -class BatchDeploymentConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated property types for batch deployments. - """ - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - -class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class BillingCurrency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Target encoding for text data. - TEXT_TARGET_ENCODER = "TextTargetEncoder" - #: Ohe hot encoding creates a binary feature transformation. - ONE_HOT_ENCODER = "OneHotEncoder" - #: Target encoding for categorical data. - CAT_TARGET_ENCODER = "CatTargetEncoder" - #: Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - #: weighting scheme for identifying information from documents. - TF_IDF = "TfIdf" - #: Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - #: natural log of the P(1)/P(0) to create weights. - WO_E_TARGET_ENCODER = "WoETargetEncoder" - #: Label encoder converts labels/categorical variables in a numerical form. - LABEL_ENCODER = "LabelEncoder" - #: Word embedding helps represents words or phrases as a vector, or a series of numbers. - WORD_EMBEDDING = "WordEmbedding" - #: Naive Bayes is a classified that is used for classification of discrete features that are - #: categorically distributed. - NAIVE_BAYES = "NaiveBayes" - #: Count Vectorizer converts a collection of text documents to a matrix of token counts. - COUNT_VECTORIZER = "CountVectorizer" - #: Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - #: This is often used for high-cardinality categorical features. - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - -class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class ClassificationModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the accuracy of the model predictions. - ACCURACY = "Accuracy" - #: Calculates the precision of the model predictions. - PRECISION = "Precision" - #: Calculates the recall of the model predictions. - RECALL = "Recall" - -class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ClusterPurpose(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - RESIZING = "Resizing" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeRecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a compute recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ComputeTriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ComputeWeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" - -class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - ACCOUNT_KEY = "AccountKey" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - API_KEY = "ApiKey" - CUSTOM_KEYS = "CustomKeys" - O_AUTH2 = "OAuth2" - AAD = "AAD" - -class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - ADLS_GEN2 = "ADLSGen2" - REDIS = "Redis" - API_KEY = "ApiKey" - AZURE_OPEN_AI = "AzureOpenAI" - COGNITIVE_SEARCH = "CognitiveSearch" - COGNITIVE_SERVICE = "CognitiveService" - CUSTOM_KEYS = "CustomKeys" - AZURE_BLOB = "AzureBlob" - AZURE_ONE_LAKE = "AzureOneLake" - COSMOS_DB = "CosmosDb" - COSMOS_DB_MONGO_DB_API = "CosmosDbMongoDbApi" - AZURE_DATA_EXPLORER = "AzureDataExplorer" - AZURE_MARIA_DB = "AzureMariaDb" - AZURE_DATABRICKS_DELTA_LAKE = "AzureDatabricksDeltaLake" - AZURE_SQL_MI = "AzureSqlMi" - AZURE_TABLE_STORAGE = "AzureTableStorage" - AMAZON_RDS_FOR_ORACLE = "AmazonRdsForOracle" - AMAZON_RDS_FOR_SQL_SERVER = "AmazonRdsForSqlServer" - AMAZON_REDSHIFT = "AmazonRedshift" - DB2 = "Db2" - DRILL = "Drill" - GOOGLE_BIG_QUERY = "GoogleBigQuery" - GREENPLUM = "Greenplum" - HBASE = "Hbase" - HIVE = "Hive" - IMPALA = "Impala" - INFORMIX = "Informix" - MARIA_DB = "MariaDb" - MICROSOFT_ACCESS = "MicrosoftAccess" - MY_SQL = "MySql" - NETEZZA = "Netezza" - ORACLE = "Oracle" - PHOENIX = "Phoenix" - POSTGRE_SQL = "PostgreSql" - PRESTO = "Presto" - SAP_OPEN_HUB = "SapOpenHub" - SAP_BW = "SapBw" - SAP_HANA = "SapHana" - SAP_TABLE = "SapTable" - SPARK = "Spark" - SQL_SERVER = "SqlServer" - SYBASE = "Sybase" - TERADATA = "Teradata" - VERTICA = "Vertica" - CASSANDRA = "Cassandra" - COUCHBASE = "Couchbase" - MONGO_DB_V2 = "MongoDbV2" - MONGO_DB_ATLAS = "MongoDbAtlas" - AMAZON_S3_COMPATIBLE = "AmazonS3Compatible" - FILE_SERVER = "FileServer" - FTP_SERVER = "FtpServer" - GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" - HDFS = "Hdfs" - ORACLE_CLOUD_STORAGE = "OracleCloudStorage" - SFTP = "Sftp" - GENERIC_HTTP = "GenericHttp" - O_DATA_REST = "ODataRest" - ODBC = "Odbc" - GENERIC_REST = "GenericRest" - AMAZON_MWS = "AmazonMws" - CONCUR = "Concur" - DYNAMICS = "Dynamics" - DYNAMICS_AX = "DynamicsAx" - DYNAMICS_CRM = "DynamicsCrm" - GOOGLE_AD_WORDS = "GoogleAdWords" - HUBSPOT = "Hubspot" - JIRA = "Jira" - MAGENTO = "Magento" - MARKETO = "Marketo" - OFFICE365 = "Office365" - ELOQUA = "Eloqua" - RESPONSYS = "Responsys" - ORACLE_SERVICE_CLOUD = "OracleServiceCloud" - PAY_PAL = "PayPal" - QUICK_BOOKS = "QuickBooks" - SALESFORCE = "Salesforce" - SALESFORCE_SERVICE_CLOUD = "SalesforceServiceCloud" - SALESFORCE_MARKETING_CLOUD = "SalesforceMarketingCloud" - SAP_CLOUD_FOR_CUSTOMER = "SapCloudForCustomer" - SAP_ECC = "SapEcc" - SERVICE_NOW = "ServiceNow" - SHARE_POINT_ONLINE_LIST = "SharePointOnlineList" - SHOPIFY = "Shopify" - SQUARE = "Square" - WEB_TABLE = "WebTable" - XERO = "Xero" - ZOHO = "Zoho" - GENERIC_CONTAINER_REGISTRY = "GenericContainerRegistry" - OPEN_AI = "OpenAI" - SERP = "Serp" - BING_LLM_SEARCH = "BingLLMSearch" - SERVERLESS = "Serverless" - -class ConnectionGroup(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Group based on connection category - """ - - AZURE = "Azure" - AZURE_AI = "AzureAI" - DATABASE = "Database" - NO_SQL = "NoSQL" - FILE = "File" - GENERIC_PROTOCOL = "GenericProtocol" - SERVICES_AND_APPS = "ServicesAndApps" - -class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of container to retrieve logs from. - """ - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_KEYTAB = "KerberosKeytab" - KERBEROS_PASSWORD = "KerberosPassword" - -class DataAvailabilityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - PENDING = "Pending" - INCOMPLETE = "Incomplete" - COMPLETE = "Complete" - -class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataImportSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - DATABASE = "database" - FILE_SYSTEM = "file_system" - -class DataReferenceCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the DataReference credentials type. - """ - - SAS = "SAS" - DOCKER_CREDENTIALS = "DockerCredentials" - MANAGED_IDENTITY = "ManagedIdentity" - NO_CREDENTIALS = "NoCredentials" - -class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - HDFS = "Hdfs" - ONE_LAKE = "OneLake" - -class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DefaultResourceProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NOT_STARTED = "NotStarted" - FAILED = "Failed" - CREATING = "Creating" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - DELETING = "Deleting" - ACCEPTED = "Accepted" - CANCELED = "Canceled" - -class DeploymentModelVersionUpgradeOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Deployment model version upgrade option. - """ - - ONCE_NEW_DEFAULT_VERSION_AVAILABLE = "OnceNewDefaultVersionAvailable" - ONCE_CURRENT_VERSION_EXPIRED = "OnceCurrentVersionExpired" - NO_AUTO_UPGRADE = "NoAutoUpgrade" - -class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DiagnoseResultLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - RAY = "Ray" - -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EmailNotificationEnableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the email notification type. - """ - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - -class EncryptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Connection status of the service consumer with the service provider - """ - - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class EndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the endpoint. - """ - - AZURE_OPEN_AI = "Azure.OpenAI" - AZURE_SPEECH = "Azure.Speech" - AZURE_CONTENT_SAFETY = "Azure.ContentSafety" - AZURE_LLAMA = "Azure.Llama" - MANAGED_ONLINE_ENDPOINT = "managedOnlineEndpoint" - -class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class EnvironmentVariableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class ExportFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -class FeatureAttributionMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - -class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - -class FeatureImportanceMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The mode of operation for computing feature importance. - """ - - #: Disables computing feature importance within a signal. - DISABLED = "Disabled" - #: Enables computing feature importance within a signal. - ENABLED = "Enabled" - -class FeatureLags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class FineTuningTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CHAT_COMPLETION = "ChatCompletion" - TEXT_COMPLETION = "TextCompletion" - TEXT_CLASSIFICATION = "TextClassification" - QUESTION_ANSWERING = "QuestionAnswering" - TEXT_SUMMARIZATION = "TextSummarization" - TOKEN_CLASSIFICATION = "TokenClassification" - TEXT_TRANSLATION = "TextTranslation" - IMAGE_CLASSIFICATION = "ImageClassification" - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - VIDEO_MULTI_OBJECT_TRACKING = "VideoMultiObjectTracking" - -class ForecastHorizonMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - #: brief intro. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class GenerationSafetyQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation safety quality metric enum. - """ - - ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = "AcceptableGroundednessScorePerInstance" - AGGREGATED_GROUNDEDNESS_PASS_RATE = "AggregatedGroundednessPassRate" - ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = "AcceptableCoherenceScorePerInstance" - AGGREGATED_COHERENCE_PASS_RATE = "AggregatedCoherencePassRate" - ACCEPTABLE_FLUENCY_SCORE_PER_INSTANCE = "AcceptableFluencyScorePerInstance" - AGGREGATED_FLUENCY_PASS_RATE = "AggregatedFluencyPassRate" - ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = "AcceptableSimilarityScorePerInstance" - AGGREGATED_SIMILARITY_PASS_RATE = "AggregatedSimilarityPassRate" - ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = "AcceptableRelevanceScorePerInstance" - AGGREGATED_RELEVANCE_PASS_RATE = "AggregatedRelevancePassRate" - -class GenerationTokenUsageMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation token statistics metric enum. - """ - - TOTAL_TOKEN_COUNT = "TotalTokenCount" - TOTAL_TOKEN_COUNT_PER_GROUP = "TotalTokenCountPerGroup" - -class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class ImageAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - Environment images (custom and curated) - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class IncrementalDataRefresh(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether IncrementalDataRefresh is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class InferencingServerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Inferencing server type for various targets. - """ - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - -class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InputPathType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Input path type for package inputs. - """ - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - -class InstanceSegmentationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class IsolationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ - - LITERAL = "literal" - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - #: The job is in a scheduled state. Job is not in any active state. - SCHEDULED = "Scheduled" - -class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job tier. - """ - - NULL = "Null" - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - FINE_TUNING = "FineTuning" - -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LoadBalancerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class LogTrainingMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log training metrics. - ENABLE = "Enable" - #: Disable compute and log training metrics. - DISABLE = "Disable" - -class LogValidationLoss(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log validation metrics. - ENABLE = "Enable" - #: Disable compute and log validation metrics. - DISABLE = "Disable" - -class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedNetworkStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class MarketplaceSubscriptionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: MarketplaceSubscription is being created. - CREATING = "Creating" - #: MarketplaceSubscription is being deleted. - DELETING = "Deleting" - #: MarketplaceSubscription is successfully provisioned. - SUCCEEDED = "Succeeded" - #: MarketplaceSubscription provisioning failed. - FAILED = "Failed" - #: MarketplaceSubscription is being updated. - UPDATING = "Updating" - CANCELED = "Canceled" - -class MarketplaceSubscriptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Marketplace Subscription is being fulfilled. - PENDING_FULFILLMENT_START = "PendingFulfillmentStart" - #: The customer can now use the Marketplace Subscription's - #: model and will be billed. - SUBSCRIBED = "Subscribed" - #: The customer could not be billed for the Marketplace Subscription. - #: The customer will not be able to access the model. - SUSPENDED = "Suspended" - #: Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. - #: A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, - #: after being in the Suspended state for some time. - UNSUBSCRIBED = "Unsubscribed" - -class MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MediaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ModelLifecycleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model lifecycle status. - """ - - GENERALLY_AVAILABLE = "GenerallyAvailable" - PREVIEW = "Preview" - -class ModelProvider(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of fine tuning. - """ - - #: Fine tuning using Azure Open AI model. - AZURE_OPEN_AI = "AzureOpenAI" - #: Fine tuning using custom model. - CUSTOM = "Custom" - -class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class ModelTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model task type enum. - """ - - CLASSIFICATION = "Classification" - REGRESSION = "Regression" - QUESTION_ANSWERING = "QuestionAnswering" - -class MonitorComputeIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute identity type enum. - """ - - #: Authenticates through user's AML token. - AML_TOKEN = "AmlToken" - #: Authenticates through a user-provided managed identity. - MANAGED_IDENTITY = "ManagedIdentity" - -class MonitorComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute type enum. - """ - - #: Serverless Spark compute. - SERVERLESS_SPARK = "ServerlessSpark" - -class MonitoringFeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Used for features of numerical data type. - NUMERICAL = "Numerical" - #: Used for features of categorical data type. - CATEGORICAL = "Categorical" - -class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Includes all features. - ALL_FEATURES = "AllFeatures" - #: Only includes the top contributing features, measured by feature attribution. - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - #: Includes a user-defined subset of features. - FEATURE_SUBSET = "FeatureSubset" - -class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitoring input data type enum. - """ - - #: An input data with a fixed window size. - STATIC = "Static" - #: An input data which rolls relatively to the monitor's current run time. - ROLLING = "Rolling" - #: An input data with tabular format which doesn't require preprocessing. - FIXED = "Fixed" - -class MonitoringModelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: A model trained for classification tasks. - CLASSIFICATION = "Classification" - #: A model trained for regressions tasks. - REGRESSION = "Regression" - -class MonitoringNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enables email notifications through AML notifications. - AML_NOTIFICATION = "AmlNotification" - #: Enables notifications through Azure Monitor by posting metrics to the workspace's Azure Monitor - #: instance. - AZURE_MONITOR = "AzureMonitor" - -class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Tracks model input data distribution change, comparing against training data or past production - #: data. - DATA_DRIFT = "DataDrift" - #: Tracks prediction result data distribution change, comparing against validation/test label data - #: or past production data. - PREDICTION_DRIFT = "PredictionDrift" - #: Tracks model input data integrity. - DATA_QUALITY = "DataQuality" - #: Tracks feature importance change in production, comparing against feature importance at - #: training time. - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - #: Tracks a custom signal provided by users. - CUSTOM = "Custom" - #: Tracks model performance based on ground truth data. - MODEL_PERFORMANCE = "ModelPerformance" - #: Tracks the safety and quality of generated content. - GENERATION_SAFETY_QUALITY = "GenerationSafetyQuality" - #: Tracks the token usage of generative endpoints. - GENERATION_TOKEN_STATISTICS = "GenerationTokenStatistics" - -class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Mode. - """ - - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class MultiSelect(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether multiSelect is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class Network(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NlpLearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class NodesValueType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated types for the nodes value - """ - - ALL = "All" - CUSTOM = "Custom" - -class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class ObjectDetectionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OneLakeArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine OneLake artifact type. - """ - - LAKE_HOUSE = "LakeHouse" - -class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - RESIZE = "Resize" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - RESIZE_FAILED = "ResizeFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OperationTrigger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - -class OsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -class PackageBuildState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Package build state returned in package response. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class PackageInputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mounting type of the model or the inputs - """ - - COPY = "Copy" - DOWNLOAD = "Download" - -class PackageInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the inputs. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - -class PatchStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The os patching status. - """ - - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - UNKNOWN = "Unknown" - -class PendingUploadCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the PendingUpload credentials type. - """ - - SAS = "SAS" - -class PendingUploadType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of storage to use for the pending upload location - """ - - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - -class PoolProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of pool related resources provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class ProtectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protection level associated with the Intellectual Property. - """ - - #: All means Intellectual Property is fully protected. - ALL = "All" - #: None means it is not an Intellectual Property. - NONE = "None" - -class Protocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RaiPolicyContentSource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content source to apply the Content Filters. - """ - - PROMPT = "Prompt" - COMPLETION = "Completion" - -class RaiPolicyMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content Filters mode. - """ - - DEFAULT = "Default" - DEFERRED = "Deferred" - BLOCKING = "Blocking" - -class RaiPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content Filters policy type. - """ - - USER_MANAGED = "UserManaged" - SYSTEM_MANAGED = "SystemManaged" - -class RandomSamplingAlgorithmRule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Mean Absolute Error (MAE) metric. - MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" - #: The Root Mean Squared Error (RMSE) metric. - ROOT_MEAN_SQUARED_ERROR = "RootMeanSquaredError" - #: The Mean Squared Error (MSE) metric. - MEAN_SQUARED_ERROR = "MeanSquaredError" - -class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - YEAR = "Year" - MONTH = "Month" - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - -class RuleAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The action enum for networking rule. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class RuleCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - DEPENDENCY = "Dependency" - -class RuleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - IMPORT_DATA = "ImportData" - CREATE_MONITOR = "CreateMonitor" - -class ScheduleListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ScheduleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMPUTE_START_STOP = "ComputeStartStop" - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - IMPORT_DATA = "ImportData" - CREATE_MONITOR = "CreateMonitor" - FEATURE_STORE_MATERIALIZATION = "FeatureStoreMaterialization" - -class SeasonalityMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_PASSWORD = "KerberosPassword" - KERBEROS_KEYTAB = "KerberosKeytab" - -class ServerlessEndpointState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the Serverless Endpoint. - """ - - UNKNOWN = "Unknown" - CREATING = "Creating" - DELETING = "Deleting" - SUSPENDING = "Suspending" - REINSTATING = "Reinstating" - ONLINE = "Online" - SUSPENDED = "Suspended" - CREATION_FAILED = "CreationFailed" - DELETION_FAILED = "DeletionFailed" - -class ServerlessInferenceEndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY = "Key" - AAD = "AAD" - -class ServiceAccountKeyName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY1 = "Key1" - KEY2 = "Key2" - -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class StatusMessageLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class StorageAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class TextAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TrainingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Training mode dictates whether to use distributed training or not - """ - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - -class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class UseStl(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class VMPriceOSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" - -class VolumeDefinitionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WebhookType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the webhook callback service type. - """ - - AZURE_DEV_OPS = "AzureDevOps" - -class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py deleted file mode 100644 index daccee47223c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models.py +++ /dev/null @@ -1,36317 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.created_by_workspace_arm_id = None - self.expiry_time = kwargs.get('expiry_time', None) - self.group = None - self.is_shared_to_all = kwargs.get('is_shared_to_all', None) - self.metadata = kwargs.get('metadata', None) - self.shared_user_list = kwargs.get('shared_user_list', None) - self.target = kwargs.get('target', None) - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class DeploymentModel(msrest.serialization.Model): - """Properties of Cognitive Services account deployment model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - """ - super(DeploymentModel, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - self.source = kwargs.get('source', None) - self.call_rate_limit = None - - -class AccountModel(DeploymentModel): - """Cognitive Services account Model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - :ivar base_model: Base Model Identifier. - :vartype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar deprecation: Cognitive Services account ModelDeprecationInfo. - :vartype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - 'base_model': {'key': 'baseModel', 'type': 'DeploymentModel'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'skus': {'key': 'skus', 'type': '[ModelSku]'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'ModelDeprecationInfo'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword base_model: Base Model Identifier. - :paramtype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword deprecation: Cognitive Services account ModelDeprecationInfo. - :paramtype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - """ - super(AccountModel, self).__init__(**kwargs) - self.base_model = kwargs.get('base_model', None) - self.is_default_version = kwargs.get('is_default_version', None) - self.skus = kwargs.get('skus', None) - self.max_capacity = kwargs.get('max_capacity', None) - self.capabilities = kwargs.get('capabilities', None) - self.finetune_capabilities = kwargs.get('finetune_capabilities', None) - self.deprecation = kwargs.get('deprecation', None) - self.lifecycle_status = kwargs.get('lifecycle_status', None) - self.system_data = None - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar allocated: Gets or sets the total number of instances for the group. - :vartype allocated: int - :ivar assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :vartype assignment_failed: int - :ivar assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :vartype assignment_success: int - """ - - _attribute_map = { - 'allocated': {'key': 'allocated', 'type': 'int'}, - 'assignment_failed': {'key': 'assignmentFailed', 'type': 'int'}, - 'assignment_success': {'key': 'assignmentSuccess', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allocated: Gets or sets the total number of instances for the group. - :paramtype allocated: int - :keyword assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :paramtype assignment_failed: int - :keyword assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :paramtype assignment_success: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.allocated = kwargs.get('allocated', 0) - self.assignment_failed = kwargs.get('assignment_failed', 0) - self.assignment_success = kwargs.get('assignment_success', 0) - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - 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 - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = kwargs.get('condition', None) - self.value = kwargs.get('value', None) - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, FineTuningJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'FineTuning': 'FineTuningJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.secrets_configuration = kwargs.get('secrets_configuration', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class FineTuningVertical(msrest.serialization.Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOpenAiFineTuning, CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - _subtype_map = { - 'model_provider': {'AzureOpenAI': 'AzureOpenAiFineTuning', 'Custom': 'CustomModelFineTuning'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FineTuningVertical, self).__init__(**kwargs) - self.model = kwargs['model'] - self.model_provider = None # type: Optional[str] - self.task_type = kwargs['task_type'] - self.training_data = kwargs['training_data'] - self.validation_data = kwargs.get('validation_data', None) - - -class AzureOpenAiFineTuning(FineTuningVertical): - """AzureOpenAiFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': 'AzureOpenAiHyperParameters'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :paramtype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - super(AzureOpenAiFineTuning, self).__init__(**kwargs) - self.model_provider = 'AzureOpenAI' # type: str - self.hyper_parameters = kwargs.get('hyper_parameters', None) - - -class AzureOpenAiHyperParameters(msrest.serialization.Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'learning_rate_multiplier': {'key': 'learningRateMultiplier', 'type': 'float'}, - 'n_epochs': {'key': 'nEpochs', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :paramtype batch_size: int - :keyword learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning - rate may be useful to avoid over fitting. - :paramtype learning_rate_multiplier: float - :keyword n_epochs: The number of epochs to train the model for. An epoch refers to one full - cycle through the training dataset. - :paramtype n_epochs: int - """ - super(AzureOpenAiHyperParameters, self).__init__(**kwargs) - self.batch_size = kwargs.get('batch_size', None) - self.learning_rate_multiplier = kwargs.get('learning_rate_multiplier', None) - self.n_epochs = kwargs.get('n_epochs', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class CallRateLimit(msrest.serialization.Model): - """The call rate limit Cognitive Services account. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: - :vartype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: - :paramtype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - super(CallRateLimit, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.renewal_period = kwargs.get('renewal_period', None) - self.rules = kwargs.get('rules', None) - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = kwargs.get('minimum', None) - self.maximum = kwargs.get('maximum', None) - self.step = kwargs.get('step', None) - self.default = kwargs.get('default', None) - self.allowed_values = kwargs.get('allowed_values', None) - - -class CapacityReservationGroup(TrackedResource): - """CapacityReservationGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'CapacityReservationGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(CapacityReservationGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class CapacityReservationGroupProperties(msrest.serialization.Model): - """CapacityReservationGroupProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar offer: Offer used by this capacity reservation group. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :vartype reserved_capacity: int - """ - - _validation = { - 'reserved_capacity': {'required': True}, - } - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer: Offer used by this capacity reservation group. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :keyword reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :paramtype reserved_capacity: int - """ - super(CapacityReservationGroupProperties, self).__init__(**kwargs) - self.offer = kwargs.get('offer', None) - self.reserved_capacity = kwargs['reserved_capacity'] - - -class CapacityReservationGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CapacityReservationGroup entities. - - :ivar next_link: The link to the next page of CapacityReservationGroup objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CapacityReservationGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CapacityReservationGroup objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CapacityReservationGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - super(CapacityReservationGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Classification' # type: str - self.metric = kwargs['metric'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - self.training_mode = kwargs.get('training_mode', None) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentConfiguration(msrest.serialization.Model): - """Used for sweep over component. - - :ivar pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype pipeline_settings: any - """ - - _attribute_map = { - 'pipeline_settings': {'key': 'pipelineSettings', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype pipeline_settings: any - """ - super(ComponentConfiguration, self).__init__(**kwargs) - self.pipeline_settings = kwargs.get('pipeline_settings', None) - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.mount_mode = kwargs.get('mount_mode', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.enable_os_patching = kwargs.get('enable_os_patching', False) - self.enable_root_access = kwargs.get('enable_root_access', True) - self.enable_sso = kwargs.get('enable_sso', True) - self.release_quota_on_stop = kwargs.get('release_quota_on_stop', False) - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', 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) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = kwargs.get('associated_resource_id', None) - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = kwargs.get('endpoint_uri', None) - self.failure_reason = kwargs.get('failure_reason', None) - self.name = kwargs.get('name', None) - self.provisioning_state = None - self.should_create_ai_services_endpoint = kwargs.get('should_create_ai_services_endpoint', None) - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = kwargs.get('credentials', None) - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class CustomModelFineTuning(FineTuningVertical): - """CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning custom model. - :paramtype hyper_parameters: dict[str, str] - """ - super(CustomModelFineTuning, self).__init__(**kwargs) - self.model_provider = 'Custom' # type: str - self.hyper_parameters = kwargs.get('hyper_parameters', None) - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, GenerationSafetyQualityMonitoringSignal, GenerationTokenUsageSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenUsageSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = kwargs.get('notification_types', None) - self.properties = kwargs.get('properties', None) - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :ivar workspace_connection: A list of metrics to calculate and their associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :keyword workspace_connection: A list of metrics to calculate and their associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.inputs = kwargs.get('inputs', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.workspace_connection = kwargs.get('workspace_connection', None) - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) - self.kernel = kwargs.get('kernel', None) - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = kwargs.get('connection', None) - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(**kwargs) - self.source_type = 'database' # type: str - self.query = kwargs.get('query', None) - self.stored_procedure = kwargs.get('stored_procedure', None) - self.stored_procedure_params = kwargs.get('stored_procedure_params', None) - self.table_name = kwargs.get('table_name', None) - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.stage = kwargs.get('stage', None) - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = kwargs.get('asset_name', None) - self.source = kwargs.get('source', None) - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.locations = kwargs.get('locations', None) - self.max_instance_count = kwargs.get('max_instance_count', None) - self.properties = kwargs.get('properties', None) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = kwargs.get('destination_name', None) - self.destination_version = kwargs.get('destination_version', None) - self.registry_name = kwargs.get('registry_name', None) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.key_vault = kwargs.get('key_vault', None) - self.nsg = kwargs.get('nsg', None) - self.others = kwargs.get('others', None) - self.required_resource_providers = kwargs.get('required_resource_providers', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.storage_account = kwargs.get('storage_account', None) - self.udr = kwargs.get('udr', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = kwargs.get('password', None) - self.user_name = kwargs.get('user_name', None) - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) - self.status = kwargs['status'] - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - self.version = kwargs.get('version', None) - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[AccountModel]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs['feature_importance_settings'] - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.target_column = kwargs.get('target_column', None) - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = kwargs.get('data_availability_status', None) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.properties = kwargs.get('properties', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = kwargs.get('job_ids', None) - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) - self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(**kwargs) - self.source_type = 'file_system' # type: str - self.path = kwargs.get('path', None) - - -class FineTuningJob(JobBaseProperties): - """FineTuning Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar fine_tuning_details: Required. [Required]. - :vartype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'fine_tuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'fine_tuning_details': {'key': 'fineTuningDetails', 'type': 'FineTuningVertical'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword fine_tuning_details: Required. [Required]. - :paramtype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - super(FineTuningJob, self).__init__(**kwargs) - self.job_type = 'FineTuning' # type: str - self.fine_tuning_details = kwargs['fine_tuning_details'] - self.outputs = kwargs['outputs'] - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - self.data_context = kwargs.get('data_context', None) - self.input_data_type = None # type: Optional[str] - self.job_input_type = kwargs['job_input_type'] - self.uri = kwargs['uri'] - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(**kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.features_unknown_at_forecast_time = kwargs.get('features_unknown_at_forecast_time', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.status = kwargs.get('status', None) - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) - - -class GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - self.workspace_connection_id = kwargs.get('workspace_connection_id', None) - - -class GenerationTokenUsageMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenUsageMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationTokenUsageSignal(MonitoringSignalBase): - """Generation token usage signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenUsageMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenUsageSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.blob_uri = kwargs.get('blob_uri', None) - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :vartype bonus_extra_capacity: int - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :paramtype bonus_extra_capacity: int - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = kwargs.get('actual_capacity_info', None) - self.bonus_extra_capacity = kwargs.get('bonus_extra_capacity', 0) - self.endpoint_count = kwargs.get('endpoint_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - - -class SsoSetting(msrest.serialization.Model): - """Single sign-on settings of the compute instance. - - :ivar enable_sso: The value of sso settings. - :vartype enable_sso: bool - """ - - _attribute_map = { - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_sso: The value of sso settings. - :paramtype enable_sso: bool - """ - super(SsoSetting, self).__init__(**kwargs) - self.enable_sso = kwargs.get('enable_sso', True) - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) - self.version = kwargs.get('version', None) - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.log_training_metrics = kwargs.get('log_training_metrics', None) - self.log_validation_loss = kwargs.get('log_validation_loss', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = kwargs['data_import_definition'] - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_id: Required. [Required] Group within the same pool with which this endpoint needs - to be associated with. - :vartype group_id: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_id: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_id: str - """ - super(InferenceEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.endpoint_uri = None - self.group_id = kwargs['group_id'] - self.provisioning_state = None - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :vartype bonus_extra_capacity: int - :ivar metadata: Metadata for the inference group. - :vartype metadata: str - :ivar priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :vartype priority: int - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'metadata': {'key': 'metadata', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :paramtype bonus_extra_capacity: int - :keyword metadata: Metadata for the inference group. - :paramtype metadata: str - :keyword priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :paramtype priority: int - """ - super(InferenceGroupProperties, self).__init__(**kwargs) - self.bonus_extra_capacity = kwargs.get('bonus_extra_capacity', 0) - self.metadata = kwargs.get('metadata', None) - self.priority = kwargs.get('priority', 0) - self.provisioning_state = None - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar code_configuration: Code configuration for the inference pool. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar environment_configuration: EnvironmentConfiguration for the inference pool. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :ivar model_configuration: ModelConfiguration for the inference pool. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :ivar node_sku_type: Required. [Required] Compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: Request configuration for the inference pool. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'node_sku_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'PoolEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'PoolModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword code_configuration: Code configuration for the inference pool. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword environment_configuration: EnvironmentConfiguration for the inference pool. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :keyword model_configuration: ModelConfiguration for the inference pool. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :keyword node_sku_type: Required. [Required] Compute instance type. - :paramtype node_sku_type: str - :keyword request_configuration: Request configuration for the inference pool. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferencePoolProperties, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.environment_configuration = kwargs.get('environment_configuration', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.node_sku_type = kwargs['node_sku_type'] - self.provisioning_state = None - self.request_configuration = kwargs.get('request_configuration', None) - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = kwargs.get('argv', None) - self.display_name = kwargs.get('display_name', None) - self.language = kwargs.get('language', None) - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = kwargs.get('identity_client_id', None) - self.key_identifier = kwargs['key_identifier'] - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) - - -class LabelingJob(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = kwargs.get('container_registry_credentials', None) - self.notebook_access_keys = kwargs.get('notebook_access_keys', None) - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = kwargs.get('identity', None) - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = kwargs.get('managed_identity_type', None) - self.user_managed_identity_client_id = kwargs.get('user_managed_identity_client_id', None) - self.user_managed_identity_principal_id = kwargs.get('user_managed_identity_principal_id', None) - self.user_managed_identity_resource_id = kwargs.get('user_managed_identity_resource_id', None) - self.user_managed_identity_tenant_id = kwargs.get('user_managed_identity_tenant_id', None) - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = kwargs.get('spark_ready', None) - self.status = kwargs.get('status', None) - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) - self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.type = 'managedOnlineEndpoint' # type: str - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword principal_id: Identity principal Id. - :paramtype principal_id: str - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = kwargs.get('assigned_identities', None) - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The Offer ID of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The Plan ID of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The Publisher ID of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = kwargs['model_id'] - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelDeprecationInfo(msrest.serialization.Model): - """Cognitive Services account ModelDeprecationInfo. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: str - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: str - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'str'}, - 'inference': {'key': 'inference', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: str - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: str - """ - super(ModelDeprecationInfo, self).__init__(**kwargs) - self.fine_tune = kwargs.get('fine_tune', None) - self.inference = kwargs.get('inference', None) - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service which - performance will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - which performance will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(ModelPerformanceSignal, self).__init__(**kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. [Required]. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. [Required]. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = kwargs['model_id'] - - -class ModelSku(msrest.serialization.Model): - """Describes an available Cognitive Services Model SKU. - - :ivar name: The name of the model SKU. - :vartype name: str - :ivar connection_ids: The list of connection ids. - :vartype connection_ids: list[str] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar capacity: The capacity configuration. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :ivar rate_limits: The list of rateLimit. - :vartype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'connection_ids': {'key': 'connectionIds', 'type': '[str]'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'capacity': {'key': 'capacity', 'type': 'CapacityConfig'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[CallRateLimit]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword connection_ids: The list of connection ids. - :paramtype connection_ids: list[str] - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword capacity: The capacity configuration. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :keyword rate_limits: The list of rateLimit. - :paramtype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - super(ModelSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.connection_ids = kwargs.get('connection_ids', None) - self.usage_name = kwargs.get('usage_name', None) - self.deprecation_date = kwargs.get('deprecation_date', None) - self.capacity = kwargs.get('capacity', None) - self.rate_limits = kwargs.get('rate_limits', None) - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = kwargs.get('alert_notification_settings', None) - self.compute_configuration = kwargs['compute_configuration'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = kwargs.get('feature', None) - self.values = kwargs.get('values', None) - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = kwargs.get('deployment_id', None) - self.model_id = kwargs.get('model_id', None) - self.task_type = kwargs['task_type'] - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = kwargs.get('environment_variables', None) - self.secrets = kwargs.get('secrets', None) - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = kwargs.get('email_notification_settings', None) - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = kwargs['compute_identity'] - self.instance_type = kwargs['instance_type'] - self.runtime_version = kwargs['runtime_version'] - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.is_private_link_enabled = kwargs.get('is_private_link_enabled', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - self.resource_id = kwargs.get('resource_id', None) - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = kwargs.get('credentials', None) - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(OpenAIEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - 'os_patching_errors': {'key': 'osPatchingErrors', 'type': '[ErrorResponse]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - :keyword os_patching_errors: Collection of errors encountered when doing os patching. - :paramtype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = kwargs.get('patch_status', None) - self.latest_patch_time = kwargs.get('latest_patch_time', None) - self.reboot_pending = kwargs.get('reboot_pending', None) - self.scheduled_reboot_time = kwargs.get('scheduled_reboot_time', None) - self.os_patching_errors = kwargs.get('os_patching_errors', None) - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Properties can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Property dictionary. Properties can be added, removed, and updated. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.target_environment_id = kwargs['target_environment_id'] - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Tags can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'properties': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = None - self.tags = None - self.target_environment_id = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = kwargs.get('notification_setting', None) - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = kwargs.get('webhooks', None) - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) - - -class PoolEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: dict[str, str] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: dict[str, str] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(PoolEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.readiness_probe = kwargs.get('readiness_probe', None) - self.startup_probe = kwargs.get('startup_probe', None) - - -class PoolModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(PoolModelConfiguration, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - - -class PoolStatus(msrest.serialization.Model): - """PoolStatus. - - :ivar actual_capacity: Gets or sets the actual number of instances in the pool. - :vartype actual_capacity: int - :ivar group_count: Gets or sets the actual number of groups in the pool. - :vartype group_count: int - :ivar requested_capacity: Gets or sets the requested number of instances for the pool. - :vartype requested_capacity: int - :ivar reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :vartype reserved_capacity: int - """ - - _attribute_map = { - 'actual_capacity': {'key': 'actualCapacity', 'type': 'int'}, - 'group_count': {'key': 'groupCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity: Gets or sets the actual number of instances in the pool. - :paramtype actual_capacity: int - :keyword group_count: Gets or sets the actual number of groups in the pool. - :paramtype group_count: int - :keyword requested_capacity: Gets or sets the requested number of instances for the pool. - :paramtype requested_capacity: int - :keyword reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :paramtype reserved_capacity: int - """ - super(PoolStatus, self).__init__(**kwargs) - self.actual_capacity = kwargs.get('actual_capacity', 0) - self.group_count = kwargs.get('group_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - self.reserved_capacity = kwargs.get('reserved_capacity', 0) - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - self.subresource_target = kwargs.get('subresource_target', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :ivar parent_rule_name: The dependency rule name. - :vartype parent_rule_name: str - """ - - _validation = { - 'type': {'required': True}, - 'parent_rule_name': {'readonly': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - 'parent_rule_name': {'key': 'parentRuleName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) - self.parent_rule_name = None - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - self.priority = kwargs.get('priority', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class RaiBlocklistConfig(msrest.serialization.Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - _attribute_map = { - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'blocklist_name': {'key': 'blocklistName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword blocklist_name: Name of ContentFilter. - :paramtype blocklist_name: str - """ - super(RaiBlocklistConfig, self).__init__(**kwargs) - self.blocking = kwargs.get('blocking', None) - self.blocklist_name = kwargs.get('blocklist_name', None) - - -class RaiBlocklistItemProperties(msrest.serialization.Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - _attribute_map = { - 'is_regex': {'key': 'isRegex', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword is_regex: If the pattern is a regex pattern. - :paramtype is_regex: bool - :keyword pattern: Pattern to match against. - :paramtype pattern: str - """ - super(RaiBlocklistItemProperties, self).__init__(**kwargs) - self.is_regex = kwargs.get('is_regex', None) - self.pattern = kwargs.get('pattern', None) - - -class RaiBlocklistItemPropertiesBasicResource(Resource): - """RaiBlocklistItemPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist Item properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist Item properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistItemPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - super(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RaiBlocklistProperties(msrest.serialization.Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the block list. - :paramtype description: str - """ - super(RaiBlocklistProperties, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class RaiBlocklistPropertiesBasicResource(Resource): - """RaiBlocklistPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - super(RaiBlocklistPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiBlocklistPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - super(RaiBlocklistPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RaiPolicyContentFilter(msrest.serialization.Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :vartype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Possible values include: "Prompt", - "Completion". - :vartype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - - _attribute_map = { - 'allowed_content_level': {'key': 'allowedContentLevel', 'type': 'str'}, - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :paramtype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword enabled: If the ContentFilter is enabled. - :paramtype enabled: bool - :keyword name: Name of ContentFilter. - :paramtype name: str - :keyword source: Content source to apply the Content Filters. Possible values include: - "Prompt", "Completion". - :paramtype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - super(RaiPolicyContentFilter, self).__init__(**kwargs) - self.allowed_content_level = kwargs.get('allowed_content_level', None) - self.blocking = kwargs.get('blocking', None) - self.enabled = kwargs.get('enabled', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - - -class RaiPolicyProperties(msrest.serialization.Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Possible values include: "Default", "Deferred", "Blocking". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :ivar type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - :ivar prompt_blocklists: - :vartype prompt_blocklists: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - """ - - _attribute_map = { - 'base_policy_name': {'key': 'basePolicyName', 'type': 'str'}, - 'completion_blocklists': {'key': 'completionBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'content_filters': {'key': 'contentFilters', 'type': '[RaiPolicyContentFilter]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'prompt_blocklists': {'key': 'promptBlocklists', 'type': '[RaiBlocklistConfig]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_policy_name: Name of the base Content Filters. - :paramtype base_policy_name: str - :keyword completion_blocklists: - :paramtype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword content_filters: - :paramtype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :keyword mode: Content Filters mode. Possible values include: "Default", "Deferred", - "Blocking". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :keyword type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - :keyword prompt_blocklists: - :paramtype prompt_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - """ - super(RaiPolicyProperties, self).__init__(**kwargs) - self.base_policy_name = kwargs.get('base_policy_name', None) - self.completion_blocklists = kwargs.get('completion_blocklists', None) - self.content_filters = kwargs.get('content_filters', None) - self.mode = kwargs.get('mode', None) - self.type = kwargs.get('type', None) - self.prompt_blocklists = kwargs.get('prompt_blocklists', None) - - -class RaiPolicyPropertiesBasicResource(Resource): - """Azure OpenAI Content Filters resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Azure OpenAI Content Filters properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiPolicyProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Azure OpenAI Content Filters properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - super(RaiPolicyPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiPolicyPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """Azure OpenAI Content Filters resource list. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiPolicyPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - super(RaiPolicyPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = kwargs.get('address', None) - self.dashboard_port = kwargs.get('dashboard_port', None) - self.head_node_additional_args = kwargs.get('head_node_additional_args', None) - self.include_dashboard = kwargs.get('include_dashboard', None) - self.port = kwargs.get('port', None) - self.worker_node_additional_args = kwargs.get('worker_node_additional_args', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.managed_resource_group_settings = kwargs.get('managed_resource_group_settings', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.registry_private_endpoint_connections = kwargs.get('registry_private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = kwargs.get('passwords', None) - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(**kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.registry_private_link_service_connection_state = kwargs.get('registry_private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Regression' # type: str - self.metric = kwargs['metric'] - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) - - -class RequestMatchPattern(msrest.serialization.Model): - """RequestMatchPattern. - - :ivar path: - :vartype path: str - :ivar method: - :vartype method: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: - :paramtype path: str - :keyword method: - :paramtype method: str - """ - super(RequestMatchPattern, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - self.method = kwargs.get('method', None) - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = kwargs.get('target_vm_size', None) - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the trailing data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(**kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_offset = kwargs['window_offset'] - self.window_size = kwargs['window_size'] - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) - self.provisioning_state = None - self.trigger = kwargs['trigger'] - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.workspace_secret_name = kwargs.get('workspace_secret_name', None) - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = kwargs.get('serverless_compute_custom_subnet', None) - self.serverless_compute_no_public_ip = kwargs.get('serverless_compute_no_public_ip', None) - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = kwargs['capacity_reservation_group_id'] - self.endpoint_reserved_capacity = kwargs.get('endpoint_reserved_capacity', None) - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible values - include: "Key", "AAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription ARM ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar offer: The publisher-defined Serverless Offer to provision the endpoint with. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - """ - - _validation = { - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible - values include: "Key", "AAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :keyword offer: The publisher-defined Serverless Offer to provision the endpoint with. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs.get('auth_mode', None) - self.capacity_reservation = kwargs.get('capacity_reservation', None) - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = kwargs.get('model_settings', None) - self.offer = kwargs.get('offer', None) - self.provisioning_state = None - self.endpoint_state = None - - -class ServerlessEndpointStatus(msrest.serialization.Model): - """ServerlessEndpointStatus. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metrics: The model-specific metrics from the backing inference endpoint. - :vartype metrics: dict[str, str] - """ - - _validation = { - 'metrics': {'readonly': True}, - } - - _attribute_map = { - 'metrics': {'key': 'metrics', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ServerlessEndpointStatus, self).__init__(**kwargs) - self.metrics = None - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. [Required] The name of the Serverless Offer. - :vartype offer_name: str - :ivar publisher: Required. [Required] Publisher name of the Serverless Offer. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer_name: Required. [Required] The name of the Serverless Offer. - :paramtype offer_name: str - :keyword publisher: Required. [Required] Publisher name of the Serverless Offer. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = kwargs['offer_name'] - self.publisher = kwargs['publisher'] - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.address_prefixes = None - self.port_ranges = kwargs.get('port_ranges', None) - self.protocol = kwargs.get('protocol', None) - self.service_tag = kwargs.get('service_tag', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.group_id = kwargs.get('group_id', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.Speech' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(SpeechEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(**kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_end = kwargs['window_end'] - self.window_start = kwargs['window_start'] - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar component_configuration: Component Configuration for sweep over component. - :vartype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'component_configuration': {'key': 'componentConfiguration', 'type': 'ComponentConfiguration'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword component_configuration: Component Configuration for sweep over component. - :paramtype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.component_configuration = kwargs.get('component_configuration', None) - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ThrottlingRule(msrest.serialization.Model): - """ThrottlingRule. - - :ivar key: - :vartype key: str - :ivar renewal_period: - :vartype renewal_period: float - :ivar count: - :vartype count: float - :ivar min_count: - :vartype min_count: float - :ivar dynamic_throttling_enabled: - :vartype dynamic_throttling_enabled: bool - :ivar match_patterns: - :vartype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'float'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[RequestMatchPattern]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - :keyword renewal_period: - :paramtype renewal_period: float - :keyword count: - :paramtype count: float - :keyword min_count: - :paramtype min_count: float - :keyword dynamic_throttling_enabled: - :paramtype dynamic_throttling_enabled: bool - :keyword match_patterns: - :paramtype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - super(ThrottlingRule, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.renewal_period = kwargs.get('renewal_period', None) - self.count = kwargs.get('count', None) - self.min_count = kwargs.get('min_count', None) - self.dynamic_throttling_enabled = kwargs.get('dynamic_throttling_enabled', None) - self.match_patterns = kwargs.get('match_patterns', None) - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TriggerOnceRequest(msrest.serialization.Model): - """TriggerOnceRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar schedule_time: Required. [Required] Specify the schedule time for trigger once. - :vartype schedule_time: str - """ - - _validation = { - 'schedule_time': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'schedule_time': {'key': 'scheduleTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword schedule_time: Required. [Required] Specify the schedule time for trigger once. - :paramtype schedule_time: str - """ - super(TriggerOnceRequest, self).__init__(**kwargs) - self.schedule_time = kwargs['schedule_time'] - - -class TriggerRunSubmissionDto(msrest.serialization.Model): - """TriggerRunSubmissionDto. - - :ivar schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :vartype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar submission_id: - :vartype submission_id: str - """ - - _attribute_map = { - 'schedule_action_type': {'key': 'scheduleActionType', 'type': 'str'}, - 'submission_id': {'key': 'submissionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :paramtype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :keyword submission_id: - :paramtype submission_id: str - """ - super(TriggerRunSubmissionDto, self).__init__(**kwargs) - self.schedule_action_type = kwargs.get('schedule_action_type', None) - self.submission_id = kwargs.get('submission_id', None) - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.path_on_compute = kwargs.get('path_on_compute', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', None) - self.application_insights = kwargs.get('application_insights', None) - self.associated_workspaces = kwargs.get('associated_workspaces', None) - self.container_registries = kwargs.get('container_registries', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.hbi_workspace = kwargs.get('hbi_workspace', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.key_vault = kwargs.get('key_vault', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.managed_network = kwargs.get('managed_network', None) - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.service_provisioned_resource_group = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.storage_account = kwargs.get('storage_account', None) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.storage_hns_enabled = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.tenant_id = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) - self.workspace_hub_config = kwargs.get('workspace_hub_config', None) - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = kwargs.get('auth_url', None) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.developer_token = kwargs.get('developer_token', None) - self.password = kwargs.get('password', None) - self.refresh_token = kwargs.get('refresh_token', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.username = kwargs.get('username', None) - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = kwargs.get('password', None) - self.security_token = kwargs.get('security_token', None) - self.username = kwargs.get('username', None) - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = kwargs.get('additional_workspace_storage_accounts', None) - self.default_workspace_resource_group = kwargs.get('default_workspace_resource_group', None) - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.managed_network = kwargs.get('managed_network', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py deleted file mode 100644 index dcb2def94e72..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/models/_models_py3.py +++ /dev/null @@ -1,39422 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.created_by_workspace_arm_id = None - self.expiry_time = expiry_time - self.group = None - self.is_shared_to_all = is_shared_to_all - self.metadata = metadata - self.shared_user_list = shared_user_list - self.target = target - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = credentials - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - *, - key1: Optional[str] = None, - key2: Optional[str] = None, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = credentials - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class DeploymentModel(msrest.serialization.Model): - """Properties of Cognitive Services account deployment model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - version: Optional[str] = None, - source: Optional[str] = None, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - """ - super(DeploymentModel, self).__init__(**kwargs) - self.format = format - self.name = name - self.version = version - self.source = source - self.call_rate_limit = None - - -class AccountModel(DeploymentModel): - """Cognitive Services account Model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar format: Deployment model format. - :vartype format: str - :ivar name: Deployment model name. - :vartype name: str - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.machinelearningservices.models.CallRateLimit - :ivar base_model: Base Model Identifier. - :vartype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar deprecation: Cognitive Services account ModelDeprecationInfo. - :vartype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'call_rate_limit': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, - 'base_model': {'key': 'baseModel', 'type': 'DeploymentModel'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'skus': {'key': 'skus', 'type': '[ModelSku]'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'ModelDeprecationInfo'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - version: Optional[str] = None, - source: Optional[str] = None, - base_model: Optional["DeploymentModel"] = None, - is_default_version: Optional[bool] = None, - skus: Optional[List["ModelSku"]] = None, - max_capacity: Optional[int] = None, - capabilities: Optional[Dict[str, str]] = None, - finetune_capabilities: Optional[Dict[str, str]] = None, - deprecation: Optional["ModelDeprecationInfo"] = None, - lifecycle_status: Optional[Union[str, "ModelLifecycleStatus"]] = None, - **kwargs - ): - """ - :keyword format: Deployment model format. - :paramtype format: str - :keyword name: Deployment model name. - :paramtype name: str - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword base_model: Base Model Identifier. - :paramtype base_model: ~azure.mgmt.machinelearningservices.models.DeploymentModel - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.ModelSku] - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword deprecation: Cognitive Services account ModelDeprecationInfo. - :paramtype deprecation: ~azure.mgmt.machinelearningservices.models.ModelDeprecationInfo - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - """ - super(AccountModel, self).__init__(format=format, name=name, version=version, source=source, **kwargs) - self.base_model = base_model - self.is_default_version = is_default_version - self.skus = skus - self.max_capacity = max_capacity - self.capabilities = capabilities - self.finetune_capabilities = finetune_capabilities - self.deprecation = deprecation - self.lifecycle_status = lifecycle_status - self.system_data = None - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - *, - system_created_acr_account: Optional["SystemCreatedAcrAccount"] = None, - user_created_acr_account: Optional["UserCreatedAcrAccount"] = None, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = system_created_acr_account - self.user_created_acr_account = user_created_acr_account - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar allocated: Gets or sets the total number of instances for the group. - :vartype allocated: int - :ivar assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :vartype assignment_failed: int - :ivar assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :vartype assignment_success: int - """ - - _attribute_map = { - 'allocated': {'key': 'allocated', 'type': 'int'}, - 'assignment_failed': {'key': 'assignmentFailed', 'type': 'int'}, - 'assignment_success': {'key': 'assignmentSuccess', 'type': 'int'}, - } - - def __init__( - self, - *, - allocated: Optional[int] = 0, - assignment_failed: Optional[int] = 0, - assignment_success: Optional[int] = 0, - **kwargs - ): - """ - :keyword allocated: Gets or sets the total number of instances for the group. - :paramtype allocated: int - :keyword assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :paramtype assignment_failed: int - :keyword assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :paramtype assignment_success: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.allocated = allocated - self.assignment_failed = assignment_failed - self.assignment_success = assignment_success - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = properties - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = properties - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - property_bag: Optional[Any] = None, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - self.property_bag = property_bag - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionApiKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = credentials - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = resource_id - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.auto_delete_setting = auto_delete_setting - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - condition: Optional[Union[str, "AutoDeleteCondition"]] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = condition - self.value = value - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, FineTuningJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'FineTuning': 'FineTuningJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = notification_setting - self.secrets_configuration = secrets_configuration - self.services = services - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.task_type = None # type: Optional[str] - self.training_data = training_data - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = event_type - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = code_configuration - - -class FineTuningVertical(msrest.serialization.Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOpenAiFineTuning, CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - _subtype_map = { - 'model_provider': {'AzureOpenAI': 'AzureOpenAiFineTuning', 'Custom': 'CustomModelFineTuning'} - } - - def __init__( - self, - *, - model: "MLFlowModelJobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FineTuningVertical, self).__init__(**kwargs) - self.model = model - self.model_provider = None # type: Optional[str] - self.task_type = task_type - self.training_data = training_data - self.validation_data = validation_data - - -class AzureOpenAiFineTuning(FineTuningVertical): - """AzureOpenAiFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': 'AzureOpenAiHyperParameters'}, - } - - def __init__( - self, - *, - model: "MLFlowModelJobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - hyper_parameters: Optional["AzureOpenAiHyperParameters"] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :paramtype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - super(AzureOpenAiFineTuning, self).__init__(model=model, task_type=task_type, training_data=training_data, validation_data=validation_data, **kwargs) - self.model_provider = 'AzureOpenAI' # type: str - self.hyper_parameters = hyper_parameters - - -class AzureOpenAiHyperParameters(msrest.serialization.Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'learning_rate_multiplier': {'key': 'learningRateMultiplier', 'type': 'float'}, - 'n_epochs': {'key': 'nEpochs', 'type': 'int'}, - } - - def __init__( - self, - *, - batch_size: Optional[int] = None, - learning_rate_multiplier: Optional[float] = None, - n_epochs: Optional[int] = None, - **kwargs - ): - """ - :keyword batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :paramtype batch_size: int - :keyword learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning - rate may be useful to avoid over fitting. - :paramtype learning_rate_multiplier: float - :keyword n_epochs: The number of epochs to train the model for. An epoch refers to one full - cycle through the training dataset. - :paramtype n_epochs: int - """ - super(AzureOpenAiHyperParameters, self).__init__(**kwargs) - self.batch_size = batch_size - self.learning_rate_multiplier = learning_rate_multiplier - self.n_epochs = n_epochs - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = resource_id - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["DeploymentResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.deployment_configuration = deployment_configuration - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - component_id: Optional["IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = component_id - self.description = description - self.settings = settings - self.tags = tags - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = propagation - self.create_host_path = create_host_path - self.selinux = selinux - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class CallRateLimit(msrest.serialization.Model): - """The call rate limit Cognitive Services account. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: - :vartype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, - } - - def __init__( - self, - *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[List["ThrottlingRule"]] = None, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: - :paramtype rules: list[~azure.mgmt.machinelearningservices.models.ThrottlingRule] - """ - super(CallRateLimit, self).__init__(**kwargs) - self.count = count - self.renewal_period = renewal_period - self.rules = rules - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - *, - minimum: Optional[int] = None, - maximum: Optional[int] = None, - step: Optional[int] = None, - default: Optional[int] = None, - allowed_values: Optional[List[int]] = None, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = minimum - self.maximum = maximum - self.step = step - self.default = default - self.allowed_values = allowed_values - - -class CapacityReservationGroup(TrackedResource): - """CapacityReservationGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'CapacityReservationGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "CapacityReservationGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(CapacityReservationGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class CapacityReservationGroupProperties(msrest.serialization.Model): - """CapacityReservationGroupProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar offer: Offer used by this capacity reservation group. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :vartype reserved_capacity: int - """ - - _validation = { - 'reserved_capacity': {'required': True}, - } - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - reserved_capacity: int, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword offer: Offer used by this capacity reservation group. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :keyword reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :paramtype reserved_capacity: int - """ - super(CapacityReservationGroupProperties, self).__init__(**kwargs) - self.offer = offer - self.reserved_capacity = reserved_capacity - - -class CapacityReservationGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CapacityReservationGroup entities. - - :ivar next_link: The link to the next page of CapacityReservationGroup objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CapacityReservationGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CapacityReservationGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CapacityReservationGroup objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CapacityReservationGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - super(CapacityReservationGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["ClassificationTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = threshold - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "ClassificationModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Classification' # type: str - self.metric = metric - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - self.training_mode = training_mode - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[str] = None, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = 1, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = client_id - self.data_collection_mode = data_collection_mode - self.data_id = data_id - self.sampling_rate = sampling_rate - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.queue_settings = queue_settings - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentConfiguration(msrest.serialization.Model): - """Used for sweep over component. - - :ivar pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype pipeline_settings: any - """ - - _attribute_map = { - 'pipeline_settings': {'key': 'pipelineSettings', 'type': 'object'}, - } - - def __init__( - self, - *, - pipeline_settings: Optional[Any] = None, - **kwargs - ): - """ - :keyword pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype pipeline_settings: any - """ - super(ComponentConfiguration, self).__init__(**kwargs) - self.pipeline_settings = pipeline_settings - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - self.stage = stage - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "Network"]] = None, - environment: Optional["ComputeInstanceEnvironmentInfo"] = None, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = name - self.autosave = autosave - self.gpu = gpu - self.network = network - self.environment = environment - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - caching: Optional[Union[str, "Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = caching - self.disk_size_gb = disk_size_gb - self.lun = lun - self.storage_account_type = storage_account_type - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "MountAction"]] = None, - mount_mode: Optional[Union[str, "MountMode"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = source - self.source_type = source_type - self.mount_name = mount_name - self.mount_action = mount_action - self.mount_mode = mount_mode - self.created_by = created_by - self.mount_path = mount_path - self.mount_state = mount_state - self.mounted_on = mounted_on - self.error = error - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = name - self.version = version - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "OperationTrigger"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - self.operation_trigger = operation_trigger - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - enable_os_patching: Optional[bool] = False, - enable_root_access: Optional[bool] = True, - enable_sso: Optional[bool] = True, - release_quota_on_stop: Optional[bool] = False, - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.autologger_settings = autologger_settings - self.ssh_settings = ssh_settings - self.custom_services = custom_services - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.enable_os_patching = enable_os_patching - self.enable_root_access = enable_root_access - self.enable_sso = enable_sso - self.release_quota_on_stop = release_quota_on_stop - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - self.idle_time_before_shutdown = idle_time_before_shutdown - self.enable_node_public_ip = enable_node_public_ip - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = runtime - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "ComputeWeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = spark_runtime_version - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "ComputeTriggerType"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - schedule: Optional["ScheduleBase"] = None, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.action = action - self.trigger_type = trigger_type - self.recurrence = recurrence - self.cron = cron - self.schedule = schedule - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = failure_reason - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties'} - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = associated_resource_id - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = endpoint_uri - self.failure_reason = failure_reason - self.name = name - self.provisioning_state = None - self.should_create_ai_services_endpoint = should_create_ai_services_endpoint - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = monitor_definition - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - *, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = end_time - self.start_time = start_time - self.time_zone = time_zone - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = expression - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = inference_configuration - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - *, - keys: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = keys - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["CustomKeys"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = credentials - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: str, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class CustomModelFineTuning(FineTuningVertical): - """CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - } - - def __init__( - self, - *, - model: "MLFlowModelJobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - hyper_parameters: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning custom model. - :paramtype hyper_parameters: dict[str, str] - """ - super(CustomModelFineTuning, self).__init__(model=model, task_type=task_type, training_data=training_data, validation_data=validation_data, **kwargs) - self.model_provider = 'Custom' # type: str - self.hyper_parameters = hyper_parameters - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'custom_model' # type: str - self.description = description - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, GenerationSafetyQualityMonitoringSignal, GenerationTokenUsageSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenUsageSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = notification_types - self.properties = properties - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :ivar workspace_connection: A list of metrics to calculate and their associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - input_assets: Optional[Dict[str, "MonitoringInputDataBase"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - workspace_connection: Optional["MonitoringWorkspaceConnection"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :keyword workspace_connection: A list of metrics to calculate and their associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = component_id - self.input_assets = input_assets - self.inputs = inputs - self.metric_thresholds = metric_thresholds - self.workspace_connection = workspace_connection - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - name: Optional[str] = None, - image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, - docker: Optional["Docker"] = None, - endpoints: Optional[List["Endpoint"]] = None, - volumes: Optional[List["VolumeDefinition"]] = None, - kernel: Optional["JupyterKernelConfig"] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.image = image - self.environment_variables = environment_variables - self.docker = docker - self.endpoints = endpoints - self.volumes = volumes - self.kernel = kernel - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - *, - connection: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = connection - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - query: Optional[str] = None, - stored_procedure: Optional[str] = None, - stored_procedure_params: Optional[List[Dict[str, str]]] = None, - table_name: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'database' # type: str - self.query = query - self.stored_procedure = stored_procedure - self.stored_procedure_params = stored_procedure_params - self.table_name = table_name - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = properties - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - *, - collections: Dict[str, "Collection"], - request_logging: Optional["RequestLogging"] = None, - rolling_rate: Optional[Union[str, "RollingRateType"]] = None, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = collections - self.request_logging = request_logging - self.rolling_rate = rolling_rate - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = data_segment - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - self.intellectual_property = intellectual_property - self.stage = stage - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - asset_name: Optional[str] = None, - source: Optional["DataImportSource"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = asset_name - self.source = source - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = properties - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataQualityMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Datastore"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.locations = locations - self.max_instance_count = max_instance_count - self.properties = properties - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - *, - destination_name: Optional[str] = None, - destination_version: Optional[str] = None, - registry_name: Optional[str] = None, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = destination_name - self.destination_version = destination_version - self.registry_name = registry_name - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - *, - application_insights: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - required_resource_providers: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - udr: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = application_insights - self.container_registry = container_registry - self.dns_resolution = dns_resolution - self.key_vault = key_vault - self.nsg = nsg - self.others = others - self.required_resource_providers = required_resource_providers - self.resource_lock = resource_lock - self.storage_account = storage_account - self.udr = udr - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - privileged: Optional[bool] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.privileged = privileged - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - user_name: Optional[str] = None, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = password - self.user_name = user_name - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_properties: "KeyVaultProperties", - status: Union[str, "EncryptionStatus"], - cosmos_db_resource_id: Optional[str] = None, - identity: Optional["IdentityForCmk"] = None, - search_account_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = cosmos_db_resource_id - self.identity = identity - self.key_vault_properties = key_vault_properties - self.search_account_resource_id = search_account_resource_id - self.status = status - self.storage_account_resource_id = storage_account_resource_id - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - *, - key_vault_properties: "EncryptionKeyVaultUpdateProperties", - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = key_vault_properties - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "Protocol"]] = "tcp", - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = protocol - self.name = name - self.target = target - self.published = published - self.host_ip = host_ip - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - source: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = format - self.name = name - self.source = source - self.version = version - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointDeploymentResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - *, - keys: Optional["AccountApiKeys"] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = keys - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[AccountModel]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["AccountModel"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AccountModel] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = endpoint_invocation_definition - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "EnvironmentVariableType"]] = "local", - value: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.value = value - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - auto_rebuild: Optional[Union[str, "AutoRebuildSetting"]] = None, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.auto_rebuild = auto_rebuild - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.intellectual_property = intellectual_property - self.os_type = os_type - self.provisioning_state = None - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpointsPropertyBag"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = properties - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - feature_importance_settings: "FeatureImportanceSettings", - metric_threshold: "FeatureAttributionMetricThreshold", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "FeatureAttributionMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "FeatureImportanceMode"]] = None, - target_column: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = mode - self.target_column = target_column - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - feature_name: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.data_type = data_type - self.feature_name = feature_name - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Feature"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = path - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - data_availability_status: Optional[List[Union[str, "DataAvailabilityStatus"]]] = None, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = data_availability_status - self.description = description - self.display_name = display_name - self.feature_window = feature_window - self.job_id = job_id - self.properties = properties - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - job_ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = job_ids - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - entities: Optional[List[str]] = None, - materialization_settings: Optional["MaterializationSettings"] = None, - specification: Optional["FeaturesetSpecification"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.entities = entities - self.materialization_settings = materialization_settings - self.provisioning_state = None - self.specification = specification - self.stage = stage - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - index_columns: Optional[List["IndexColumn"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.index_columns = index_columns - self.provisioning_state = None - self.stage = stage - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = compute_runtime - self.offline_store_connection_name = offline_store_connection_name - self.online_store_connection_name = online_store_connection_name - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - *, - features: List[str], - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = features - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = feature_window_end - self.feature_window_start = feature_window_start - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'file_system' # type: str - self.path = path - - -class FineTuningJob(JobBaseProperties): - """FineTuning Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar fine_tuning_details: Required. [Required]. - :vartype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'fine_tuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'fine_tuning_details': {'key': 'fineTuningDetails', 'type': 'FineTuningVertical'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - } - - def __init__( - self, - *, - fine_tuning_details: "FineTuningVertical", - outputs: Dict[str, "JobOutput"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword fine_tuning_details: Required. [Required]. - :paramtype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - """ - super(FineTuningJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'FineTuning' # type: str - self.fine_tuning_details = fine_tuning_details - self.outputs = outputs - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = columns - self.data_context = data_context - self.input_data_type = None # type: Optional[str] - self.job_input_type = job_input_type - self.uri = uri - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["ForecastingTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - features_unknown_at_forecast_time: Optional[List[str]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.features_unknown_at_forecast_time = features_unknown_at_forecast_time - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpoints"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = category - self.status = status - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -class GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "GenerationSafetyQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationSafetyQualityMetricThreshold"], - sampling_rate: float, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - workspace_connection_id: Optional[str] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - self.workspace_connection_id = workspace_connection_id - - -class GenerationTokenUsageMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "GenerationTokenUsageMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenUsageMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationTokenUsageSignal(MonitoringSignalBase): - """Generation token usage signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenUsageMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationTokenUsageMetricThreshold"], - sampling_rate: float, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenUsageSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["DataReferenceCredential"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - blob_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = asset_id - self.blob_uri = blob_uri - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["GetBlobReferenceForConsumptionDto"] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :vartype bonus_extra_capacity: int - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity_info: Optional["ActualCapacityInfo"] = None, - bonus_extra_capacity: Optional[int] = 0, - endpoint_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :paramtype bonus_extra_capacity: int - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = actual_capacity_info - self.bonus_extra_capacity = bonus_extra_capacity - self.endpoint_count = endpoint_count - self.requested_capacity = requested_capacity - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - name_node_address: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - hdfs_server_certificate: Optional[str] = None, - protocol: Optional[str] = "http", - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = hdfs_server_certificate - self.name_node_address = name_node_address - self.protocol = protocol - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = properties - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = idle_time_before_shutdown - - -class SsoSetting(msrest.serialization.Model): - """Single sign-on settings of the compute instance. - - :ivar enable_sso: The value of sso settings. - :vartype enable_sso: bool - """ - - _attribute_map = { - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - } - - def __init__( - self, - *, - enable_sso: Optional[bool] = True, - **kwargs - ): - """ - :keyword enable_sso: The value of sso settings. - :paramtype enable_sso: bool - """ - super(SsoSetting, self).__init__(**kwargs) - self.enable_sso = enable_sso - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - self.version = version - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = current_image_version - self.latest_image_version = latest_image_version - self.is_latest_os_image_version = is_latest_os_image_version - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_model = checkpoint_model - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - log_training_metrics: Optional[Union[str, "LogTrainingMetrics"]] = None, - log_validation_loss: Optional[Union[str, "LogValidationLoss"]] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.log_training_metrics = log_training_metrics - self.log_validation_loss = log_validation_loss - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - *, - data_import_definition: "DataImport", - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = data_import_definition - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = column_name - self.data_type = data_type - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_id: Required. [Required] Group within the same pool with which this endpoint needs - to be associated with. - :vartype group_id: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "AuthMode"], - group_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_id: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_id: str - """ - super(InferenceEndpointProperties, self).__init__(description=description, properties=properties, **kwargs) - self.auth_mode = auth_mode - self.endpoint_uri = None - self.group_id = group_id - self.provisioning_state = None - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :vartype bonus_extra_capacity: int - :ivar metadata: Metadata for the inference group. - :vartype metadata: str - :ivar priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :vartype priority: int - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'metadata': {'key': 'metadata', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - bonus_extra_capacity: Optional[int] = 0, - metadata: Optional[str] = None, - priority: Optional[int] = 0, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :paramtype bonus_extra_capacity: int - :keyword metadata: Metadata for the inference group. - :paramtype metadata: str - :keyword priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20240101Preview.Pools.InferencePools. - :paramtype priority: int - """ - super(InferenceGroupProperties, self).__init__(description=description, properties=properties, **kwargs) - self.bonus_extra_capacity = bonus_extra_capacity - self.metadata = metadata - self.priority = priority - self.provisioning_state = None - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferencePoolProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar code_configuration: Code configuration for the inference pool. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar environment_configuration: EnvironmentConfiguration for the inference pool. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :ivar model_configuration: ModelConfiguration for the inference pool. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :ivar node_sku_type: Required. [Required] Compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: Request configuration for the inference pool. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'node_sku_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'PoolEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'PoolModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - *, - node_sku_type: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - code_configuration: Optional["CodeConfiguration"] = None, - environment_configuration: Optional["PoolEnvironmentConfiguration"] = None, - model_configuration: Optional["PoolModelConfiguration"] = None, - request_configuration: Optional["RequestConfiguration"] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword code_configuration: Code configuration for the inference pool. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword environment_configuration: EnvironmentConfiguration for the inference pool. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :keyword model_configuration: ModelConfiguration for the inference pool. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :keyword node_sku_type: Required. [Required] Compute instance type. - :paramtype node_sku_type: str - :keyword request_configuration: Request configuration for the inference pool. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferencePoolProperties, self).__init__(description=description, properties=properties, **kwargs) - self.code_configuration = code_configuration - self.environment_configuration = environment_configuration - self.model_configuration = model_configuration - self.node_sku_type = node_sku_type - self.provisioning_state = None - self.request_configuration = request_configuration - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferencePool"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - publisher: str, - protection_level: Optional[Union[str, "ProtectionLevel"]] = None, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = protection_level - self.publisher = publisher - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - docker_args: Optional[str] = None, - shm_size: Optional[str] = "2g", - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - self.docker_args = docker_args - self.shm_size = shm_size - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = job_definition - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["Nodes"] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.nodes = nodes - self.port = port - self.properties = properties - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - argv: Optional[List[str]] = None, - display_name: Optional[str] = None, - language: Optional[str] = None, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = argv - self.display_name = display_name - self.language = language - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosKeytabSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kerberos_keytab - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosPasswordSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kerberos_password - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - key_vault_arm_id: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = identity_client_id - self.key_identifier = key_identifier - self.key_vault_arm_id = key_vault_arm_id - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.data_collector = data_collector - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - *, - container_registry_credentials: Optional["RegistryListCredentialsResult"] = None, - notebook_access_keys: Optional["ListNotebookKeysResult"] = None, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = container_registry_credentials - self.notebook_access_keys = notebook_access_keys - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str - self.value = value - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = identity - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - managed_identity_type: Optional[str] = None, - user_managed_identity_client_id: Optional[str] = None, - user_managed_identity_principal_id: Optional[str] = None, - user_managed_identity_resource_id: Optional[str] = None, - user_managed_identity_tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = managed_identity_type - self.user_managed_identity_client_id = user_managed_identity_client_id - self.user_managed_identity_principal_id = user_managed_identity_principal_id - self.user_managed_identity_resource_id = user_managed_identity_resource_id - self.user_managed_identity_tenant_id = user_managed_identity_tenant_id - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = include_spark - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_ready: Optional[bool] = None, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = spark_ready - self.status = status - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - *, - isolation_mode: Optional[Union[str, "IsolationMode"]] = None, - outbound_rules: Optional[Dict[str, "OutboundRule"]] = None, - status: Optional["ManagedNetworkProvisionStatus"] = None, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = isolation_mode - self.network_id = None - self.outbound_rules = outbound_rules - self.status = status - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, **kwargs) - self.type = 'managedOnlineEndpoint' # type: str - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - *, - principal_id: Optional[str] = None, - **kwargs - ): - """ - :keyword principal_id: Identity principal Id. - :paramtype principal_id: str - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = principal_id - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - *, - assigned_identities: Optional[List["ManagedResourceGroupAssignedIdentities"]] = None, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = assigned_identities - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The Offer ID of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The Plan ID of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The Publisher ID of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - *, - properties: "MarketplaceSubscriptionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = properties - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = model_id - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["MarketplaceSubscription"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = instance_type - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - *, - notification: Optional["NotificationSetting"] = None, - resource: Optional["MaterializationComputeResource"] = None, - schedule: Optional["RecurrenceTrigger"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "MaterializationStoreType"]] = None, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = notification - self.resource = resource - self.schedule = schedule - self.spark_configuration = spark_configuration - self.store_type = store_type - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'mlflow_model' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'mlflow_model' # type: str - self.description = description - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'mltable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelDeprecationInfo(msrest.serialization.Model): - """Cognitive Services account ModelDeprecationInfo. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: str - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: str - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'str'}, - 'inference': {'key': 'inference', 'type': 'str'}, - } - - def __init__( - self, - *, - fine_tune: Optional[str] = None, - inference: Optional[str] = None, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: str - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: str - """ - super(ModelDeprecationInfo, self).__init__(**kwargs) - self.fine_tune = fine_tune - self.inference = inference - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service which - performance will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_threshold: "ModelPerformanceMetricThresholdBase", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - which performance will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(ModelPerformanceSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = data_segment - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. [Required]. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. [Required]. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = model_id - - -class ModelSku(msrest.serialization.Model): - """Describes an available Cognitive Services Model SKU. - - :ivar name: The name of the model SKU. - :vartype name: str - :ivar connection_ids: The list of connection ids. - :vartype connection_ids: list[str] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar capacity: The capacity configuration. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :ivar rate_limits: The list of rateLimit. - :vartype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'connection_ids': {'key': 'connectionIds', 'type': '[str]'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'capacity': {'key': 'capacity', 'type': 'CapacityConfig'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[CallRateLimit]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - connection_ids: Optional[List[str]] = None, - usage_name: Optional[str] = None, - deprecation_date: Optional[datetime.datetime] = None, - capacity: Optional["CapacityConfig"] = None, - rate_limits: Optional[List["CallRateLimit"]] = None, - **kwargs - ): - """ - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword connection_ids: The list of connection ids. - :paramtype connection_ids: list[str] - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword capacity: The capacity configuration. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.CapacityConfig - :keyword rate_limits: The list of rateLimit. - :paramtype rate_limits: list[~azure.mgmt.machinelearningservices.models.CallRateLimit] - """ - super(ModelSku, self).__init__(**kwargs) - self.name = name - self.connection_ids = connection_ids - self.usage_name = usage_name - self.deprecation_date = deprecation_date - self.capacity = capacity - self.rate_limits = rate_limits - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.intellectual_property = intellectual_property - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.provisioning_state = None - self.stage = stage - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - *, - compute_configuration: "MonitorComputeConfigurationBase", - signals: Dict[str, "MonitoringSignalBase"], - alert_notification_settings: Optional["MonitorNotificationSettings"] = None, - monitoring_target: Optional["MonitoringTarget"] = None, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = alert_notification_settings - self.compute_configuration = compute_configuration - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - *, - emails: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = emails - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - *, - feature: Optional[str] = None, - values: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = feature - self.values = values - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - *, - task_type: Union[str, "ModelTaskType"], - deployment_id: Optional[str] = None, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = deployment_id - self.model_id = model_id - self.task_type = task_type - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = value - - -class MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - *, - environment_variables: Optional[Dict[str, str]] = None, - secrets: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = environment_variables - self.secrets = secrets - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - *, - email_notification_settings: Optional["MonitorEmailNotificationSettings"] = None, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = email_notification_settings - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_identity: "MonitorComputeIdentityBase", - instance_type: str, - runtime_version: str, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = compute_identity - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - is_private_link_enabled: Optional[bool] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.is_private_link_enabled = is_private_link_enabled - self.notebook_preparation_error = notebook_preparation_error - self.resource_id = resource_id - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - self.webhooks = webhooks - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionOAuth2"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = credentials - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - artifact: "OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = artifact - self.endpoint = endpoint - self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(OpenAIEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - 'os_patching_errors': {'key': 'osPatchingErrors', 'type': '[ErrorResponse]'}, - } - - def __init__( - self, - *, - patch_status: Optional[Union[str, "PatchStatus"]] = None, - latest_patch_time: Optional[str] = None, - reboot_pending: Optional[bool] = None, - scheduled_reboot_time: Optional[str] = None, - os_patching_errors: Optional[List["ErrorResponse"]] = None, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - :keyword os_patching_errors: Collection of errors encountered when doing os patching. - :paramtype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = patch_status - self.latest_patch_time = latest_patch_time - self.reboot_pending = reboot_pending - self.scheduled_reboot_time = scheduled_reboot_time - self.os_patching_errors = os_patching_errors - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OutboundRuleBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_name: Optional[str] = None, - resource_version: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Properties can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_id: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Property dictionary. Properties can be added, removed, and updated. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.properties = properties - self.tags = tags - self.target_environment_id = target_environment_id - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Tags can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'properties': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = None - self.tags = None - self.target_environment_id = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = description - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Optional["PartialBatchDeployment"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - *, - notification_setting: Optional["PartialNotificationSetting"] = None, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = notification_setting - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - *, - properties: Optional["PartialJobBase"] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = properties - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = tags - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) - self.sku = sku - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - self.sku = sku - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = webhooks - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["RegistryPartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - self.source_job_id = source_job_id - - -class PoolEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: dict[str, str] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - *, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - liveness_probe: Optional["ProbeSettings"] = None, - readiness_probe: Optional["ProbeSettings"] = None, - startup_probe: Optional["ProbeSettings"] = None, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: dict[str, str] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(PoolEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = environment_id - self.environment_variables = environment_variables - self.liveness_probe = liveness_probe - self.readiness_probe = readiness_probe - self.startup_probe = startup_probe - - -class PoolModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(PoolModelConfiguration, self).__init__(**kwargs) - self.model_id = model_id - - -class PoolStatus(msrest.serialization.Model): - """PoolStatus. - - :ivar actual_capacity: Gets or sets the actual number of instances in the pool. - :vartype actual_capacity: int - :ivar group_count: Gets or sets the actual number of groups in the pool. - :vartype group_count: int - :ivar requested_capacity: Gets or sets the requested number of instances for the pool. - :vartype requested_capacity: int - :ivar reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :vartype reserved_capacity: int - """ - - _attribute_map = { - 'actual_capacity': {'key': 'actualCapacity', 'type': 'int'}, - 'group_count': {'key': 'groupCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity: Optional[int] = 0, - group_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - reserved_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity: Gets or sets the actual number of instances in the pool. - :paramtype actual_capacity: int - :keyword group_count: Gets or sets the actual number of groups in the pool. - :paramtype group_count: int - :keyword requested_capacity: Gets or sets the requested number of instances for the pool. - :paramtype requested_capacity: int - :keyword reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :paramtype reserved_capacity: int - """ - super(PoolStatus, self).__init__(**kwargs) - self.actual_capacity = actual_capacity - self.group_count = group_count - self.requested_capacity = requested_capacity - self.reserved_capacity = reserved_capacity - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - private_endpoint: Optional["WorkspacePrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[Union[str, "PrivateEndpointConnectionProvisioningState"]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - subresource_target: Optional[str] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.spark_enabled = spark_enabled - self.spark_status = spark_status - self.subresource_target = subresource_target - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :ivar parent_rule_name: The dependency rule name. - :vartype parent_rule_name: str - """ - - _validation = { - 'type': {'required': True}, - 'parent_rule_name': {'readonly': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - 'parent_rule_name': {'key': 'parentRuleName', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - self.parent_rule_name = None - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = subnet_arm_id - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - group_id: Optional[str] = None, - required_members: Optional[List[str]] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.group_id = group_id - self.required_members = required_members - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - priority: Optional[int] = None, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - self.priority = priority - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class RaiBlocklistConfig(msrest.serialization.Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - _attribute_map = { - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'blocklist_name': {'key': 'blocklistName', 'type': 'str'}, - } - - def __init__( - self, - *, - blocking: Optional[bool] = None, - blocklist_name: Optional[str] = None, - **kwargs - ): - """ - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword blocklist_name: Name of ContentFilter. - :paramtype blocklist_name: str - """ - super(RaiBlocklistConfig, self).__init__(**kwargs) - self.blocking = blocking - self.blocklist_name = blocklist_name - - -class RaiBlocklistItemProperties(msrest.serialization.Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - _attribute_map = { - 'is_regex': {'key': 'isRegex', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__( - self, - *, - is_regex: Optional[bool] = None, - pattern: Optional[str] = None, - **kwargs - ): - """ - :keyword is_regex: If the pattern is a regex pattern. - :paramtype is_regex: bool - :keyword pattern: Pattern to match against. - :paramtype pattern: str - """ - super(RaiBlocklistItemProperties, self).__init__(**kwargs) - self.is_regex = is_regex - self.pattern = pattern - - -class RaiBlocklistItemPropertiesBasicResource(Resource): - """RaiBlocklistItemPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist Item properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - *, - properties: "RaiBlocklistItemProperties", - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist Item properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistItemPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiBlocklistItemPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - super(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RaiBlocklistProperties(msrest.serialization.Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the block list. - :paramtype description: str - """ - super(RaiBlocklistProperties, self).__init__(**kwargs) - self.description = description - - -class RaiBlocklistPropertiesBasicResource(Resource): - """RaiBlocklistPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistProperties'}, - } - - def __init__( - self, - *, - properties: "RaiBlocklistProperties", - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - super(RaiBlocklistPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiBlocklistPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiBlocklistPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - super(RaiBlocklistPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RaiPolicyContentFilter(msrest.serialization.Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :vartype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Possible values include: "Prompt", - "Completion". - :vartype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - - _attribute_map = { - 'allowed_content_level': {'key': 'allowedContentLevel', 'type': 'str'}, - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - *, - allowed_content_level: Optional[Union[str, "AllowedContentLevel"]] = None, - blocking: Optional[bool] = None, - enabled: Optional[bool] = None, - name: Optional[str] = None, - source: Optional[Union[str, "RaiPolicyContentSource"]] = None, - **kwargs - ): - """ - :keyword allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :paramtype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword enabled: If the ContentFilter is enabled. - :paramtype enabled: bool - :keyword name: Name of ContentFilter. - :paramtype name: str - :keyword source: Content source to apply the Content Filters. Possible values include: - "Prompt", "Completion". - :paramtype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - super(RaiPolicyContentFilter, self).__init__(**kwargs) - self.allowed_content_level = allowed_content_level - self.blocking = blocking - self.enabled = enabled - self.name = name - self.source = source - - -class RaiPolicyProperties(msrest.serialization.Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Possible values include: "Default", "Deferred", "Blocking". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :ivar type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - :ivar prompt_blocklists: - :vartype prompt_blocklists: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - """ - - _attribute_map = { - 'base_policy_name': {'key': 'basePolicyName', 'type': 'str'}, - 'completion_blocklists': {'key': 'completionBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'content_filters': {'key': 'contentFilters', 'type': '[RaiPolicyContentFilter]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'prompt_blocklists': {'key': 'promptBlocklists', 'type': '[RaiBlocklistConfig]'}, - } - - def __init__( - self, - *, - base_policy_name: Optional[str] = None, - completion_blocklists: Optional[List["RaiBlocklistConfig"]] = None, - content_filters: Optional[List["RaiPolicyContentFilter"]] = None, - mode: Optional[Union[str, "RaiPolicyMode"]] = None, - type: Optional[Union[str, "RaiPolicyType"]] = None, - prompt_blocklists: Optional[List["RaiBlocklistConfig"]] = None, - **kwargs - ): - """ - :keyword base_policy_name: Name of the base Content Filters. - :paramtype base_policy_name: str - :keyword completion_blocklists: - :paramtype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword content_filters: - :paramtype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :keyword mode: Content Filters mode. Possible values include: "Default", "Deferred", - "Blocking". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :keyword type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - :keyword prompt_blocklists: - :paramtype prompt_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - """ - super(RaiPolicyProperties, self).__init__(**kwargs) - self.base_policy_name = base_policy_name - self.completion_blocklists = completion_blocklists - self.content_filters = content_filters - self.mode = mode - self.type = type - self.prompt_blocklists = prompt_blocklists - - -class RaiPolicyPropertiesBasicResource(Resource): - """Azure OpenAI Content Filters resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Azure OpenAI Content Filters properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiPolicyProperties'}, - } - - def __init__( - self, - *, - properties: "RaiPolicyProperties", - **kwargs - ): - """ - :keyword properties: Required. Azure OpenAI Content Filters properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - super(RaiPolicyPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiPolicyPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """Azure OpenAI Content Filters resource list. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiPolicyPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiPolicyPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - super(RaiPolicyPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = logbase - self.rule = rule - self.seed = seed - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - *, - address: Optional[str] = None, - dashboard_port: Optional[int] = None, - head_node_additional_args: Optional[str] = None, - include_dashboard: Optional[bool] = None, - port: Optional[int] = None, - worker_node_additional_args: Optional[str] = None, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = address - self.dashboard_port = dashboard_port - self.head_node_additional_args = head_node_additional_args - self.include_dashboard = include_dashboard - self.port = port - self.worker_node_additional_args = worker_node_additional_args - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "ComputeRecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["ComputeRecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "WeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.schedule = schedule - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - *, - key_name: Optional[Union[str, "ServiceAccountKeyName"]] = None, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = key_name - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - managed_resource_group_settings: Optional["ManagedResourceGroupSettings"] = None, - ml_flow_registry_uri: Optional[str] = None, - registry_private_endpoint_connections: Optional[List["RegistryPrivateEndpointConnection"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.sku = sku - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.managed_resource_group_settings = managed_resource_group_settings - self.ml_flow_registry_uri = ml_flow_registry_uri - self.registry_private_endpoint_connections = registry_private_endpoint_connections - self.public_network_access = public_network_access - self.region_details = region_details - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = passwords - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - group_ids: Optional[List[str]] = None, - private_endpoint: Optional["PrivateEndpointResource"] = None, - registry_private_link_service_connection_state: Optional["RegistryPrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = id - self.location = location - self.group_ids = group_ids - self.private_endpoint = private_endpoint - self.registry_private_link_service_connection_state = registry_private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - *, - acr_details: Optional[List["AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = acr_details - self.location = location - self.storage_account_details = storage_account_details - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Registry"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - training_settings: Optional["RegressionTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "RegressionModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Regression' # type: str - self.metric = metric - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.request_timeout = request_timeout - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = capture_headers - - -class RequestMatchPattern(msrest.serialization.Model): - """RequestMatchPattern. - - :ivar path: - :vartype path: str - :ivar method: - :vartype method: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - method: Optional[str] = None, - **kwargs - ): - """ - :keyword path: - :paramtype path: str - :keyword method: - :paramtype method: str - """ - super(RequestMatchPattern, self).__init__(**kwargs) - self.path = path - self.method = method - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - *, - target_vm_size: Optional[str] = None, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = target_vm_size - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the trailing data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_offset: datetime.timedelta, - window_size: datetime.timedelta, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_offset = window_offset - self.window_size = window_size - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = properties - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "ScheduleStatus"]] = None, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = id - self.provisioning_status = provisioning_status - self.status = status - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - *, - action: "ScheduleActionBase", - trigger: "TriggerBase", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = True, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.action = action - self.display_name = display_name - self.is_enabled = is_enabled - self.provisioning_state = None - self.trigger = trigger - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Schedule"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - workspace_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = uri - self.workspace_secret_name = workspace_secret_name - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - *, - serverless_compute_custom_subnet: Optional[str] = None, - serverless_compute_no_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = serverless_compute_custom_subnet - self.serverless_compute_no_public_ip = serverless_compute_no_public_ip - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "ServerlessEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - capacity_reservation_group_id: str, - endpoint_reserved_capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = capacity_reservation_group_id - self.endpoint_reserved_capacity = endpoint_reserved_capacity - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible values - include: "Key", "AAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription ARM ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar offer: The publisher-defined Serverless Offer to provision the endpoint with. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - """ - - _validation = { - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Optional[Union[str, "ServerlessInferenceEndpointAuthMode"]] = None, - capacity_reservation: Optional["ServerlessEndpointCapacityReservation"] = None, - model_settings: Optional["ModelSettings"] = None, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible - values include: "Key", "AAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :keyword offer: The publisher-defined Serverless Offer to provision the endpoint with. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.capacity_reservation = capacity_reservation - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = model_settings - self.offer = offer - self.provisioning_state = None - self.endpoint_state = None - - -class ServerlessEndpointStatus(msrest.serialization.Model): - """ServerlessEndpointStatus. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metrics: The model-specific metrics from the backing inference endpoint. - :vartype metrics: dict[str, str] - """ - - _validation = { - 'metrics': {'readonly': True}, - } - - _attribute_map = { - 'metrics': {'key': 'metrics', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ServerlessEndpointStatus, self).__init__(**kwargs) - self.metrics = None - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ServerlessEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. [Required] The name of the Serverless Offer. - :vartype offer_name: str - :ivar publisher: Required. [Required] Publisher name of the Serverless Offer. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - offer_name: str, - publisher: str, - **kwargs - ): - """ - :keyword offer_name: Required. [Required] The name of the Serverless Offer. - :paramtype offer_name: str - :keyword publisher: Required. [Required] Publisher name of the Serverless Offer. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = offer_name - self.publisher = publisher - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - *, - action: Optional[Union[str, "RuleAction"]] = None, - port_ranges: Optional[str] = None, - protocol: Optional[str] = None, - service_tag: Optional[str] = None, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = action - self.address_prefixes = None - self.port_ranges = port_ranges - self.protocol = protocol - self.service_tag = service_tag - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'ServiceTag' # type: str - self.destination = destination - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - group_id: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.group_id = group_id - self.private_link_resource_id = private_link_resource_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - *, - code_id: str, - entry: "SparkJobEntry", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - archives: Optional[List[str]] = None, - args: Optional[str] = None, - conf: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - files: Optional[List[str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jars: Optional[List[str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - py_files: Optional[List[str]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["SparkResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Spark' # type: str - self.archives = archives - self.args = args - self.code_id = code_id - self.conf = conf - self.entry = entry - self.environment_id = environment_id - self.environment_variables = environment_variables - self.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - self.queue_settings = queue_settings - self.resources = resources - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - *, - file: str, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = file - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - *, - class_name: str, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = class_name - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = "3.1", - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9._]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.Speech' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(SpeechEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, endpoint_uri=endpoint_uri, failure_reason=failure_reason, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_end: datetime.datetime, - window_start: datetime.datetime, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_end = window_end - self.window_start = window_start - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = system_created_storage_account - self.user_created_storage_account = user_created_storage_account - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark", - "FineTuning". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar component_configuration: Component Configuration for sweep over component. - :vartype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'component_configuration': {'key': 'componentConfiguration', 'type': 'ComponentConfiguration'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - component_configuration: Optional["ComponentConfiguration"] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword component_configuration: Component Configuration for sweep over component. - :paramtype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.component_configuration = component_configuration - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = acr_account_name - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = allow_blob_public_access - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_name = storage_account_name - self.storage_account_type = storage_account_type - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ThrottlingRule(msrest.serialization.Model): - """ThrottlingRule. - - :ivar key: - :vartype key: str - :ivar renewal_period: - :vartype renewal_period: float - :ivar count: - :vartype count: float - :ivar min_count: - :vartype min_count: float - :ivar dynamic_throttling_enabled: - :vartype dynamic_throttling_enabled: bool - :ivar match_patterns: - :vartype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'float'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[RequestMatchPattern]'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - renewal_period: Optional[float] = None, - count: Optional[float] = None, - min_count: Optional[float] = None, - dynamic_throttling_enabled: Optional[bool] = None, - match_patterns: Optional[List["RequestMatchPattern"]] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - :keyword renewal_period: - :paramtype renewal_period: float - :keyword count: - :paramtype count: float - :keyword min_count: - :paramtype min_count: float - :keyword dynamic_throttling_enabled: - :paramtype dynamic_throttling_enabled: bool - :keyword match_patterns: - :paramtype match_patterns: list[~azure.mgmt.machinelearningservices.models.RequestMatchPattern] - """ - super(ThrottlingRule, self).__init__(**kwargs) - self.key = key - self.renewal_period = renewal_period - self.count = count - self.min_count = min_count - self.dynamic_throttling_enabled = dynamic_throttling_enabled - self.match_patterns = match_patterns - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = size - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = top - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TriggerOnceRequest(msrest.serialization.Model): - """TriggerOnceRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar schedule_time: Required. [Required] Specify the schedule time for trigger once. - :vartype schedule_time: str - """ - - _validation = { - 'schedule_time': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'schedule_time': {'key': 'scheduleTime', 'type': 'str'}, - } - - def __init__( - self, - *, - schedule_time: str, - **kwargs - ): - """ - :keyword schedule_time: Required. [Required] Specify the schedule time for trigger once. - :paramtype schedule_time: str - """ - super(TriggerOnceRequest, self).__init__(**kwargs) - self.schedule_time = schedule_time - - -class TriggerRunSubmissionDto(msrest.serialization.Model): - """TriggerRunSubmissionDto. - - :ivar schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :vartype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar submission_id: - :vartype submission_id: str - """ - - _attribute_map = { - 'schedule_action_type': {'key': 'scheduleActionType', 'type': 'str'}, - 'submission_id': {'key': 'submissionId', 'type': 'str'}, - } - - def __init__( - self, - *, - schedule_action_type: Optional[Union[str, "ScheduleType"]] = None, - submission_id: Optional[str] = None, - **kwargs - ): - """ - :keyword schedule_action_type: Possible values include: "ComputeStartStop", "CreateJob", - "InvokeBatchEndpoint", "ImportData", "CreateMonitor", "FeatureStoreMaterialization". - :paramtype schedule_action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :keyword submission_id: - :paramtype submission_id: str - """ - super(TriggerRunSubmissionDto, self).__init__(**kwargs) - self.schedule_action_type = schedule_action_type - self.submission_id = submission_id - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = inference_configuration - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'triton_model' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'triton_model' # type: str - self.description = description - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'uri_file' # type: str - self.description = description - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'uri_file' # type: str - self.description = description - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar path_on_compute: Input Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword path_on_compute: Input Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_input_type = 'uri_folder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar path_on_compute: Output Asset Delivery Path. - :vartype path_on_compute: str - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - path_on_compute: Optional[str] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword path_on_compute: Output Asset Delivery Path. - :paramtype path_on_compute: str - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, path_on_compute=path_on_compute, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.path_on_compute = path_on_compute - self.uri = uri - self.job_output_type = 'uri_folder' # type: str - self.description = description - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, shared_user_list=shared_user_list, target=target, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = properties - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.notebook_server_port = notebook_server_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = administrator_account - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) - self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "VolumeDefinitionType"]] = "bind", - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["BindOptions"] = None, - volume: Optional["VolumeOptions"] = None, - tmpfs: Optional["TmpfsOptions"] = None, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = type - self.read_only = read_only - self.source = source - self.target = target - self.consistency = consistency - self.bind = bind - self.volume = volume - self.tmpfs = tmpfs - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = nocopy - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_public_access_when_behind_vnet: Optional[bool] = None, - application_insights: Optional[str] = None, - associated_workspaces: Optional[List[str]] = None, - container_registries: Optional[List[str]] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - discovery_url: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionProperty"] = None, - existing_workspaces: Optional[List[str]] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - hbi_workspace: Optional[bool] = None, - hub_resource_id: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - key_vault: Optional[str] = None, - key_vaults: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - soft_delete_retention_in_days: Optional[int] = None, - storage_account: Optional[str] = None, - storage_accounts: Optional[List[str]] = None, - system_datastores_auth_mode: Optional[str] = None, - v1_legacy_mode: Optional[bool] = None, - workspace_hub_config: Optional["WorkspaceHubConfig"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.sku = sku - self.tags = tags - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.application_insights = application_insights - self.associated_workspaces = associated_workspaces - self.container_registries = container_registries - self.container_registry = container_registry - self.description = description - self.discovery_url = discovery_url - self.enable_data_isolation = enable_data_isolation - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.existing_workspaces = existing_workspaces - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.hbi_workspace = hbi_workspace - self.hub_resource_id = hub_resource_id - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.key_vault = key_vault - self.key_vaults = key_vaults - self.managed_network = managed_network - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = primary_user_assigned_identity - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.service_provisioned_resource_group = None - self.shared_private_link_resources = shared_private_link_resources - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.storage_account = storage_account - self.storage_accounts = storage_accounts - self.storage_hns_enabled = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.tenant_id = None - self.v1_legacy_mode = v1_legacy_mode - self.workspace_hub_config = workspace_hub_config - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = access_key_id - self.secret_access_key = secret_access_key - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = client_id - self.resource_id = resource_id - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_url: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - developer_token: Optional[str] = None, - password: Optional[str] = None, - refresh_token: Optional[str] = None, - tenant_id: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = auth_url - self.client_id = client_id - self.client_secret = client_secret - self.developer_token = developer_token - self.password = password - self.refresh_token = refresh_token - self.tenant_id = tenant_id - self.username = username - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: Optional["WorkspaceConnectionPropertiesV2"] = None, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - security_token: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = password - self.security_token = security_token - self.username = username - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_workspace_storage_accounts: Optional[List[str]] = None, - default_workspace_resource_group: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = additional_workspace_storage_accounts - self.default_workspace_resource_group = default_workspace_resource_group - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Workspace"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - v1_legacy_mode: Optional[bool] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - self.application_insights = application_insights - self.container_registry = container_registry - self.description = description - self.enable_data_isolation = enable_data_isolation - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.managed_network = managed_network - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.v1_legacy_mode = v1_legacy_mode diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/__init__.py deleted file mode 100644 index a7b6d64ab9dd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/__init__.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._connection_operations import ConnectionOperations -from ._connection_rai_blocklists_operations import ConnectionRaiBlocklistsOperations -from ._connection_rai_blocklist_operations import ConnectionRaiBlocklistOperations -from ._connection_rai_blocklist_item_operations import ConnectionRaiBlocklistItemOperations -from ._connection_rai_blocklist_items_operations import ConnectionRaiBlocklistItemsOperations -from ._connection_rai_policies_operations import ConnectionRaiPoliciesOperations -from ._connection_rai_policy_operations import ConnectionRaiPolicyOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._rai_policies_operations import RaiPoliciesOperations -from ._rai_policy_operations import RaiPolicyOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'CapacityReservationGroupsOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'MarketplaceSubscriptionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ConnectionOperations', - 'ConnectionRaiBlocklistsOperations', - 'ConnectionRaiBlocklistOperations', - 'ConnectionRaiBlocklistItemOperations', - 'ConnectionRaiBlocklistItemsOperations', - 'ConnectionRaiPoliciesOperations', - 'ConnectionRaiPolicyOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'RaiPoliciesOperations', - 'RaiPolicyOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 2ff4ef8e615b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,876 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index 48a07cdf3583..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_capacity_reservation_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_capacity_reservation_groups_operations.py deleted file mode 100644 index b58383564bf5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_capacity_reservation_groups_operations.py +++ /dev/null @@ -1,714 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups") # 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) - - # Construct parameters - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups") # 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) - - # Construct parameters - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CapacityReservationGroupsOperations(object): - """CapacityReservationGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - """List CapacityReservationGroups by subscription. - - List CapacityReservationGroups by subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - """Lists CapacityReservationGroups. - - Lists CapacityReservationGroups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete CapacityReservationGroup. - - Delete CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """Get CapacityReservationGroup. - - Get CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - group_id, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """Update CapacityReservationGroup. - - Update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to update. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - group_id, # type: str - body, # type: "_models.CapacityReservationGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """Create or update CapacityReservationGroup. - - Create or update CapacityReservationGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: Group ID. - :type group_id: str - :param body: Capacity Reservation Group payload to create. - :type body: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapacityReservationGroup') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index da7e1c4aaa31..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index 298d4cc33723..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,872 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - hash = kwargs.pop('hash', None) # type: Optional[str] - hash_version = kwargs.pop('hash_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if hash is not None: - _query_parameters['hash'] = _SERIALIZER.query("hash", hash, 'str') - if hash_version is not None: - _query_parameters['hashVersion'] = _SERIALIZER.query("hash_version", hash_version, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - hash=None, # type: Optional[str] - hash_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 1aea62f4ed34..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 3dd1f4d67b5f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,750 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_compute_operations.py deleted file mode 100644 index 9c127f8a14fa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,2210 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_custom_services_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_data_mounts_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_idle_shutdown_setting_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_sso_settings_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/enableSso") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_allowed_resize_sizes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resize_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): # pylint: disable=too-many-public-methods - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - custom_services, # type: List["_models.CustomService"] - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace - def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - data_mounts, # type: List["_models.ComputeInstanceDataMount"] - **kwargs # type: Any - ): - # type: (...) -> None - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace - def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace - def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace - def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.IdleShutdownSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def update_sso_settings( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.SsoSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Update single sign-on settings of the compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating sso setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.SsoSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'SsoSetting') - - request = build_update_sso_settings_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_sso_settings.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_sso_settings.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/enableSso"} # type: ignore - - - @distributed_trace - def get_allowed_resize_sizes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace - def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_operations.py deleted file mode 100644 index 09a0515e6ada..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_operations.py +++ /dev/null @@ -1,785 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_deployments_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_deployment_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_deployment_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_deployment_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class ConnectionOperations(object): - """ConnectionOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_deployments( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_deployments.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_deployments.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments"} # type: ignore - - def _delete_deployment_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete_deployment( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_deployment( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_deployment_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get_deployment.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_deployment_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update_deployment( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_item_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_item_operations.py deleted file mode 100644 index 148a888c8eef..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_item_operations.py +++ /dev/null @@ -1,537 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistItemOperations(object): - """ConnectionRaiBlocklistItemOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistPropertiesBasicResource" - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - body, # type: "_models.RaiBlocklistItemPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistItemPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistItemPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - body, # type: "_models.RaiBlocklistItemPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiBlocklistItemPropertiesBasicResource"] - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiBlocklistItemPropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_items_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_items_operations.py deleted file mode 100644 index 3690c7ce4f32..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_items_operations.py +++ /dev/null @@ -1,192 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistItemsOperations(object): - """ConnectionRaiBlocklistItemsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_operations.py deleted file mode 100644 index 2fb020bedda3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklist_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistOperations(object): - """ConnectionRaiBlocklistOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: "_models.RaiBlocklistPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: "_models.RaiBlocklistPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiBlocklistPropertiesBasicResource"] - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiBlocklistPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistItemPropertiesBasicResource" - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistItemPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklists_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklists_operations.py deleted file mode 100644 index 5b8f3bad0ccc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_blocklists_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistsOperations(object): - """ConnectionRaiBlocklistsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policies_operations.py deleted file mode 100644 index 88714c1517f6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policies_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class ConnectionRaiPoliciesOperations(object): - """ConnectionRaiPoliciesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policy_operations.py deleted file mode 100644 index 35f5e9dc7c21..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_connection_rai_policy_operations.py +++ /dev/null @@ -1,521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiPolicyOperations(object): - """ConnectionRaiPolicyOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiPolicyPropertiesBasicResource"] - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiPolicyPropertiesBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 084c5d313415..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index 8e4817ecc482..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,762 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param stage: data stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 6129a09face8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - _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') - if order_by is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Datastore" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_deployment_operations.py deleted file mode 100644 index 8c3fb1bd3041..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,801 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_in_workspace_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointDeploymentOperations(object): - """EndpointDeploymentOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_operations.py deleted file mode 100644 index e419d4e8b10c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_endpoint_operations.py +++ /dev/null @@ -1,851 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - include_inference_endpoints = kwargs.pop('include_inference_endpoints', False) # type: Optional[bool] - skip = kwargs.pop('skip', None) # type: Optional[str] - expand = kwargs.pop('expand', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if include_inference_endpoints is not None: - _query_parameters['includeInferenceEndpoints'] = _SERIALIZER.query("include_inference_endpoints", include_inference_endpoints, 'bool') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if expand is not None: - _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_regenerate_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointOperations(object): - """EndpointOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - include_inference_endpoints=False, # type: Optional[bool] - skip=None, # type: Optional[str] - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param include_inference_endpoints: - :type include_inference_endpoints: bool - :param skip: Continuation token for pagination. - :type skip: str - :param expand: Whether the endpoint resource will be expand to include deployment information, - e.g. $expand=deployments. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointResourcePropertiesBasicResource" - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointResourcePropertiesBasicResource"] - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointResourcePropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointKeys" - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace - def regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateServiceAccountKeyContent" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountApiKeys" - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index e3a26a3f295e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index ea2935e4994a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,751 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_features_operations.py deleted file mode 100644 index 226a167b32f6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,359 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - feature_name = kwargs.pop('feature_name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 1000) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if feature_name is not None: - _query_parameters['featureName'] = _SERIALIZER.query("feature_name", feature_name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - "featureName": _SERIALIZER.url("feature_name", feature_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - feature_name=None, # type: Optional[str] - description=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=1000, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureResourceArmPaginatedResult"] - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :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 - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Feature" - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index c862b3e5168c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetContainersOperations(object): - """FeaturesetContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 8ebc387eed3c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,924 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_backfill_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetVersionsOperations(object): - """FeaturesetVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - def _backfill_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.FeaturesetVersionBackfillResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace - def begin_backfill( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersionBackfillResponse"] - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersionBackfillResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 316316706d46..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityContainersOperations(object): - """FeaturestoreEntityContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 46dc20680cd8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityVersionsOperations(object): - """FeaturestoreEntityVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_endpoints_operations.py deleted file mode 100644 index c13394d7bcb0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,894 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceEndpointsOperations(object): - """InferenceEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_groups_operations.py deleted file mode 100644 index f9fc75203edd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_groups_operations.py +++ /dev/null @@ -1,1159 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceGroupsOperations(object): - """InferenceGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceGroup"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.GroupStatus" - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_pools_operations.py deleted file mode 100644 index 802693572cd4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_inference_pools_operations.py +++ /dev/null @@ -1,1108 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferencePoolsOperations(object): - """InferencePoolsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferencePoolTrackedResourceArmPaginatedResult"] - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferencePool"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PoolStatus" - """Retrieve inference pool status. - - Retrieve inference pool status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PoolStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PoolStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PoolStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PoolStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Pool Skus. - - List Inference Pool Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Inference Group name. - :type inference_pool_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 0ebac1071a39..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,905 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - properties = kwargs.pop('properties', None) # type: Optional[str] - asset_name = kwargs.pop('asset_name', None) # type: Optional[str] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - _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') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if asset_name is not None: - _query_parameters['assetName'] = _SERIALIZER.query("asset_name", asset_name, 'str') - if scheduled is not None: - _query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') - if schedule_id is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_cancel_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - properties=None, # type: Optional[str] - asset_name=None, # type: Optional[str] - scheduled=None, # type: Optional[bool] - schedule_id=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.PartialJobBasePartialResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index 8f7d28f8e04d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1045 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_export_labels_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_pause_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resume_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def pause( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJobProperties" - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJobProperties, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.LabelingJobProperties"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LabelingJobProperties"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace - def begin_resume( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJobProperties"] - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJobProperties or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJobProperties] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 9fc981289abf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_provision_managed_network_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkProvisionsOperations(object): - """ManagedNetworkProvisionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _provision_managed_network_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 3fb20f6d0e23..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,629 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkSettingsRuleOperations(object): - """ManagedNetworkSettingsRuleOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundRuleListResult"] - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OutboundRuleBasicResource" - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OutboundRuleBasicResource"] - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OutboundRuleBasicResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index 49caecff3984..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class MarketplaceSubscriptionsOperations(object): - """MarketplaceSubscriptionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MarketplaceSubscription"] - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either MarketplaceSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index e514e5fc01db..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index 157068136d7a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,992 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :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 - :param stage: Model stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - def _package_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index b8e991e044dc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index cae69ba4576a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_operations.py deleted file mode 100644 index 46be02ba5bd7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 0c2635b83fe7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,501 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - body, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.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/v2024_04_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index d0559bc42c79..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,190 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateLinkResourceListResult"] - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - 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/v2024_04_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_quotas_operations.py deleted file mode 100644 index b3dfad9b4e76..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policies_operations.py deleted file mode 100644 index 5c088e21da95..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policies_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class RaiPoliciesOperations(object): - """RaiPoliciesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policy_operations.py deleted file mode 100644 index 4a10aa7d9a1a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_rai_policy_operations.py +++ /dev/null @@ -1,521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RaiPolicyOperations(object): - """RaiPolicyOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiPolicyPropertiesBasicResource"] - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiPolicyPropertiesBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registries_operations.py deleted file mode 100644 index 408b2e780c9a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_remove_regions_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") # 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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistriesOperations(object): - """RegistriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _remove_regions_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 38288bf442c8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,636 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeContainersOperations(object): - """RegistryCodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeContainer"] - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 2f248b0b71c2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,802 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeVersionsOperations(object): - """RegistryCodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index 7564421c436c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentContainersOperations(object): - """RegistryComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index d90736025cda..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentVersionsOperations(object): - """RegistryComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index a13f90ae89c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataContainersOperations(object): - """RegistryDataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_references_operations.py deleted file mode 100644 index e2eeab9a55a3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,174 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_blob_reference_sas_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataReferencesOperations(object): - """RegistryDataReferencesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_blob_reference_sas( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.GetBlobReferenceSASRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.GetBlobReferenceSASResponseDto" - """Get blob reference SAS Uri value. - - Get blob reference SAS Uri value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index b44f01414804..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataVersionsOperations(object): - """RegistryDataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataVersionBase"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 114f490c1cd8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentContainersOperations(object): - """RegistryEnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 438dc99499bc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,699 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentVersionsOperations(object): - """RegistryEnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 225455f3141e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelContainersOperations(object): - """RegistryModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainer"] - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index 918a061de4dc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,1036 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelVersionsOperations(object): - """RegistryModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - def _package_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_schedules_operations.py deleted file mode 100644 index b22e1ba5412b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,758 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ScheduleListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_trigger_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SchedulesOperations(object): - """SchedulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ScheduleListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ScheduleResourceArmPaginatedResult"] - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Schedule"] - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Schedule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def trigger( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.TriggerOnceRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.TriggerRunSubmissionDto" - """Trigger run. - - Trigger run. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Request body for trigger once. - :type body: ~azure.mgmt.machinelearningservices.models.TriggerOnceRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TriggerRunSubmissionDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.TriggerRunSubmissionDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerRunSubmissionDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'TriggerOnceRequest') - - request = build_trigger_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.trigger.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('TriggerRunSubmissionDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - trigger.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}/trigger"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_serverless_endpoints_operations.py deleted file mode 100644 index ce0fd2a0e606..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,1217 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9-]{0,51}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ServerlessEndpointsOperations(object): - """ServerlessEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ServerlessEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpointStatus" - """Status of the model backing the Serverless Endpoint. - - Status of the model backing the Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpointStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpointStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus"} # type: ignore - - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointAuthKeys"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointAuthKeys"] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_usages_operations.py deleted file mode 100644 index 094680c5a20b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 2872a5a71da5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2024_04_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index b3a0e6e105aa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,929 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - include_all = kwargs.pop('include_all', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - _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') - if include_all is not None: - _query_parameters['includeAll'] = _SERIALIZER.query("include_all", include_all, 'bool') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_test_connection_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - include_all=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionUpdateParameter"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace - def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 8595b1cb9ff2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index e30515405b05..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,2020 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - force_to_purge = kwargs.pop('force_to_purge', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if force_to_purge is not None: - _query_parameters['forceToPurge'] = _SERIALIZER.query("force_to_purge", force_to_purge, 'bool') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_connection_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): # pylint: disable=too-many-public-methods - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_connection_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointModels" - """List available models from all connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointModels, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointModels - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_connection_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_connection_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointModels', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_connection_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels"} # type: ignore - - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace - def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_04_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/tests/connection/e2etests/test_connections.py b/sdk/ml/azure-ai-ml/tests/connection/e2etests/test_connections.py index 97f86d46db64..294fc52047f6 100644 --- a/sdk/ml/azure-ai-ml/tests/connection/e2etests/test_connections.py +++ b/sdk/ml/azure-ai-ml/tests/connection/e2etests/test_connections.py @@ -8,7 +8,7 @@ from devtools_testutils import AzureRecordedTestCase, is_live from azure.ai.ml import MLClient, load_connection, load_datastore -from azure.ai.ml._restclient.v2024_04_01_preview.models import ConnectionAuthType, ConnectionCategory +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionAuthType, ConnectionCategory from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities import ( WorkspaceConnection, diff --git a/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_entity.py b/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_entity.py index b1ca89f39430..b4c1627e7616 100644 --- a/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_entity.py +++ b/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_entity.py @@ -5,7 +5,7 @@ from test_utilities.utils import verify_entity_load_and_dump from azure.ai.ml import load_connection -from azure.ai.ml._restclient.v2024_04_01_preview.models import ConnectionAuthType, ConnectionCategory +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionAuthType, ConnectionCategory from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities import WorkspaceConnection, AzureOpenAIConnection from azure.ai.ml.constants._common import ConnectionTypes, CognitiveServiceKinds From 75c29a203efd46a83326dd78ae1ccb0f9b6cee88 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 19:30:52 +0530 Subject: [PATCH 060/146] Migrate batch endpoint/deployment invoke + list_jobs off v2020_09 and delete the folder (JSON-direct + MFE send) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 12 - .../v2020_09_01_dataplanepreview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 104 - .../_configuration.py | 76 - .../_metadata.json | 103 - .../v2020_09_01_dataplanepreview/_patch.py | 31 - .../v2020_09_01_dataplanepreview/_vendor.py | 27 - .../v2020_09_01_dataplanepreview/_version.py | 9 - .../aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 97 - .../aio/_configuration.py | 72 - .../aio/_patch.py | 31 - .../aio/operations/__init__.py | 15 - .../_batch_job_deployment_operations.py | 300 --- .../_batch_job_endpoint_operations.py | 292 --- .../models/__init__.py | 138 -- ...azure_machine_learning_workspaces_enums.py | 108 - .../models/_models.py | 1607 --------------- .../models/_models_py3.py | 1738 ----------------- .../operations/__init__.py | 15 - .../_batch_job_deployment_operations.py | 442 ----- .../_batch_job_endpoint_operations.py | 431 ---- .../v2020_09_01_dataplanepreview/py.typed | 1 - .../ml/_schema/_deployment/batch/batch_job.py | 159 +- .../azure/ai/ml/_utils/_endpoint_utils.py | 16 +- .../ai/ml/entities/_deployment/batch_job.py | 14 +- .../ml/entities/_job/compute_configuration.py | 46 +- .../_batch_deployment_operations.py | 41 +- .../operations/_batch_endpoint_operations.py | 64 +- .../unittests/test_batch_job.py | 4 +- 30 files changed, 188 insertions(+), 5838 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_metadata.json delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 5b9d6d49c239..165ee20fc756 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -22,9 +22,6 @@ ) from azure.ai.ml._file_utils.file_utils import traverse_up_path_and_find_file from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, -) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.workspace_dataplane import WorkspaceDataplaneClient as ServiceClientWorkspaceDataplane from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope @@ -308,13 +305,6 @@ def __init__( if base_url: ops_kwargs["enforce_https"] = _is_https_url(base_url) - self._service_client_09_2020_dataplanepreview = ServiceClient092020DataplanePreview( - subscription_id=self._operation_scope._subscription_id, - credential=self._credential, - base_url=base_url, - **kwargs, - ) - self._service_client_workspace_dataplane = ServiceClientWorkspaceDataplane( subscription_id=self._operation_scope._subscription_id, credential=self._credential, @@ -625,7 +615,6 @@ def __init__( self._operation_container, self._credential, requests_pipeline=self._requests_pipeline, - service_client_09_2020_dataplanepreview=self._service_client_09_2020_dataplanepreview, **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.BATCH_ENDPOINT, self._batch_endpoints) @@ -646,7 +635,6 @@ def __init__( self._operation_container, credentials=self._credential, requests_pipeline=self._requests_pipeline, - service_client_09_2020_dataplanepreview=self._service_client_09_2020_dataplanepreview, service_client_02_2023_preview=self._service_client_02_2023_preview, **ops_kwargs, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py deleted file mode 100644 index f71ff2ece8b0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchJobDeploymentOperations, BatchJobEndpointOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): - """AzureMachineLearningWorkspaces. - - :ivar batch_job_deployment: BatchJobDeploymentOperations operations - :vartype batch_job_deployment: - azure.mgmt.machinelearningservices.operations.BatchJobDeploymentOperations - :ivar batch_job_endpoint: BatchJobEndpointOperations operations - :vartype batch_job_endpoint: - azure.mgmt.machinelearningservices.operations.BatchJobEndpointOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2020-09-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.batch_job_deployment = BatchJobDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_job_endpoint = BatchJobEndpointOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py deleted file mode 100644 index ac658990982c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2020-09-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_metadata.json b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_metadata.json deleted file mode 100644 index 8d1a7fe43637..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_metadata.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "chosen_version": "2020-09-01-dataplanepreview", - "total_api_version_list": ["2020-09-01-dataplanepreview"], - "client": { - "name": "AzureMachineLearningWorkspaces", - "filename": "_azure_machine_learning_workspaces", - "description": "AzureMachineLearningWorkspaces.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": false, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMachineLearningWorkspacesConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMachineLearningWorkspacesConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=\"https://management.azure.com\", # type: str", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "batch_job_deployment": "BatchJobDeploymentOperations", - "batch_job_endpoint": "BatchJobEndpointOperations" - } -} \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 13e246bcc919..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -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 .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchJobDeploymentOperations, BatchJobEndpointOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: - """AzureMachineLearningWorkspaces. - - :ivar batch_job_deployment: BatchJobDeploymentOperations operations - :vartype batch_job_deployment: - azure.mgmt.machinelearningservices.aio.operations.BatchJobDeploymentOperations - :ivar batch_job_endpoint: BatchJobEndpointOperations operations - :vartype batch_job_endpoint: - azure.mgmt.machinelearningservices.aio.operations.BatchJobEndpointOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2020-09-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.batch_job_deployment = BatchJobDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_job_endpoint = BatchJobEndpointOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py deleted file mode 100644 index 228f020b9f07..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2020-09-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py deleted file mode 100644 index 7d1a5550ce1d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._batch_job_deployment_operations import BatchJobDeploymentOperations -from ._batch_job_endpoint_operations import BatchJobEndpointOperations - -__all__ = [ - 'BatchJobDeploymentOperations', - 'BatchJobEndpointOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py deleted file mode 100644 index 47908fff911b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py +++ /dev/null @@ -1,300 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._batch_job_deployment_operations import build_create_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchJobDeploymentOperations: - """BatchJobDeploymentOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - endpoint_name: str, - deployment_name: str, - resource_group_name: str, - workspace_name: str, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchJobResourceArmPaginatedResult"]: - """Lists batch inference jobs in this deployment. - - Lists batch inference jobs in this deployment. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param deployment_name: Name of deployment. - :type deployment_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchJobResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore - - @distributed_trace_async - async def create( - self, - endpoint_name: str, - deployment_name: str, - resource_group_name: str, - workspace_name: str, - body: "_models.BatchJobResource", - **kwargs: Any - ) -> "_models.BatchJobResource": - """Creates a batch inference job for a deployment. - - Creates a batch inference job for a deployment. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param deployment_name: Name of deployment. - :type deployment_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param body: Batch inference endpoint Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchJobResource') - - request = build_create_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore - - - @distributed_trace_async - async def get( - self, - endpoint_name: str, - deployment_name: str, - id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.BatchJobResource": - """Gets a batch inference job by name at deployment. - - Gets a batch inference job by name at deployment. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param deployment_name: Name of deployment. - :type deployment_name: str - :param id: Identifier for the batch endpoint job. - :type id: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - - request = build_get_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - id=id, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py deleted file mode 100644 index 9146b57a5214..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py +++ /dev/null @@ -1,292 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._batch_job_endpoint_operations import build_create_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchJobEndpointOperations: - """BatchJobEndpointOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - endpoint_name: str, - resource_group_name: str, - workspace_name: str, - deployment: Optional[str] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchJobResourceArmPaginatedResult"]: - """Lists batch inference endpoint jobs in this endpoint. - - Lists batch inference endpoint jobs in this endpoint. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param deployment: Optional filter for jobs related to a specific deployment in the endpoint. - :type deployment: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchJobResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - deployment=deployment, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - deployment=deployment, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore - - @distributed_trace_async - async def create( - self, - endpoint_name: str, - resource_group_name: str, - workspace_name: str, - body: "_models.BatchJobResource", - **kwargs: Any - ) -> "_models.BatchJobResource": - """Creates a batch inference endpoint job. - - Creates a batch inference endpoint job. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param body: Batch inference endpoint Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchJobResource') - - request = build_create_request( - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore - - - @distributed_trace_async - async def get( - self, - endpoint_name: str, - id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.BatchJobResource": - """Gets a batch inference endpoint job by name. - - Gets a batch inference endpoint job by name. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param id: Identifier for the batch endpoint job. - :type id: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - - request = build_get_request( - endpoint_name=endpoint_name, - id=id, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py deleted file mode 100644 index 40a4c52c7977..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import BatchJob - from ._models_py3 import BatchJobResource - from ._models_py3 import BatchJobResourceArmPaginatedResult - from ._models_py3 import BatchRetrySettings - from ._models_py3 import ComputeConfiguration - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import DataVersion - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import InferenceDataInputBase - from ._models_py3 import InferenceDataUrlInput - from ._models_py3 import InferenceDatasetIdInput - from ._models_py3 import InferenceDatasetInput - from ._models_py3 import JobEndpoint - from ._models_py3 import JobInput - from ._models_py3 import JobOutputArtifacts - from ._models_py3 import JobOutputV2 - from ._models_py3 import LabelClass - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import Resource - from ._models_py3 import SystemData - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput -except (SyntaxError, ImportError): - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import BatchJob # type: ignore - from ._models import BatchJobResource # type: ignore - from ._models import BatchJobResourceArmPaginatedResult # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import ComputeConfiguration # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import DataVersion # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import InferenceDataInputBase # type: ignore - from ._models import InferenceDataUrlInput # type: ignore - from ._models import InferenceDatasetIdInput # type: ignore - from ._models import InferenceDatasetInput # type: ignore - from ._models import JobEndpoint # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobOutputArtifacts # type: ignore - from ._models import JobOutputV2 # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import Resource # type: ignore - from ._models import SystemData # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - BatchLoggingLevel, - CreatedByType, - DatasetType, - InferenceDataInputType, - InputDeliveryMode, - JobInputType, - JobOutputType, - JobProvisioningState, - JobStatus, - OutputDeliveryMode, -) - -__all__ = [ - 'AssetJobInput', - 'AssetJobOutput', - 'BatchJob', - 'BatchJobResource', - 'BatchJobResourceArmPaginatedResult', - 'BatchRetrySettings', - 'ComputeConfiguration', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'DataVersion', - 'ErrorDetail', - 'ErrorResponse', - 'InferenceDataInputBase', - 'InferenceDataUrlInput', - 'InferenceDatasetIdInput', - 'InferenceDatasetInput', - 'JobEndpoint', - 'JobInput', - 'JobOutputArtifacts', - 'JobOutputV2', - 'LabelClass', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableJobInput', - 'MLTableJobOutput', - 'Resource', - 'SystemData', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'BatchLoggingLevel', - 'CreatedByType', - 'DatasetType', - 'InferenceDataInputType', - 'InputDeliveryMode', - 'JobInputType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'OutputDeliveryMode', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 9a91d01e6f33..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SIMPLE = "Simple" - DATAFLOW = "Dataflow" - -class InferenceDataInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DATASET_VERSION = "DatasetVersion" - DATASET_ID = "DatasetId" - DATA_URL = "DataUrl" - -class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - ML_TABLE = "MLTable" - LITERAL = "Literal" - CUSTOM_MODEL = "CustomModel" - ML_FLOW_MODEL = "MLFlowModel" - TRITON_MODEL = "TritonModel" - -class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - ML_TABLE = "MLTable" - CUSTOM_MODEL = "CustomModel" - ML_FLOW_MODEL = "MLFlowModel" - TRITON_MODEL = "TritonModel" - -class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ - - NOT_STARTED = "NotStarted" - STARTING = "Starting" - PROVISIONING = "Provisioning" - PREPARING = "Preparing" - QUEUED = "Queued" - RUNNING = "Running" - FINALIZING = "Finalizing" - CANCEL_REQUESTED = "CancelRequested" - COMPLETED = "Completed" - FAILED = "Failed" - CANCELED = "Canceled" - NOT_RESPONDING = "NotResponding" - PAUSED = "Paused" - UNKNOWN = "Unknown" - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py deleted file mode 100644 index 5f5a86aedae7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py +++ /dev/null @@ -1,1607 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - - -class BatchJob(msrest.serialization.Model): - """Batch endpoint job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compute: Compute configuration used to set instance count. - :vartype compute: ~azure.mgmt.machinelearningservices.models.ComputeConfiguration - :ivar dataset: Input dataset - This will be deprecated. Use InputData instead. - :vartype dataset: ~azure.mgmt.machinelearningservices.models.InferenceDataInputBase - :ivar description: The asset description text. - :vartype description: str - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue] - -1 value indicates, ignore all failures during batch inference. - :vartype error_threshold: int - :ivar input_data: Input data for the job. - :vartype input_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar interaction_endpoints: Dictonary of endpoint URIs, keyed by enumerated job endpoints. - :vartype interaction_endpoints: dict[str, - ~azure.mgmt.machinelearningservices.models.JobEndpoint] - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar name: - :vartype name: str - :ivar output: Location of the job output logs and artifacts. - :vartype output: ~azure.mgmt.machinelearningservices.models.JobOutputArtifacts - :ivar output_data: Job output data location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - :vartype output_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutputV2] - :ivar output_dataset: Output dataset location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - This will be deprecated. Use OutputData instead. - :vartype output_dataset: ~azure.mgmt.machinelearningservices.models.DataVersion - :ivar output_file_name: Output file name. - :vartype output_file_name: str - :ivar partition_keys: Partition keys list used for Named partitioning. - :vartype partition_keys: list[str] - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar provisioning_state: Possible values include: "Succeeded", "Failed", "Canceled", - "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar retry_settings: Retry Settings for the batch inference operation. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _validation = { - 'interaction_endpoints': {'readonly': True}, - 'output': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'compute': {'key': 'compute', 'type': 'ComputeConfiguration'}, - 'dataset': {'key': 'dataset', 'type': 'InferenceDataInputBase'}, - 'description': {'key': 'description', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'input_data': {'key': 'inputData', 'type': '{JobInput}'}, - 'interaction_endpoints': {'key': 'interactionEndpoints', 'type': '{JobEndpoint}'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'output': {'key': 'output', 'type': 'JobOutputArtifacts'}, - 'output_data': {'key': 'outputData', 'type': '{JobOutputV2}'}, - 'output_dataset': {'key': 'outputDataset', 'type': 'DataVersion'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'partition_keys': {'key': 'partitionKeys', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute: Compute configuration used to set instance count. - :paramtype compute: ~azure.mgmt.machinelearningservices.models.ComputeConfiguration - :keyword dataset: Input dataset - This will be deprecated. Use InputData instead. - :paramtype dataset: ~azure.mgmt.machinelearningservices.models.InferenceDataInputBase - :keyword description: The asset description text. - :paramtype description: str - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue] - -1 value indicates, ignore all failures during batch inference. - :paramtype error_threshold: int - :keyword input_data: Input data for the job. - :paramtype input_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword name: - :paramtype name: str - :keyword output_data: Job output data location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - :paramtype output_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutputV2] - :keyword output_dataset: Output dataset location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - This will be deprecated. Use OutputData instead. - :paramtype output_dataset: ~azure.mgmt.machinelearningservices.models.DataVersion - :keyword output_file_name: Output file name. - :paramtype output_file_name: str - :keyword partition_keys: Partition keys list used for Named partitioning. - :paramtype partition_keys: list[str] - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword retry_settings: Retry Settings for the batch inference operation. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(BatchJob, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.dataset = kwargs.get('dataset', None) - self.description = kwargs.get('description', None) - self.error_threshold = kwargs.get('error_threshold', None) - self.input_data = kwargs.get('input_data', None) - self.interaction_endpoints = None - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', None) - self.mini_batch_size = kwargs.get('mini_batch_size', None) - self.name = kwargs.get('name', None) - self.output = None - self.output_data = kwargs.get('output_data', None) - self.output_dataset = kwargs.get('output_dataset', None) - self.output_file_name = kwargs.get('output_file_name', None) - self.partition_keys = kwargs.get('partition_keys', None) - self.properties = kwargs.get('properties', None) - self.provisioning_state = None - self.retry_settings = kwargs.get('retry_settings', None) - self.status = None - self.tags = kwargs.get('tags', None) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class BatchJobResource(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchJob - :ivar system_data: System data associated with resource provider. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchJob'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchJob - """ - super(BatchJobResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - self.system_data = None - - -class BatchJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchJob entities. - - :ivar next_link: The link to the next page of BatchJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchJobResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchJobResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchJobResource] - """ - super(BatchJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', None) - self.timeout = kwargs.get('timeout', None) - - -class ComputeConfiguration(msrest.serialization.Model): - """Configuration for compute binding. - - :ivar instance_count: Number of instances or nodes. - :vartype instance_count: int - :ivar instance_type: SKU type to run on. - :vartype instance_type: str - :ivar is_local: Set to true for jobs running on local compute. - :vartype is_local: bool - :ivar location: Location for virtual cluster run. - :vartype location: str - :ivar properties: Additional properties. - :vartype properties: dict[str, str] - :ivar target: ARM resource ID of the Compute you are targeting. If not provided the resource - will be deployed as Managed. - :vartype target: str - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'is_local': {'key': 'isLocal', 'type': 'bool'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Number of instances or nodes. - :paramtype instance_count: int - :keyword instance_type: SKU type to run on. - :paramtype instance_type: str - :keyword is_local: Set to true for jobs running on local compute. - :paramtype is_local: bool - :keyword location: Location for virtual cluster run. - :paramtype location: str - :keyword properties: Additional properties. - :paramtype properties: dict[str, str] - :keyword target: ARM resource ID of the Compute you are targeting. If not provided the resource - will be deployed as Managed. - :paramtype target: str - """ - super(ComputeConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', None) - self.instance_type = kwargs.get('instance_type', None) - self.is_local = kwargs.get('is_local', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.target = kwargs.get('target', None) - - -class JobInput(msrest.serialization.Model): - """Job input definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) - - -class JobOutputV2(msrest.serialization.Model): - """Job output definition container information on where to find the job output. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutputV2, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutputV2, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) - - -class DataVersion(msrest.serialization.Model): - """Data asset version details. - - All required parameters must be populated in order to send to Azure. - - :ivar dataset_type: The Format of dataset. Possible values include: "Simple", "Dataflow". - :vartype dataset_type: str or ~azure.mgmt.machinelearningservices.models.DatasetType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar path: Required. [Required] The path of the file/directory in the datastore. - :vartype path: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'dataset_type': {'key': 'datasetType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'path': {'key': 'path', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_type: The Format of dataset. Possible values include: "Simple", "Dataflow". - :paramtype dataset_type: str or ~azure.mgmt.machinelearningservices.models.DatasetType - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword path: Required. [Required] The path of the file/directory in the datastore. - :paramtype path: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(DataVersion, self).__init__(**kwargs) - self.dataset_type = kwargs.get('dataset_type', None) - self.datastore_id = kwargs.get('datastore_id', None) - self.description = kwargs.get('description', None) - self.is_anonymous = kwargs.get('is_anonymous', None) - self.path = kwargs['path'] - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class ErrorDetail(msrest.serialization.Model): - """Error detail information. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. Error code. - :vartype code: str - :ivar message: Required. Error message. - :vartype message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code: Required. Error code. - :paramtype code: str - :keyword message: Required. Error message. - :paramtype message: str - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - - -class ErrorResponse(msrest.serialization.Model): - """Error response information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code. - :vartype code: str - :ivar message: Error message. - :vartype message: str - :ivar details: An array of error detail objects. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorResponse, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None - - -class InferenceDataInputBase(msrest.serialization.Model): - """InferenceDataInputBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: InferenceDataUrlInput, InferenceDatasetIdInput, InferenceDatasetInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - """ - - _validation = { - 'data_input_type': {'required': True}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - } - - _subtype_map = { - 'data_input_type': {'DataUrl': 'InferenceDataUrlInput', 'DatasetId': 'InferenceDatasetIdInput', 'DatasetVersion': 'InferenceDatasetInput'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferenceDataInputBase, self).__init__(**kwargs) - self.data_input_type = None # type: Optional[str] - - -class InferenceDatasetIdInput(InferenceDataInputBase): - """InferenceDatasetIdInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - :ivar dataset_id: ARM ID of the input dataset. - :vartype dataset_id: str - """ - - _validation = { - 'data_input_type': {'required': True}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_id: ARM ID of the input dataset. - :paramtype dataset_id: str - """ - super(InferenceDatasetIdInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetId' # type: str - self.dataset_id = kwargs.get('dataset_id', None) - - -class InferenceDatasetInput(InferenceDataInputBase): - """InferenceDatasetInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - :ivar dataset_name: Name of the input dataset. - :vartype dataset_name: str - :ivar dataset_version: Version of the input dataset. - :vartype dataset_version: str - """ - - _validation = { - 'data_input_type': {'required': True}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_name': {'key': 'datasetName', 'type': 'str'}, - 'dataset_version': {'key': 'datasetVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_name: Name of the input dataset. - :paramtype dataset_name: str - :keyword dataset_version: Version of the input dataset. - :paramtype dataset_version: str - """ - super(InferenceDatasetInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetVersion' # type: str - self.dataset_name = kwargs.get('dataset_name', None) - self.dataset_version = kwargs.get('dataset_version', None) - - -class InferenceDataUrlInput(InferenceDataInputBase): - """InferenceDataUrlInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - :ivar path: Required. Asset path to the input data, say a blob URL. - :vartype path: str - """ - - _validation = { - 'data_input_type': {'required': True}, - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. Asset path to the input data, say a blob URL. - :paramtype path: str - """ - super(InferenceDataUrlInput, self).__init__(**kwargs) - self.data_input_type = 'DataUrl' # type: str - self.path = kwargs['path'] - - -class JobEndpoint(msrest.serialization.Model): - """Job endpoint definition. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar job_endpoint_type: Endpoint type. - :vartype job_endpoint_type: str - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'job_endpoint_type': {'key': 'jobEndpointType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_endpoint_type: Endpoint type. - :paramtype job_endpoint_type: str - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobEndpoint, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.job_endpoint_type = kwargs.get('job_endpoint_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - - -class JobOutputArtifacts(msrest.serialization.Model): - """Job output definition container information on where to find job logs and artifacts. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar datastore_id: ARM ID of the datastore where the job logs and artifacts are stored. - :vartype datastore_id: str - :ivar path: Path within the datastore to the job logs and artifacts. - :vartype path: str - """ - - _validation = { - 'datastore_id': {'readonly': True}, - 'path': {'readonly': True}, - } - - _attribute_map = { - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(JobOutputArtifacts, self).__init__(**kwargs) - self.datastore_id = None - self.path = None - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LiteralJobInput(JobInput): - """LiteralJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. Literal input value. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. Literal input value. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'Literal' # type: str - self.value = kwargs['value'] - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutputV2, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutputV2, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutputV2, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutputV2, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutputV2, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py deleted file mode 100644 index c7ac018a1a08..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py +++ /dev/null @@ -1,1738 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class BatchJob(msrest.serialization.Model): - """Batch endpoint job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compute: Compute configuration used to set instance count. - :vartype compute: ~azure.mgmt.machinelearningservices.models.ComputeConfiguration - :ivar dataset: Input dataset - This will be deprecated. Use InputData instead. - :vartype dataset: ~azure.mgmt.machinelearningservices.models.InferenceDataInputBase - :ivar description: The asset description text. - :vartype description: str - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue] - -1 value indicates, ignore all failures during batch inference. - :vartype error_threshold: int - :ivar input_data: Input data for the job. - :vartype input_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar interaction_endpoints: Dictonary of endpoint URIs, keyed by enumerated job endpoints. - :vartype interaction_endpoints: dict[str, - ~azure.mgmt.machinelearningservices.models.JobEndpoint] - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar name: - :vartype name: str - :ivar output: Location of the job output logs and artifacts. - :vartype output: ~azure.mgmt.machinelearningservices.models.JobOutputArtifacts - :ivar output_data: Job output data location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - :vartype output_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutputV2] - :ivar output_dataset: Output dataset location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - This will be deprecated. Use OutputData instead. - :vartype output_dataset: ~azure.mgmt.machinelearningservices.models.DataVersion - :ivar output_file_name: Output file name. - :vartype output_file_name: str - :ivar partition_keys: Partition keys list used for Named partitioning. - :vartype partition_keys: list[str] - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar provisioning_state: Possible values include: "Succeeded", "Failed", "Canceled", - "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar retry_settings: Retry Settings for the batch inference operation. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _validation = { - 'interaction_endpoints': {'readonly': True}, - 'output': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'compute': {'key': 'compute', 'type': 'ComputeConfiguration'}, - 'dataset': {'key': 'dataset', 'type': 'InferenceDataInputBase'}, - 'description': {'key': 'description', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'input_data': {'key': 'inputData', 'type': '{JobInput}'}, - 'interaction_endpoints': {'key': 'interactionEndpoints', 'type': '{JobEndpoint}'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'output': {'key': 'output', 'type': 'JobOutputArtifacts'}, - 'output_data': {'key': 'outputData', 'type': '{JobOutputV2}'}, - 'output_dataset': {'key': 'outputDataset', 'type': 'DataVersion'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'partition_keys': {'key': 'partitionKeys', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - compute: Optional["ComputeConfiguration"] = None, - dataset: Optional["InferenceDataInputBase"] = None, - description: Optional[str] = None, - error_threshold: Optional[int] = None, - input_data: Optional[Dict[str, "JobInput"]] = None, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = None, - mini_batch_size: Optional[int] = None, - name: Optional[str] = None, - output_data: Optional[Dict[str, "JobOutputV2"]] = None, - output_dataset: Optional["DataVersion"] = None, - output_file_name: Optional[str] = None, - partition_keys: Optional[List[str]] = None, - properties: Optional[Dict[str, str]] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword compute: Compute configuration used to set instance count. - :paramtype compute: ~azure.mgmt.machinelearningservices.models.ComputeConfiguration - :keyword dataset: Input dataset - This will be deprecated. Use InputData instead. - :paramtype dataset: ~azure.mgmt.machinelearningservices.models.InferenceDataInputBase - :keyword description: The asset description text. - :paramtype description: str - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue] - -1 value indicates, ignore all failures during batch inference. - :paramtype error_threshold: int - :keyword input_data: Input data for the job. - :paramtype input_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword name: - :paramtype name: str - :keyword output_data: Job output data location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - :paramtype output_data: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutputV2] - :keyword output_dataset: Output dataset location - Optional parameter: when not specified, the default location is - workspaceblobstore location. - This will be deprecated. Use OutputData instead. - :paramtype output_dataset: ~azure.mgmt.machinelearningservices.models.DataVersion - :keyword output_file_name: Output file name. - :paramtype output_file_name: str - :keyword partition_keys: Partition keys list used for Named partitioning. - :paramtype partition_keys: list[str] - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword retry_settings: Retry Settings for the batch inference operation. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(BatchJob, self).__init__(**kwargs) - self.compute = compute - self.dataset = dataset - self.description = description - self.error_threshold = error_threshold - self.input_data = input_data - self.interaction_endpoints = None - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.name = name - self.output = None - self.output_data = output_data - self.output_dataset = output_dataset - self.output_file_name = output_file_name - self.partition_keys = partition_keys - self.properties = properties - self.provisioning_state = None - self.retry_settings = retry_settings - self.status = None - self.tags = tags - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class BatchJobResource(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchJob - :ivar system_data: System data associated with resource provider. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchJob'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - properties: "BatchJob", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchJob - """ - super(BatchJobResource, self).__init__(**kwargs) - self.properties = properties - self.system_data = None - - -class BatchJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchJob entities. - - :ivar next_link: The link to the next page of BatchJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchJobResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchJobResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchJobResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchJobResource] - """ - super(BatchJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class ComputeConfiguration(msrest.serialization.Model): - """Configuration for compute binding. - - :ivar instance_count: Number of instances or nodes. - :vartype instance_count: int - :ivar instance_type: SKU type to run on. - :vartype instance_type: str - :ivar is_local: Set to true for jobs running on local compute. - :vartype is_local: bool - :ivar location: Location for virtual cluster run. - :vartype location: str - :ivar properties: Additional properties. - :vartype properties: dict[str, str] - :ivar target: ARM resource ID of the Compute you are targeting. If not provided the resource - will be deployed as Managed. - :vartype target: str - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'is_local': {'key': 'isLocal', 'type': 'bool'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = None, - instance_type: Optional[str] = None, - is_local: Optional[bool] = None, - location: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_count: Number of instances or nodes. - :paramtype instance_count: int - :keyword instance_type: SKU type to run on. - :paramtype instance_type: str - :keyword is_local: Set to true for jobs running on local compute. - :paramtype is_local: bool - :keyword location: Location for virtual cluster run. - :paramtype location: str - :keyword properties: Additional properties. - :paramtype properties: dict[str, str] - :keyword target: ARM resource ID of the Compute you are targeting. If not provided the resource - will be deployed as Managed. - :paramtype target: str - """ - super(ComputeConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.is_local = is_local - self.location = location - self.properties = properties - self.target = target - - -class JobInput(msrest.serialization.Model): - """Job input definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'CustomModel' # type: str - self.description = description - - -class JobOutputV2(msrest.serialization.Model): - """Job output definition container information on where to find the job output. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutputV2, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutputV2, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'CustomModel' # type: str - self.description = description - - -class DataVersion(msrest.serialization.Model): - """Data asset version details. - - All required parameters must be populated in order to send to Azure. - - :ivar dataset_type: The Format of dataset. Possible values include: "Simple", "Dataflow". - :vartype dataset_type: str or ~azure.mgmt.machinelearningservices.models.DatasetType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar path: Required. [Required] The path of the file/directory in the datastore. - :vartype path: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'dataset_type': {'key': 'datasetType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'path': {'key': 'path', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - path: str, - dataset_type: Optional[Union[str, "DatasetType"]] = None, - datastore_id: Optional[str] = None, - description: Optional[str] = None, - is_anonymous: Optional[bool] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword dataset_type: The Format of dataset. Possible values include: "Simple", "Dataflow". - :paramtype dataset_type: str or ~azure.mgmt.machinelearningservices.models.DatasetType - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword path: Required. [Required] The path of the file/directory in the datastore. - :paramtype path: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(DataVersion, self).__init__(**kwargs) - self.dataset_type = dataset_type - self.datastore_id = datastore_id - self.description = description - self.is_anonymous = is_anonymous - self.path = path - self.properties = properties - self.tags = tags - - -class ErrorDetail(msrest.serialization.Model): - """Error detail information. - - All required parameters must be populated in order to send to Azure. - - :ivar code: Required. Error code. - :vartype code: str - :ivar message: Required. Error message. - :vartype message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - *, - code: str, - message: str, - **kwargs - ): - """ - :keyword code: Required. Error code. - :paramtype code: str - :keyword message: Required. Error message. - :paramtype message: str - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = code - self.message = message - - -class ErrorResponse(msrest.serialization.Model): - """Error response information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code. - :vartype code: str - :ivar message: Error message. - :vartype message: str - :ivar details: An array of error detail objects. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorResponse, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None - - -class InferenceDataInputBase(msrest.serialization.Model): - """InferenceDataInputBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: InferenceDataUrlInput, InferenceDatasetIdInput, InferenceDatasetInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - """ - - _validation = { - 'data_input_type': {'required': True}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - } - - _subtype_map = { - 'data_input_type': {'DataUrl': 'InferenceDataUrlInput', 'DatasetId': 'InferenceDatasetIdInput', 'DatasetVersion': 'InferenceDatasetInput'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferenceDataInputBase, self).__init__(**kwargs) - self.data_input_type = None # type: Optional[str] - - -class InferenceDatasetIdInput(InferenceDataInputBase): - """InferenceDatasetIdInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - :ivar dataset_id: ARM ID of the input dataset. - :vartype dataset_id: str - """ - - _validation = { - 'data_input_type': {'required': True}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_id: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_id: ARM ID of the input dataset. - :paramtype dataset_id: str - """ - super(InferenceDatasetIdInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetId' # type: str - self.dataset_id = dataset_id - - -class InferenceDatasetInput(InferenceDataInputBase): - """InferenceDatasetInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - :ivar dataset_name: Name of the input dataset. - :vartype dataset_name: str - :ivar dataset_version: Version of the input dataset. - :vartype dataset_version: str - """ - - _validation = { - 'data_input_type': {'required': True}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_name': {'key': 'datasetName', 'type': 'str'}, - 'dataset_version': {'key': 'datasetVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_name: Optional[str] = None, - dataset_version: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_name: Name of the input dataset. - :paramtype dataset_name: str - :keyword dataset_version: Version of the input dataset. - :paramtype dataset_version: str - """ - super(InferenceDatasetInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetVersion' # type: str - self.dataset_name = dataset_name - self.dataset_version = dataset_version - - -class InferenceDataUrlInput(InferenceDataInputBase): - """InferenceDataUrlInput. - - All required parameters must be populated in order to send to Azure. - - :ivar data_input_type: Required. Constant filled by server. Possible values include: - "DatasetVersion", "DatasetId", "DataUrl". - :vartype data_input_type: str or - ~azure.mgmt.machinelearningservices.models.InferenceDataInputType - :ivar path: Required. Asset path to the input data, say a blob URL. - :vartype path: str - """ - - _validation = { - 'data_input_type': {'required': True}, - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: str, - **kwargs - ): - """ - :keyword path: Required. Asset path to the input data, say a blob URL. - :paramtype path: str - """ - super(InferenceDataUrlInput, self).__init__(**kwargs) - self.data_input_type = 'DataUrl' # type: str - self.path = path - - -class JobEndpoint(msrest.serialization.Model): - """Job endpoint definition. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar job_endpoint_type: Endpoint type. - :vartype job_endpoint_type: str - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'job_endpoint_type': {'key': 'jobEndpointType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_endpoint_type: Optional[str] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_endpoint_type: Endpoint type. - :paramtype job_endpoint_type: str - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobEndpoint, self).__init__(**kwargs) - self.endpoint = endpoint - self.job_endpoint_type = job_endpoint_type - self.port = port - self.properties = properties - - -class JobOutputArtifacts(msrest.serialization.Model): - """Job output definition container information on where to find job logs and artifacts. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar datastore_id: ARM ID of the datastore where the job logs and artifacts are stored. - :vartype datastore_id: str - :ivar path: Path within the datastore to the job logs and artifacts. - :vartype path: str - """ - - _validation = { - 'datastore_id': {'readonly': True}, - 'path': {'readonly': True}, - } - - _attribute_map = { - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(JobOutputArtifacts, self).__init__(**kwargs) - self.datastore_id = None - self.path = None - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LiteralJobInput(JobInput): - """LiteralJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. Literal input value. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. Literal input value. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'Literal' # type: str - self.value = value - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'MLFlowModel' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutputV2, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'MLFlowModel' # type: str - self.description = description - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'MLTable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutputV2, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'MLTable' # type: str - self.description = description - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'TritonModel' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutputV2, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'TritonModel' # type: str - self.description = description - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'UriFile' # type: str - self.description = description - - -class UriFileJobOutput(JobOutputV2, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'UriFile' # type: str - self.description = description - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "Literal", "CustomModel", "MLFlowModel", - "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'UriFolder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutputV2, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "UriFile", "UriFolder", "MLTable", "CustomModel", "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. This will have a default value of - "azureml/{jobId}/{outputFolder}/{outputFileName}" if omitted. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'UriFolder' # type: str - self.description = description diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py deleted file mode 100644 index 7d1a5550ce1d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._batch_job_deployment_operations import BatchJobDeploymentOperations -from ._batch_job_endpoint_operations import BatchJobEndpointOperations - -__all__ = [ - 'BatchJobDeploymentOperations', - 'BatchJobEndpointOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py deleted file mode 100644 index a2bf1568b18a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py +++ /dev/null @@ -1,442 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - endpoint_name, # type: str - deployment_name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs") # pylint: disable=line-too-long - path_format_arguments = { - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - "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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_request( - endpoint_name, # type: str - deployment_name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs") # pylint: disable=line-too-long - path_format_arguments = { - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - endpoint_name, # type: str - deployment_name, # type: str - id, # type: str - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - "id": _SERIALIZER.url("id", id, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchJobDeploymentOperations(object): - """BatchJobDeploymentOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - endpoint_name, # type: str - deployment_name, # type: str - resource_group_name, # type: str - workspace_name, # type: str - skiptoken=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchJobResourceArmPaginatedResult"] - """Lists batch inference jobs in this deployment. - - Lists batch inference jobs in this deployment. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param deployment_name: Name of deployment. - :type deployment_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchJobResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore - - @distributed_trace - def create( - self, - endpoint_name, # type: str - deployment_name, # type: str - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.BatchJobResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchJobResource" - """Creates a batch inference job for a deployment. - - Creates a batch inference job for a deployment. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param deployment_name: Name of deployment. - :type deployment_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param body: Batch inference endpoint Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchJobResource') - - request = build_create_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore - - - @distributed_trace - def get( - self, - endpoint_name, # type: str - deployment_name, # type: str - id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchJobResource" - """Gets a batch inference job by name at deployment. - - Gets a batch inference job by name at deployment. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param deployment_name: Name of deployment. - :type deployment_name: str - :param id: Identifier for the batch endpoint job. - :type id: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - - request = build_get_request( - endpoint_name=endpoint_name, - deployment_name=deployment_name, - id=id, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py deleted file mode 100644 index 34dc281370f6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py +++ /dev/null @@ -1,431 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - endpoint_name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - deployment = kwargs.pop('deployment', None) # type: Optional[str] - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs") # pylint: disable=line-too-long - path_format_arguments = { - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if deployment is not None: - _query_parameters['deployment'] = _SERIALIZER.query("deployment", deployment, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_request( - endpoint_name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs") # pylint: disable=line-too-long - path_format_arguments = { - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - endpoint_name, # type: str - id, # type: str - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "id": _SERIALIZER.url("id", id, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchJobEndpointOperations(object): - """BatchJobEndpointOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - endpoint_name, # type: str - resource_group_name, # type: str - workspace_name, # type: str - deployment=None, # type: Optional[str] - skiptoken=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchJobResourceArmPaginatedResult"] - """Lists batch inference endpoint jobs in this endpoint. - - Lists batch inference endpoint jobs in this endpoint. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param deployment: Optional filter for jobs related to a specific deployment in the endpoint. - :type deployment: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchJobResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - deployment=deployment, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - deployment=deployment, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore - - @distributed_trace - def create( - self, - endpoint_name, # type: str - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.BatchJobResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchJobResource" - """Creates a batch inference endpoint job. - - Creates a batch inference endpoint job. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param body: Batch inference endpoint Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchJobResource') - - request = build_create_request( - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore - - - @distributed_trace - def get( - self, - endpoint_name, # type: str - id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchJobResource" - """Gets a batch inference endpoint job by name. - - Gets a batch inference endpoint job by name. - - :param endpoint_name: Name of endpoint. - :type endpoint_name: str - :param id: Identifier for the batch endpoint job. - :type id: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchJobResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - - - request = build_get_request( - endpoint_name=endpoint_name, - id=id, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchJobResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_job.py index a1496f1ef287..5cefac9c00ee 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_job.py @@ -4,28 +4,11 @@ # pylint: disable=unused-argument,protected-access -from typing import Any +from typing import Any, Dict from marshmallow import fields from marshmallow.decorators import post_load -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import ( - BatchJob, - CustomModelJobInput, - CustomModelJobOutput, - DataVersion, - LiteralJobInput, - MLFlowModelJobInput, - MLFlowModelJobOutput, - MLTableJobInput, - MLTableJobOutput, - TritonModelJobInput, - TritonModelJobOutput, - UriFileJobInput, - UriFileJobOutput, - UriFolderJobInput, - UriFolderJobOutput, -) from azure.ai.ml._schema.core.fields import ArmStr, NestedField from azure.ai.ml._schema.core.schema import PathAwareSchema from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta @@ -45,7 +28,8 @@ class OutputDataSchema(metaclass=PatchedSchemaMeta): @post_load def make(self, data: Any, **kwargs: Any) -> Any: - return DataVersion(**data) + # ``DataVersion`` is not modeled on arm_ml_service; carry the fields as a plain dict for the operation. + return dict(data) class BatchJobSchema(PathAwareSchema): @@ -61,72 +45,79 @@ class BatchJobSchema(PathAwareSchema): retry_settings = NestedField(BatchRetrySettingsSchema) properties = fields.Dict(data_key="properties") + # ``jobInputType`` / ``jobOutputType`` wire discriminators for the v2020_09 batch-scoring job models. + _JOB_DATA_TYPE_MAP = { + AssetTypes.URI_FILE: "UriFile", + AssetTypes.URI_FOLDER: "UriFolder", + AssetTypes.TRITON_MODEL: "TritonModel", + AssetTypes.MLFLOW_MODEL: "MLFlowModel", + AssetTypes.MLTABLE: "MLTable", + AssetTypes.CUSTOM_MODEL: "CustomModel", + } + + @staticmethod + def _input_to_wire(input_data: Input) -> Dict[str, Any]: + # JSON-direct wire, byte-identical to the legacy v2020_09 job-input models. + if input_data.type in {InputTypes.INTEGER, InputTypes.NUMBER, InputTypes.STRING, InputTypes.BOOLEAN}: + wire: Dict[str, Any] = {"jobInputType": "Literal"} + if input_data.default is not None: + wire["value"] = input_data.default + return wire + wire = {"jobInputType": BatchJobSchema._JOB_DATA_TYPE_MAP[input_data.type]} + # ``UriFile``/``UriFolder`` inputs carry only ``uri``; the model inputs additionally carry ``mode``. + if input_data.type not in {AssetTypes.URI_FILE, AssetTypes.URI_FOLDER} and input_data.mode is not None: + wire["mode"] = input_data.mode + if input_data.path is not None: + wire["uri"] = input_data.path + return wire + + @staticmethod + def _output_to_wire(output_data: Output) -> Dict[str, Any]: + wire: Dict[str, Any] = {"jobOutputType": BatchJobSchema._JOB_DATA_TYPE_MAP[output_data.type]} + if output_data.mode is not None: + wire["mode"] = output_data.mode + if output_data.path is not None: + wire["uri"] = output_data.path + return wire + @post_load - def make(self, data: Any, **kwargs: Any) -> Any: # pylint: disable=too-many-branches - if data.get(EndpointYamlFields.BATCH_JOB_INPUT_DATA, None): - for key, input_data in data[EndpointYamlFields.BATCH_JOB_INPUT_DATA].items(): - if isinstance(input_data, Input): - if input_data.type == AssetTypes.URI_FILE: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = UriFileJobInput(uri=input_data.path) - if input_data.type == AssetTypes.URI_FOLDER: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = UriFolderJobInput(uri=input_data.path) - if input_data.type == AssetTypes.TRITON_MODEL: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = TritonModelJobInput( - mode=input_data.mode, uri=input_data.path - ) - if input_data.type == AssetTypes.MLFLOW_MODEL: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = MLFlowModelJobInput( - mode=input_data.mode, uri=input_data.path - ) - if input_data.type == AssetTypes.MLTABLE: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = MLTableJobInput( - mode=input_data.mode, uri=input_data.path - ) - if input_data.type == AssetTypes.CUSTOM_MODEL: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = CustomModelJobInput( - mode=input_data.mode, uri=input_data.path - ) - if input_data.type in { - InputTypes.INTEGER, - InputTypes.NUMBER, - InputTypes.STRING, - InputTypes.BOOLEAN, - }: - data[EndpointYamlFields.BATCH_JOB_INPUT_DATA][key] = LiteralJobInput(value=input_data.default) - if data.get(EndpointYamlFields.BATCH_JOB_OUTPUT_DATA, None): - for key, output_data in data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA].items(): - if isinstance(output_data, Output): - if output_data.type == AssetTypes.URI_FILE: - data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA][key] = UriFileJobOutput( - mode=output_data.mode, uri=output_data.path - ) - if output_data.type == AssetTypes.URI_FOLDER: - data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA][key] = UriFolderJobOutput( - mode=output_data.mode, uri=output_data.path - ) - if output_data.type == AssetTypes.TRITON_MODEL: - data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA][key] = TritonModelJobOutput( - mode=output_data.mode, uri=output_data.path - ) - if output_data.type == AssetTypes.MLFLOW_MODEL: - data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA][key] = MLFlowModelJobOutput( - mode=output_data.mode, uri=output_data.path - ) - if output_data.type == AssetTypes.MLTABLE: - data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA][key] = MLTableJobOutput( - mode=output_data.mode, uri=output_data.path - ) - if output_data.type == AssetTypes.CUSTOM_MODEL: - data[EndpointYamlFields.BATCH_JOB_OUTPUT_DATA][key] = CustomModelJobOutput( - mode=output_data.mode, uri=output_data.path - ) + def make(self, data: Any, **kwargs: Any) -> Any: + # ``BatchJob`` and its input/output models are not on arm_ml_service; build the camelCase wire body as a + # plain dict (JSON-direct), byte-identical to the legacy ``BatchJob(...).serialize()`` output. + # ``output_dataset`` is carried under ``_output_dataset`` because the operation must run the datastore-id + # ARM check on it before it becomes wire. + wire: Dict[str, Any] = {} - if data.get(EndpointYamlFields.COMPUTE, None): - data[EndpointYamlFields.COMPUTE] = ComputeConfiguration( - **data[EndpointYamlFields.COMPUTE] - )._to_rest_object() + input_data = data.get(EndpointYamlFields.BATCH_JOB_INPUT_DATA, None) + if input_data: + wire["inputData"] = { + key: (self._input_to_wire(item) if isinstance(item, Input) else item) + for key, item in input_data.items() + } - if data.get(EndpointYamlFields.RETRY_SETTINGS, None): - data[EndpointYamlFields.RETRY_SETTINGS] = data[EndpointYamlFields.RETRY_SETTINGS]._to_rest_object() + output_data = data.get(EndpointYamlFields.BATCH_JOB_OUTPUT_DATA, None) + if output_data: + wire["outputData"] = { + key: (self._output_to_wire(item) if isinstance(item, Output) else item) + for key, item in output_data.items() + } - return BatchJob(**data) + if data.get(EndpointYamlFields.COMPUTE, None): + wire["compute"] = ComputeConfiguration(**data[EndpointYamlFields.COMPUTE])._to_rest_object() + if data.get(EndpointYamlFields.RETRY_SETTINGS, None): + wire["retrySettings"] = data[EndpointYamlFields.RETRY_SETTINGS]._to_rest_object().as_dict() + if data.get("error_threshold", None) is not None: + wire["errorThreshold"] = data["error_threshold"] + if data.get("mini_batch_size", None) is not None: + wire["miniBatchSize"] = data["mini_batch_size"] + if data.get("output_file_name", None) is not None: + wire["outputFileName"] = data["output_file_name"] + if data.get("name", None) is not None: + wire["name"] = data["name"] + if data.get("properties", None) is not None: + wire["properties"] = data["properties"] + if data.get("dataset", None) is not None: + wire["dataset"] = data["dataset"] + if data.get("output_dataset", None) is not None: + wire["_output_dataset"] = data["output_dataset"] + return wire diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py index 97805de6bde8..186965b185c9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py @@ -12,7 +12,6 @@ from pathlib import Path from typing import Any, Callable, Dict, Optional, Union -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import DataVersion, UriFileJobOutput from azure.ai.ml._utils._arm_id_utils import is_ARM_id_for_resource, is_registry_id_for_resource from azure.ai.ml._utils._logger_utils import initialize_logger_info from azure.ai.ml.constants._common import ARM_ID_PREFIX, AzureMLResourceType, DefaultOpenEncoding, LROConfigurations @@ -287,13 +286,14 @@ def validate_scoring_script(deployment): ) from err -def convert_v1_dataset_to_v2(output_data_set: DataVersion, file_name: str) -> Dict[str, Any]: +def convert_v1_dataset_to_v2(output_data_set: Dict[str, Any], file_name: str) -> Dict[str, Any]: + # ``DataVersion`` / ``UriFileJobOutput`` are not modeled on arm_ml_service; build the wire dict directly + # (JSON-direct), byte-identical to the legacy ``UriFileJobOutput(uri=...).serialize()`` output. + datastore_id = output_data_set.get("datastore_id") + path = output_data_set.get("path") if file_name: - v2_dataset = UriFileJobOutput( - uri=f"azureml://datastores/{output_data_set.datastore_id}/paths/{output_data_set.path}/{file_name}" - ).serialize() + uri = f"azureml://datastores/{datastore_id}/paths/{path}/{file_name}" else: - v2_dataset = UriFileJobOutput( - uri=f"azureml://datastores/{output_data_set.datastore_id}/paths/{output_data_set.path}" - ).serialize() + uri = f"azureml://datastores/{datastore_id}/paths/{path}" + v2_dataset = {"uri": uri, "jobOutputType": "UriFile"} return {"output_name": v2_dataset} diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_job.py index c078f47978cb..cd4610498cf7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_job.py @@ -4,8 +4,6 @@ from typing import Any, Dict -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import BatchJobResource - class BatchJob(object): """Batch jobs that are created with batch deployments/endpoints invocation. @@ -29,10 +27,12 @@ def _to_dict(self) -> Dict: } @classmethod - def _from_rest_object(cls, obj: BatchJobResource) -> "BatchJob": + def _from_rest_object(cls, obj: Dict[str, Any]) -> "BatchJob": + # ``BatchJobResource`` is not modeled on arm_ml_service; read the camelCase wire dict directly. + properties = obj.get("properties") or {} return cls( - id=obj.id, - name=obj.name, - type=obj.type, - status=obj.properties.status, + id=obj.get("id"), + name=obj.get("name"), + type=obj.get("type"), + status=properties.get("status"), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/compute_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/compute_configuration.py index dcc00825966f..4572e15df82b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/compute_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/compute_configuration.py @@ -6,7 +6,6 @@ import logging from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import ComputeConfiguration as RestComputeConfiguration from azure.ai.ml.constants._common import LOCAL_COMPUTE_TARGET from azure.ai.ml.constants._job.job import JobComputePropertyFields from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin @@ -56,7 +55,9 @@ def __init__( # keep serialized string if load fails pass - def _to_rest_object(self) -> RestComputeConfiguration: + def _to_rest_object(self) -> Dict[str, Any]: + # ``ComputeConfiguration`` is not modeled on arm_ml_service; emit the wire body as a plain dict + # (JSON-direct), byte-identical to the legacy ``RestComputeConfiguration(...).serialize()`` output. if self.properties: serialized_properties = {} for key, value in self.properties.items(): @@ -72,24 +73,35 @@ def _to_rest_object(self) -> RestComputeConfiguration: pass else: serialized_properties = None - return RestComputeConfiguration( - target=self.target if not self.is_local else None, - is_local=self.is_local, - instance_count=self.instance_count, - instance_type=self.instance_type, - location=self.location, - properties=serialized_properties, - ) + + rest_object: Dict[str, Any] = {"isLocal": self.is_local} + target = self.target if not self.is_local else None + if target is not None: + rest_object["target"] = target + if self.instance_count is not None: + rest_object["instanceCount"] = self.instance_count + if self.instance_type is not None: + rest_object["instanceType"] = self.instance_type + if self.location is not None: + rest_object["location"] = self.location + if serialized_properties is not None: + rest_object["properties"] = serialized_properties + return rest_object @classmethod - def _from_rest_object(cls, obj: RestComputeConfiguration) -> "ComputeConfiguration": + def _from_rest_object(cls, obj: Any) -> "ComputeConfiguration": + def _get(field: str, wire: str) -> Any: + if isinstance(obj, dict): + return obj.get(wire) + return getattr(obj, field, None) + return ComputeConfiguration( - target=obj.target, - is_local=obj.is_local, - instance_count=obj.instance_count, - location=obj.location, - instance_type=obj.instance_type, - properties=obj.properties, + target=_get("target", "target"), + is_local=_get("is_local", "isLocal"), + instance_count=_get("instance_count", "instanceCount"), + location=_get("location", "location"), + instance_type=_get("instance_type", "instanceType"), + properties=_get("properties", "properties"), deserialize_properties=True, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py index 5733d7db263f..b7f702db1896 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py @@ -4,9 +4,11 @@ # pylint: disable=protected-access, too-many-boolean-expressions +import json import re from typing import Any, Optional, TypeVar, Union +from azure.ai.ml._azure_environments import _get_aml_resource_id_from_metadata, _resource_to_scopes from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient012024Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, @@ -17,11 +19,11 @@ from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._arm_id_utils import AMLVersionedArmId from azure.ai.ml._utils._azureml_polling import AzureMLPolling -from azure.ai.ml._utils._endpoint_utils import upload_dependencies, validate_scoring_script +from azure.ai.ml._utils._endpoint_utils import upload_dependencies, validate_response, validate_scoring_script from azure.ai.ml._utils._http_utils import HttpPipeline from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._package_utils import package_deployment -from azure.ai.ml._utils.utils import _get_mfe_base_url_from_discovery_service, modified_operation_client +from azure.ai.ml._utils.utils import _get_mfe_base_url_from_discovery_service from azure.ai.ml.constants._common import ARM_ID_PREFIX, AzureMLResourceType, LROConfigurations from azure.ai.ml.entities import BatchDeployment, BatchJob, ModelBatchDeployment, PipelineComponent, PipelineJob from azure.ai.ml.entities._deployment.pipeline_component_batch_deployment import PipelineComponentBatchDeployment @@ -71,7 +73,6 @@ def __init__( super(BatchDeploymentOperations, self).__init__(operation_scope, operation_config) ops_logger.update_filter() self._batch_deployment = service_client_01_2024_preview.batch_deployments - self._batch_job_deployment = kwargs.pop("service_client_09_2020_dataplanepreview").batch_job_deployment service_client_02_2023_preview = kwargs.pop("service_client_02_2023_preview") self._component_batch_deployment_operations = service_client_02_2023_preview.batch_deployments self._batch_endpoint_operations = service_client_01_2024_preview.batch_endpoints @@ -301,17 +302,29 @@ def list_jobs(self, endpoint_name: str, *, name: Optional[str] = None) -> ItemPa workspace_operations, self._workspace_name, self._requests_pipeline ) - with modified_operation_client(self._batch_job_deployment, mfe_base_uri): - result = self._batch_job_deployment.list( - endpoint_name=endpoint_name, - deployment_name=name, - resource_group_name=self._resource_group_name, - workspace_name=self._workspace_name, - **self._init_kwargs, - ) - - # This is necessary as the paged result need to be resolved inside the context manager - return list(result) + # The v2020_09 ``batch_job_deployment`` dataplane op has no arm_ml_service equivalent; list the jobs + # against the MFE base uri via the raw requests pipeline and page over the arm-paginated result. + # On-the-wire request/response is unchanged (api-version 2020-09-01-dataplanepreview). + list_url = ( + f"{mfe_base_uri.rstrip('/')}/subscriptions/{self._subscription_id}" + f"/resourceGroups/{self._resource_group_name}" + f"/providers/Microsoft.MachineLearningServices/workspaces/{self._workspace_name}" + f"/batchEndpoints/{endpoint_name}/deployments/{name}/jobs?api-version=2020-09-01-dataplanepreview" + ) + headers = {"Content-Type": "application/json", "Accept": "application/json"} + ml_audience_scopes = _resource_to_scopes(_get_aml_resource_id_from_metadata()) + token = self._credentials.get_token(*ml_audience_scopes).token if self._credentials is not None else "" + headers["Authorization"] = f"Bearer {token}" + + jobs = [] + next_link: Optional[str] = list_url + while next_link: + response = self._requests_pipeline.get(next_link, headers=headers) + validate_response(response) + body = json.loads(response.text()) + jobs.extend(BatchJob._from_rest_object(item) for item in (body.get("value") or [])) + next_link = body.get("nextLink") + return jobs def _get_workspace_location(self) -> str: """Get the workspace location diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py index 108c57e35a87..9ca034de010a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py @@ -16,7 +16,6 @@ from azure.ai.ml._artifacts._artifact_utilities import _upload_and_generate_remote_uri from azure.ai.ml._azure_environments import _get_aml_resource_id_from_metadata, _resource_to_scopes from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import BatchJobResource from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient102023 from azure.ai.ml._schema._deployment.batch.batch_job import BatchJobSchema from azure.ai.ml._scope_dependent_operations import ( @@ -34,7 +33,6 @@ from azure.ai.ml._utils.utils import ( _get_mfe_base_url_from_discovery_service, is_private_preview_enabled, - modified_operation_client, ) from azure.ai.ml.constants._common import ( ARM_ID_FULL_PREFIX, @@ -100,7 +98,6 @@ def __init__( ops_logger.update_filter() self._batch_operation = service_client_10_2023.batch_endpoints self._batch_deployment_operation = service_client_10_2023.batch_deployments - self._batch_job_endpoint = kwargs.pop("service_client_09_2020_dataplanepreview").batch_job_endpoint self._all_operations = all_operations self._credentials = credentials self._init_kwargs = kwargs @@ -349,21 +346,29 @@ def invoke( # pylint: disable=too-many-statements } batch_job = BatchJobSchema(context=context).load(data={}) - # update output datastore to arm id if needed + # ``batch_job`` is the camelCase wire body (dict, JSON-direct). ``_output_dataset`` is carried separately + # so the datastore-id ARM check can run before it becomes wire. # TODO: Unify datastore name -> arm id logic, TASK: 1104172 + output_dataset = batch_job.pop("_output_dataset", None) request = {} if ( - batch_job.output_dataset - and batch_job.output_dataset.datastore_id - and (not is_ARM_id_for_resource(batch_job.output_dataset.datastore_id)) + output_dataset + and output_dataset.get("datastore_id") + and (not is_ARM_id_for_resource(output_dataset["datastore_id"])) ): - v2_dataset_dictionary = convert_v1_dataset_to_v2(batch_job.output_dataset, batch_job.output_file_name) - batch_job.output_dataset = None - batch_job.output_file_name = None - request = BatchJobResource(properties=batch_job).serialize() + v2_dataset_dictionary = convert_v1_dataset_to_v2(output_dataset, batch_job.get("outputFileName")) + batch_job.pop("outputFileName", None) + request = {"properties": batch_job} request["properties"]["outputData"] = v2_dataset_dictionary else: - request = BatchJobResource(properties=batch_job).serialize() + if output_dataset is not None: + output_dataset_wire = {} + if output_dataset.get("datastore_id") is not None: + output_dataset_wire["datastoreId"] = output_dataset["datastore_id"] + if output_dataset.get("path") is not None: + output_dataset_wire["path"] = output_dataset["path"] + batch_job["outputDataset"] = output_dataset_wire + request = {"properties": batch_job} endpoint = self._batch_operation.get( resource_group_name=self._resource_group_name, @@ -399,7 +404,7 @@ def invoke( # pylint: disable=too-many-statements raise MlException(message=retry_msg, no_personal_data_message=retry_msg, target=ErrorTarget.BATCH_ENDPOINT) validate_response(response) batch_job = json.loads(response.text()) - return BatchJobResource.deserialize(batch_job) + return BatchJob._from_rest_object(batch_job) @distributed_trace @monitor_with_activity(ops_logger, "BatchEndpoint.ListJobs", ActivityType.PUBLICAPI) @@ -426,16 +431,29 @@ def list_jobs(self, endpoint_name: str) -> ItemPaged[BatchJob]: workspace_operations, self._workspace_name, self._requests_pipeline ) - with modified_operation_client(self._batch_job_endpoint, mfe_base_uri): - result = self._batch_job_endpoint.list( - endpoint_name=endpoint_name, - resource_group_name=self._resource_group_name, - workspace_name=self._workspace_name, - **self._init_kwargs, - ) - - # This is necessary as the paged result need to be resolved inside the context manager - return list(result) + # The v2020_09 ``batch_job_endpoint`` dataplane op has no arm_ml_service equivalent; list the jobs against + # the MFE base uri via the raw requests pipeline and page over the arm-paginated result. On-the-wire + # request/response is unchanged (api-version 2020-09-01-dataplanepreview). + list_url = ( + f"{mfe_base_uri.rstrip('/')}/subscriptions/{self._subscription_id}" + f"/resourceGroups/{self._resource_group_name}" + f"/providers/Microsoft.MachineLearningServices/workspaces/{self._workspace_name}" + f"/batchEndpoints/{endpoint_name}/jobs?api-version=2020-09-01-dataplanepreview" + ) + headers = {"Content-Type": "application/json", "Accept": "application/json"} + ml_audience_scopes = _resource_to_scopes(_get_aml_resource_id_from_metadata()) + token = self._credentials.get_token(*ml_audience_scopes).token if self._credentials is not None else "" + headers[EndpointInvokeFields.AUTHORIZATION] = f"Bearer {token}" + + jobs = [] + next_link: Optional[str] = list_url + while next_link: + response = self._requests_pipeline.get(next_link, headers=headers) + validate_response(response) + body = json.loads(response.text()) + jobs.extend(BatchJob._from_rest_object(item) for item in (body.get("value") or [])) + next_link = body.get("nextLink") + return jobs def _get_workspace_location(self) -> str: return str( diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_batch_job.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_batch_job.py index d677c1d893d8..377a44cf6b72 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_batch_job.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_batch_job.py @@ -5,7 +5,6 @@ import pytest from azure.ai.ml.entities import BatchJob -from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import BatchJobResource, BatchJob as BatchJobRest @pytest.mark.unittest @@ -26,10 +25,9 @@ def test_batch_job_to_dict(self): } def test_batch_job_to_rest(self): - batch_jon_rest = BatchJobResource.deserialize( + batch_job = BatchJob._from_rest_object( {"id": "id", "name": "name", "type": "type", "properties": {"status": "status"}} ) - batch_job = BatchJob._from_rest_object(batch_jon_rest) assert batch_job.id == "id" assert batch_job.name == "name" assert batch_job.type == "type" From 1701e3aac0555385b8001ccba7e46362f9116bc5 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 20:11:55 +0530 Subject: [PATCH 061/146] Fix stale v2023_04 docstring type refs in evaluator/model operations (client is v2023_08) --- .../azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py | 2 +- sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 0f116d3ed1d3..37f1fea3235f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -45,7 +45,7 @@ class EvaluatorOperations(_ScopeDependentOperations): :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient082023Preview or ServiceClient102021Dataplane). :type service_client: typing.Union[ - azure.ai.ml._restclient.v2023_04_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, + azure.ai.ml._restclient.v2023_08_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces] :param datastore_operations: Represents a client for performing operations on Datastores. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 166766266494..755cb686f7bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -90,7 +90,7 @@ class ModelOperations(_ScopeDependentOperations): :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient082023Preview or ServiceClient102021Dataplane). :type service_client: typing.Union[ - azure.ai.ml._restclient.v2023_04_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, + azure.ai.ml._restclient.v2023_08_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces] :param datastore_operations: Represents a client for performing operations on Datastores. From c7ad51875f7f71ee8b9545299bd192f68687551f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 20:30:32 +0530 Subject: [PATCH 062/146] Add byte-identical arm-MFE registry client builder (foundation for v2021_10 registry migration) --- .../azure/ai/ml/_utils/_registry_utils.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index fa674b47373e..bad1fb67d4d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -8,6 +8,7 @@ from typing_extensions import Literal from azure.ai.ml._azure_environments import _get_default_cloud_name, _get_registry_discovery_endpoint_from_metadata +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane from azure.ai.ml._restclient.registry_discovery import RegistryDiscoveryClient as ServiceClientRegistryDiscovery from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import AzureMachineLearningWorkspaces @@ -23,6 +24,11 @@ MFE_PATH_PREFIX = "mferp/managementfrontend" +# API version pinned for the registry data-plane (MFE discovery endpoint). The registry client is a hybrid +# arm_ml_service client constructed against the discovered MFE ``base_url`` (NOT the ARM management plane) so that +# every request stays byte-identical to the legacy v2021_10 msrest client: same URL templates, same api-version. +REGISTRY_DATAPLANE_API_VERSION = "2021-10-01-dataplanepreview" + class RegistryDiscovery: def __init__( @@ -72,6 +78,31 @@ def get_registry_service_client(self) -> AzureMachineLearningWorkspaces: ) return service_client_10_2021_dataplanepreview, service_model_client_10_2021_dataplanepreview + def get_registry_arm_service_client(self) -> MachineLearningServicesMgmtClient: + """Build a hybrid arm_ml_service client bound to the discovered registry MFE endpoint. + + The client is pinned to the registry data-plane api-version and the MFE ``base_url`` so that requests issued + via ``send_request`` are byte-identical to the legacy ``v2021_10_01_dataplanepreview`` msrest client (same host, + same URL templates, same api-version). Registry operations are driven through hand-built ``HttpRequest`` objects + rather than the arm-plane registry operation groups (which would target ``management.azure.com``). + + :return: The registry data-plane hybrid client. + :rtype: ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient + """ + self._get_registry_details() + kwargs = dict(self.kwargs) + kwargs.pop("subscription_id", None) + kwargs.pop("resource_group", None) + kwargs.pop("base_url", None) + kwargs.pop("workspace_location", None) + return MachineLearningServicesMgmtClient( + credential=self.credential, + subscription_id=self._subscription_id, + base_url=self._base_url, + api_version=REGISTRY_DATAPLANE_API_VERSION, + **kwargs, + ) + @property def subscription_id(self) -> str: """The subscription id of the registry. From e9eb19d6c4a7f4ddb73dd83b4421fc285d96cc0b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 20:41:21 +0530 Subject: [PATCH 063/146] Thread byte-identical arm-MFE registry client through construction (dual-client foundation) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 1 + sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py | 2 +- sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py | 7 ++++++- .../azure-ai-ml/azure/ai/ml/operations/_data_operations.py | 2 +- .../azure/ai/ml/operations/_environment_operations.py | 2 +- .../azure/ai/ml/operations/_model_operations.py | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 165ee20fc756..97fcc417bd55 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -254,6 +254,7 @@ def __init__( resource_group_name, subscription_id, self._service_client_model_dataplane, + self._service_client_registry_arm, ) = get_registry_client( self._credential, registry_name if registry_name else registry_reference, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py index 186965b185c9..fe83c0ae8bcb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py @@ -64,7 +64,7 @@ def check_default_deployment_template(deployment: Deployment, credential: Option model_version = match.group(4) try: - service_client, resource_group_name, _, _ = get_registry_client( + service_client, resource_group_name, _, _, _ = get_registry_client( credential=credential, registry_name=registry_name, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index bad1fb67d4d7..951f14b66394 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -89,7 +89,8 @@ def get_registry_arm_service_client(self) -> MachineLearningServicesMgmtClient: :return: The registry data-plane hybrid client. :rtype: ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient """ - self._get_registry_details() + if self._base_url is None: + self._get_registry_details() kwargs = dict(self.kwargs) kwargs.pop("subscription_id", None) kwargs.pop("resource_group", None) @@ -248,6 +249,9 @@ def get_registry_client(credential, registry_name, workspace_location: Optional[ service_client_10_2021_dataplanepreview, service_model_client_10_2021_dataplanepreview = ( registry_discovery.get_registry_service_client() ) + # Byte-identical hybrid client bound to the same discovered MFE endpoint + registry data-plane api-version. + # Registry consumers are being migrated off the msrest client above to this client's ``send_request``. + service_client_registry_arm = registry_discovery.get_registry_arm_service_client() subscription_id = registry_discovery.subscription_id resource_group_name = registry_discovery.resource_group return ( @@ -255,6 +259,7 @@ def get_registry_client(credential, registry_name, workspace_location: Optional[ resource_group_name, subscription_id, service_model_client_10_2021_dataplanepreview, + service_client_registry_arm, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 6703e7a8e762..e2e21e3e7f59 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -875,7 +875,7 @@ def _set_registry_client(self, registry_name: str) -> Generator: data_versions_operation_ = self._operation try: - _client, _rg, _sub, _model_client = get_registry_client( + _client, _rg, _sub, _model_client, _ = get_registry_client( self._service_client._config.credential, registry_name ) self._operation_scope.registry_name = registry_name diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index f6a757527c24..a8f216799b84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -548,7 +548,7 @@ def _set_registry_client(self, registry_name: str) -> Generator: environment_versions_operation_ = self._version_operations try: - _client, _rg, _sub, _model_client = get_registry_client( + _client, _rg, _sub, _model_client, _ = get_registry_client( self._service_client._config.credential, registry_name ) self._operation_scope.registry_name = registry_name diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 755cb686f7bc..c97f55f7cbdf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -688,7 +688,7 @@ def _set_registry_client(self, registry_name: str) -> Generator: model_versions_operation_ = self._model_versions_operation try: - _client, _rg, _sub, _model_client = get_registry_client( + _client, _rg, _sub, _model_client, _ = get_registry_client( self._service_client._config.credential, registry_name ) self._operation_scope.registry_name = registry_name From 8082c22b4ce3da43543a6484d028572015e24dcf Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 20:50:41 +0530 Subject: [PATCH 064/146] Migrate registry model get in _endpoint_utils to byte-identical arm-MFE send_request --- .../azure/ai/ml/_utils/_endpoint_utils.py | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py index fe83c0ae8bcb..b8f847beed7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_endpoint_utils.py @@ -51,9 +51,9 @@ def check_default_deployment_template(deployment: Deployment, credential: Option try: import re - from azure.ai.ml._utils._registry_utils import get_registry_client + from azure.ai.ml._utils._registry_utils import REGISTRY_DATAPLANE_API_VERSION, get_registry_client from azure.ai.ml.constants._common import REGISTRY_VERSION_PATTERN - from azure.ai.ml.entities._assets._artifacts.model import Model + from azure.core.rest import HttpRequest match = re.match(REGISTRY_VERSION_PATTERN, deployment.model, re.IGNORECASE) if not match: @@ -64,25 +64,29 @@ def check_default_deployment_template(deployment: Deployment, credential: Option model_version = match.group(4) try: - service_client, resource_group_name, _, _, _ = get_registry_client( + _, resource_group_name, subscription_id, _, registry_arm_client = get_registry_client( credential=credential, registry_name=registry_name, ) - model_version_data = service_client.model_versions.get( - name=model_name, - version=model_version, - registry_name=registry_name, - resource_group_name=resource_group_name, + # Byte-identical to the legacy v2021_10 msrest ``model_versions.get`` (same MFE endpoint + api-version). + request = HttpRequest( + "GET", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}" + f"/models/{model_name}/versions/{model_version}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Accept": "application/json"}, ) + response = registry_arm_client.send_request(request) + response.raise_for_status() + model_version_data = response.json() - model = Model._from_rest_object(model_version_data) + properties = model_version_data.get("properties", {}) or {} + default_deployment_template = properties.get("defaultDeploymentTemplate") or {} + asset_id = default_deployment_template.get("assetId") or default_deployment_template.get("asset_id") - if ( - hasattr(model, "default_deployment_template") - and model.default_deployment_template - and model.default_deployment_template.asset_id - ): + if asset_id: module_logger.info( "\nModel '%s' (version %s) from registry '%s' has a " "default deployment template configured.\n" @@ -92,7 +96,7 @@ def check_default_deployment_template(deployment: Deployment, credential: Option model_name, model_version, registry_name, - model.default_deployment_template.asset_id, + asset_id, ) except Exception: # pylint: disable=broad-except pass From fa2d56610f6f4b33adb62152cbdc1845ec2fff9a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 21:26:45 +0530 Subject: [PATCH 065/146] Migrate registry sas-uri helpers to byte-identical arm-MFE send_request; thread arm client into asset ops --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 4 + .../azure/ai/ml/_utils/_registry_utils.py | 84 +++++++++++-------- .../ai/ml/operations/_code_operations.py | 3 +- .../ai/ml/operations/_data_operations.py | 3 +- .../ml/operations/_environment_operations.py | 3 +- .../ai/ml/operations/_model_operations.py | 5 +- 6 files changed, 63 insertions(+), 39 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 97fcc417bd55..9936bf3757c6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -560,6 +560,7 @@ def __init__( control_plane_client=self._service_client_08_2023_preview, workspace_rg=self._ws_rg, workspace_sub=self._ws_sub, + registry_service_client=getattr(self, "_service_client_registry_arm", None), registry_reference=registry_reference, ) # Evaluators @@ -586,6 +587,7 @@ def __init__( self._operation_config, (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023), self._datastores, + registry_service_client=getattr(self, "_service_client_registry_arm", None), **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.CODE, self._code) @@ -594,6 +596,7 @@ def __init__( self._operation_config, (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023_preview), self._operation_container, + registry_service_client=getattr(self, "_service_client_registry_arm", None), **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.ENVIRONMENT, self._environments) @@ -657,6 +660,7 @@ def __init__( self._datastores, requests_pipeline=self._requests_pipeline, all_operations=self._operation_container, + registry_service_client=getattr(self, "_service_client_registry_arm", None), **ops_kwargs, ) self._operation_container.add(AzureMLResourceType.DATA, self._data) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 951f14b66394..e45c63ea9fae 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -12,13 +12,10 @@ from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane from azure.ai.ml._restclient.registry_discovery import RegistryDiscoveryClient as ServiceClientRegistryDiscovery from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import AzureMachineLearningWorkspaces -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ( - BlobReferenceSASRequestDto, - TemporaryDataReferenceRequestDto, -) from azure.ai.ml.constants._common import REGISTRY_ASSET_ID from azure.ai.ml.exceptions import MlException from azure.core.exceptions import HttpResponseError +from azure.core.rest import HttpRequest module_logger = logging.getLogger(__name__) @@ -137,19 +134,27 @@ def get_sas_uri_for_registry_asset(service_client, name, version, resource_group :param registry: Registry name :type registry: str :param body: Request body - :type body: TemporaryDataReferenceRequestDto + :type body: dict :rtype: str """ sas_uri = None + # Byte-identical to the legacy v2021_10 msrest ``temporary_data_references.create_or_get_temporary_data_reference`` + # (same MFE endpoint + api-version); the client is the hybrid arm client bound to the discovered registry base_url. + subscription_id = service_client._config.subscription_id + request = HttpRequest( + "PUT", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry}" + f"/tempdatarefs/{name}/versions/{version}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Accept": "application/json"}, + json=body, + ) try: - res = service_client.temporary_data_references.create_or_get_temporary_data_reference( - name=name, - version=version, - resource_group_name=resource_group, - registry_name=registry, - body=body, - ) - sas_uri = res.blob_reference_for_consumption.credential.additional_properties["sasUri"] + response = service_client.send_request(request) + response.raise_for_status() + res = response.json() + sas_uri = res["blobReferenceForConsumption"]["credential"]["sasUri"] except HttpResponseError as e: # "Asset already exists" exception is thrown from service with error code 409, that we need to ignore if e.status_code == 409: @@ -161,7 +166,7 @@ def get_sas_uri_for_registry_asset(service_client, name, version, resource_group def get_asset_body_for_registry_storage( registry_name: str, asset_type: str, asset_name: str, asset_version: str -) -> TemporaryDataReferenceRequestDto: +) -> dict: """Get Asset body for registry. :param registry_name: Registry name. @@ -172,18 +177,18 @@ def get_asset_body_for_registry_storage( :type asset_name: str :param asset_version: Asset version. :type asset_version: str - :return: The temporary data reference request dto - :rtype: TemporaryDataReferenceRequestDto + :return: The temporary data reference request body (camelCase wire dict). + :rtype: dict """ - body = TemporaryDataReferenceRequestDto( - asset_id=REGISTRY_ASSET_ID.format(registry_name, asset_type, asset_name, asset_version), - temporary_data_reference_type="TemporaryBlobReference", - ) + body = { + "assetId": REGISTRY_ASSET_ID.format(registry_name, asset_type, asset_name, asset_version), + "temporaryDataReferenceType": "TemporaryBlobReference", + } return body def get_storage_details_for_registry_assets( - service_client: AzureMachineLearningWorkspaces, + service_client: MachineLearningServicesMgmtClient, asset_type: str, asset_name: str, asset_version: str, @@ -212,22 +217,33 @@ def get_storage_details_for_registry_assets( * A sas URI and "SAS" :rtype: Tuple[str, Literal["NoCredentials", "SAS"]] """ - body = BlobReferenceSASRequestDto( - asset_id=REGISTRY_ASSET_ID.format(reg_name, asset_type, asset_name, asset_version), - blob_uri=uri, - ) - sas_uri = service_client.data_references.get_blob_reference_sas( - name=asset_name, - version=asset_version, - resource_group_name=rg_name, - registry_name=reg_name, - body=body, + # Byte-identical to the legacy v2021_10 msrest ``data_references.get_blob_reference_sas`` (same MFE endpoint + + # api-version). NOTE: the ``credential_type == "no_credentials"`` comparison is preserved verbatim from the legacy + # code path; the wire value is actually "NoCredentials", so this branch never matches (behavior kept identical). + subscription_id = service_client._config.subscription_id + body = { + "assetId": REGISTRY_ASSET_ID.format(reg_name, asset_type, asset_name, asset_version), + "blobUri": uri, + } + request = HttpRequest( + "POST", + f"/subscriptions/{subscription_id}/resourceGroups/{rg_name}" + f"/providers/Microsoft.MachineLearningServices/registries/{reg_name}" + f"/datarefs/{asset_name}/versions/{asset_version}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Accept": "application/json"}, + json=body, ) - if sas_uri.blob_reference_for_consumption.credential.credential_type == "no_credentials": - return sas_uri.blob_reference_for_consumption.blob_uri, "NoCredentials" + response = service_client.send_request(request) + response.raise_for_status() + sas_uri = response.json() + blob_reference_for_consumption = sas_uri["blobReferenceForConsumption"] + credential = blob_reference_for_consumption["credential"] + if credential["credentialType"] == "no_credentials": + return blob_reference_for_consumption["blobUri"], "NoCredentials" return ( - sas_uri.blob_reference_for_consumption.credential.additional_properties["sasUri"], + credential["sasUri"], "SAS", ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index a5c5d5f3b626..16098c98cec4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -82,6 +82,7 @@ def __init__( super(CodeOperations, self).__init__(operation_scope, operation_config) ops_logger.update_filter() self._service_client = service_client + self._registry_service_client = kwargs.pop("registry_service_client", None) self._version_operation = service_client.code_versions self._container_operation = service_client.code_containers self._datastore_operation = datastore_operations @@ -120,7 +121,7 @@ def create_or_update(self, code: Code) -> Code: if self._registry_name: sas_uri = get_sas_uri_for_registry_asset( - service_client=self._service_client, + service_client=self._registry_service_client, name=name, version=version, resource_group=self._resource_group_name, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index e2e21e3e7f59..e4cc8c2ce889 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -122,6 +122,7 @@ def __init__( self._container_operation = service_client.data_containers self._datastore_operation = datastore_operations self._service_client = service_client + self._registry_service_client = kwargs.pop("registry_service_client", None) self._init_kwargs = kwargs self._requests_pipeline: HttpPipeline = kwargs.pop("requests_pipeline") self._all_operations: OperationsContainer = kwargs.pop("all_operations") @@ -350,7 +351,7 @@ def create_or_update(self, data: Data) -> Data: return Data._from_rest_object(data_res_obj) sas_uri = get_sas_uri_for_registry_asset( - service_client=self._service_client, + service_client=self._registry_service_client, name=name, version=version, resource_group=self._resource_group_name, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index a8f216799b84..744c783e662e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -80,6 +80,7 @@ def __init__( self._containers_operations = service_client.environment_containers self._version_operations = service_client.environment_versions self._service_client = service_client + self._registry_service_client = kwargs.pop("registry_service_client", None) self._all_operations = all_operations self._datastore_operation = all_operations.all_operations[AzureMLResourceType.DATASTORE] @@ -160,7 +161,7 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig return Environment._from_rest_object(env_rest_obj) sas_uri = get_sas_uri_for_registry_asset( - service_client=self._service_client, + service_client=self._registry_service_client, name=environment.name, version=environment.version, resource_group=self._resource_group_name, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index c97f55f7cbdf..a791bb96b9fb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -119,6 +119,7 @@ def __init__( if service_client_model_dataplane is not None: self._model_dataplane_operation = service_client_model_dataplane.models self._service_client = service_client + self._registry_service_client = kwargs.pop("registry_service_client", None) self._datastore_operation = datastore_operations self._all_operations = all_operations self._control_plane_client: Any = kwargs.get("control_plane_client", None) @@ -236,7 +237,7 @@ def create_or_update( # type: ignore return Model._from_rest_object(model_rest_obj) sas_uri = get_sas_uri_for_registry_asset( - service_client=self._service_client, + service_client=self._registry_service_client, name=model.name, version=model.version, resource_group=self._resource_group_name, @@ -413,7 +414,7 @@ def download(self, name: str, version: str, download_path: Union[PathLike, str] ds_name, path_prefix = get_ds_name_and_path_prefix(model_uri, self._registry_name) if self._registry_name: sas_uri, auth_type = get_storage_details_for_registry_assets( - service_client=self._service_client, + service_client=self._registry_service_client, asset_name=name, asset_version=version, reg_name=self._registry_name, From c3d1d153b1e26f3741e7812f3a8e65f8b3516f6e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 21:31:17 +0530 Subject: [PATCH 066/146] Migrate registry code get to byte-identical arm-MFE send_request + arm CodeVersion deserialize --- .../azure/ai/ml/_utils/_registry_utils.py | 29 +++++++++++++++++++ .../ai/ml/operations/_code_operations.py | 23 ++++++++++----- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index e45c63ea9fae..390140995884 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -164,6 +164,35 @@ def get_sas_uri_for_registry_asset(service_client, name, version, resource_group return sas_uri +def get_registry_versioned_asset( + service_client, asset_plural: str, name, version, resource_group, registry_name +) -> dict: + """Byte-identical registry versioned-asset GET (same MFE endpoint + api-version as the legacy v2021_10 client). + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param asset_plural: The plural asset segment of the URL (e.g. ``codes``, ``models``, ``data``, ``environments``). + :type asset_plural: str + :param name: Asset name. + :param version: Asset version. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :return: The raw camelCase response body. + :rtype: dict + """ + subscription_id = service_client._config.subscription_id + request = HttpRequest( + "GET", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}" + f"/{asset_plural}/{name}/versions/{version}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Accept": "application/json"}, + ) + response = service_client.send_request(request) + response.raise_for_status() + return response.json() + + def get_asset_body_for_registry_storage( registry_name: str, asset_type: str, asset_name: str, asset_version: str ) -> dict: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index 16098c98cec4..52a58f0beba2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -24,6 +24,7 @@ AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023 +from azure.ai.ml._restclient.arm_ml_service.models import CodeVersion as CodeVersionData from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._asset_utils import ( @@ -32,7 +33,11 @@ get_storage_info_for_non_registry_asset, ) from azure.ai.ml._utils._logger_utils import OpsLogger -from azure.ai.ml._utils._registry_utils import get_asset_body_for_registry_storage, get_sas_uri_for_registry_asset +from azure.ai.ml._utils._registry_utils import ( + get_asset_body_for_registry_storage, + get_registry_versioned_asset, + get_sas_uri_for_registry_asset, +) from azure.ai.ml._utils._storage_utils import get_storage_client from azure.ai.ml.entities._assets import Code from azure.ai.ml.exceptions import ( @@ -287,12 +292,16 @@ def _get(self, name: str, version: Optional[str] = None) -> Code: error_type=ValidationErrorType.INVALID_VALUE, ) code_version_resource = ( - self._version_operation.get( - name=name, - version=version, - resource_group_name=self._operation_scope.resource_group_name, - registry_name=self._registry_name, - **self._init_kwargs, + CodeVersionData._deserialize( + get_registry_versioned_asset( + self._registry_service_client, + "codes", + name, + version, + self._operation_scope.resource_group_name, + self._registry_name, + ), + [], ) if self._registry_name else self._version_operation.get( From 8dfafde01194684b4c4b7becbb6907e303f64b5a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 22:35:17 +0530 Subject: [PATCH 067/146] Migrate registry code create to byte-identical arm-MFE send_request LRO --- .../azure/ai/ml/_utils/_registry_utils.py | 54 +++++++++++++++++++ .../ai/ml/operations/_code_operations.py | 21 +++++--- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 390140995884..e34c2205e47e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -9,13 +9,18 @@ from azure.ai.ml._azure_environments import _get_default_cloud_name, _get_registry_discovery_endpoint_from_metadata from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient +from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane from azure.ai.ml._restclient.registry_discovery import RegistryDiscoveryClient as ServiceClientRegistryDiscovery from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import AzureMachineLearningWorkspaces from azure.ai.ml.constants._common import REGISTRY_ASSET_ID from azure.ai.ml.exceptions import MlException from azure.core.exceptions import HttpResponseError +from azure.core.polling import LROPoller from azure.core.rest import HttpRequest +from azure.mgmt.core.polling.arm_polling import ARMPolling + +import json module_logger = logging.getLogger(__name__) @@ -193,6 +198,55 @@ def get_registry_versioned_asset( return response.json() +def begin_create_or_update_registry_versioned_asset( + service_client, asset_plural: str, name, version, resource_group, registry_name, body +) -> dict: + """Byte-identical registry versioned-asset create-or-update LRO (same MFE endpoint + api-version + wire body). + + Mirrors the arm ``begin_create_or_update`` machinery (initial PUT via the pipeline + ``LROPoller``/``ARMPolling``) + but pins the URL template + api-version to the legacy v2021_10 registry data-plane contract. + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param asset_plural: The plural asset segment of the URL (e.g. ``codes``, ``models``, ``data``, ``environments``). + :type asset_plural: str + :param name: Asset name. + :param version: Asset version. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :param body: The arm hybrid version model to serialize as the request body. + :return: The raw camelCase final response body. + :rtype: dict + """ + subscription_id = service_client._config.subscription_id + content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) + request = HttpRequest( + "PUT", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}" + f"/{asset_plural}/{name}/versions/{version}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + content=content, + ) + path_format_arguments = { + "endpoint": service_client._serialize.url( + "self._config.base_url", service_client._config.base_url, "str", skip_quote=True + ), + } + request.url = service_client._client.format_url(request.url, **path_format_arguments) + raw_result = service_client._client._pipeline.run(request, stream=True) + response = raw_result.http_response + response.read() + if response.status_code not in [200, 201]: + response.raise_for_status() + + def get_long_running_output(pipeline_response): + return pipeline_response.http_response.json() + + polling_method = ARMPolling(service_client._config.polling_interval, path_format_arguments=path_format_arguments) + return LROPoller(service_client._client, raw_result, get_long_running_output, polling_method).result() + + def get_asset_body_for_registry_storage( registry_name: str, asset_type: str, asset_name: str, asset_version: str ) -> dict: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index 52a58f0beba2..c4354fb1dc7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -34,6 +34,7 @@ ) from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_versioned_asset, get_asset_body_for_registry_storage, get_registry_versioned_asset, get_sas_uri_for_registry_asset, @@ -179,14 +180,18 @@ def create_or_update(self, code: Code) -> Code: code_version_resource = code._to_rest_object() result = ( - self._version_operation.begin_create_or_update( - name=name, - version=version, - registry_name=self._registry_name, - resource_group_name=self._operation_scope.resource_group_name, - body=code_version_resource, - **self._init_kwargs, - ).result() + CodeVersionData._deserialize( + begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "codes", + name, + version, + self._operation_scope.resource_group_name, + self._registry_name, + code_version_resource, + ), + [], + ) if self._registry_name else self._version_operation.create_or_update( name=name, From 5ad3f374cb4f6c0d4b27d8241decd2da3f2d47bd Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 22:39:24 +0530 Subject: [PATCH 068/146] Migrate registry data get (version+container) to byte-identical arm-MFE send_request --- .../azure/ai/ml/_utils/_registry_utils.py | 26 ++++++++++++++ .../ai/ml/operations/_data_operations.py | 34 ++++++++++++------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index e34c2205e47e..945fa4c2eefa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -198,6 +198,32 @@ def get_registry_versioned_asset( return response.json() +def get_registry_container_asset(service_client, asset_plural: str, name, resource_group, registry_name) -> dict: + """Byte-identical registry container GET (same MFE endpoint + api-version as the legacy v2021_10 client). + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param asset_plural: The plural asset segment of the URL (e.g. ``codes``, ``models``, ``data``, ``environments``). + :type asset_plural: str + :param name: Container name. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :return: The raw camelCase response body. + :rtype: dict + """ + subscription_id = service_client._config.subscription_id + request = HttpRequest( + "GET", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}" + f"/{asset_plural}/{name}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Accept": "application/json"}, + ) + response = service_client.send_request(request) + response.raise_for_status() + return response.json() + + def begin_create_or_update_registry_versioned_asset( service_client, asset_plural: str, name, version, resource_group, registry_name, body ) -> dict: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index e4cc8c2ce889..690fb245d90b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -25,7 +25,7 @@ AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023_preview -from azure.ai.ml._restclient.arm_ml_service.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import DataContainer, DataVersionBase, ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -54,6 +54,8 @@ from azure.ai.ml._utils._registry_utils import ( get_asset_body_for_registry_storage, get_registry_client, + get_registry_container_asset, + get_registry_versioned_asset, get_sas_uri_for_registry_asset, ) from azure.ai.ml._utils.utils import is_url @@ -193,12 +195,16 @@ def list( def _get(self, name: Optional[str], version: Optional[str] = None) -> Data: if version: return ( - self._operation.get( - name=name, - version=version, - registry_name=self._registry_name, - **self._scope_kwargs, - **self._init_kwargs, + DataVersionBase._deserialize( + get_registry_versioned_asset( + self._registry_service_client, + "data", + name, + version, + self._resource_group_name, + self._registry_name, + ), + [], ) if self._registry_name else self._operation.get( @@ -210,11 +216,15 @@ def _get(self, name: Optional[str], version: Optional[str] = None) -> Data: ) ) return ( - self._container_operation.get( - name=name, - registry_name=self._registry_name, - **self._scope_kwargs, - **self._init_kwargs, + DataContainer._deserialize( + get_registry_container_asset( + self._registry_service_client, + "data", + name, + self._resource_group_name, + self._registry_name, + ), + [], ) if self._registry_name else self._container_operation.get( From aa3c42f0b15533ae827cb790d2d934554797a34e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 22:41:39 +0530 Subject: [PATCH 069/146] Migrate registry data list (versions+containers) to byte-identical arm-MFE paged send_request --- .../azure/ai/ml/_utils/_registry_utils.py | 52 +++++++++++++++++++ .../ai/ml/operations/_data_operations.py | 26 ++++++---- 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 945fa4c2eefa..9dcca28df7b8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -16,6 +16,7 @@ from azure.ai.ml.constants._common import REGISTRY_ASSET_ID from azure.ai.ml.exceptions import MlException from azure.core.exceptions import HttpResponseError +from azure.core.paging import ItemPaged from azure.core.polling import LROPoller from azure.core.rest import HttpRequest from azure.mgmt.core.polling.arm_polling import ARMPolling @@ -224,6 +225,57 @@ def get_registry_container_asset(service_client, asset_plural: str, name, resour return response.json() +def list_registry_assets( + service_client, + asset_plural: str, + name, + resource_group, + registry_name, + arm_cls, + from_rest_fn, + list_view_type=None, +) -> ItemPaged: + """Byte-identical registry versioned-asset / container list (same MFE endpoint + api-version + paging contract). + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param asset_plural: The plural asset segment of the URL (e.g. ``codes``, ``models``, ``data``, ``environments``). + :type asset_plural: str + :param name: Container name for a versions list, or ``None`` for a containers list. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :param arm_cls: The arm hybrid model class to deserialize each response item into. + :param from_rest_fn: Callable mapping a deserialized arm model to an SDK entity. + :param list_view_type: Optional ``listViewType`` query value. + :return: An iterator of SDK entities. + :rtype: ~azure.core.paging.ItemPaged + """ + subscription_id = service_client._config.subscription_id + prefix = ( + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}/{asset_plural}" + ) + url_path = f"{prefix}/{name}/versions" if name else prefix + params = {"api-version": REGISTRY_DATAPLANE_API_VERSION} + if list_view_type is not None: + params["listViewType"] = list_view_type + + def get_next(continuation_token=None): + if continuation_token: + request = HttpRequest("GET", continuation_token, headers={"Accept": "application/json"}) + else: + request = HttpRequest("GET", url_path, params=params, headers={"Accept": "application/json"}) + response = service_client.send_request(request) + response.raise_for_status() + return response + + def extract_data(response): + body = response.json() + items = [from_rest_fn(arm_cls._deserialize(obj, [])) for obj in body.get("value", [])] + return body.get("nextLink") or None, iter(items) + + return ItemPaged(get_next, extract_data) + + def begin_create_or_update_registry_versioned_asset( service_client, asset_plural: str, name, version, resource_group, registry_name, body ) -> dict: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 690fb245d90b..052bee1a2f05 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -57,6 +57,7 @@ get_registry_container_asset, get_registry_versioned_asset, get_sas_uri_for_registry_asset, + list_registry_assets, ) from azure.ai.ml._utils.utils import is_url from azure.ai.ml.constants._common import ( @@ -160,12 +161,15 @@ def list( """ if name: return ( - self._operation.list( - name=name, - registry_name=self._registry_name, - cls=lambda objs: [Data._from_rest_object(obj) for obj in objs], + list_registry_assets( + self._registry_service_client, + "data", + name, + self._resource_group_name, + self._registry_name, + DataVersionBase, + Data._from_rest_object, list_view_type=list_view_type, - **self._scope_kwargs, ) if self._registry_name else self._operation.list( @@ -177,11 +181,15 @@ def list( ) ) return ( - self._container_operation.list( - registry_name=self._registry_name, - cls=lambda objs: [Data._from_container_rest_object(obj) for obj in objs], + list_registry_assets( + self._registry_service_client, + "data", + None, + self._resource_group_name, + self._registry_name, + DataContainer, + Data._from_container_rest_object, list_view_type=list_view_type, - **self._scope_kwargs, ) if self._registry_name else self._container_operation.list( From ef0b71f70242cafe2c7c80f7c3383e5d21fa3678 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 9 Jul 2026 22:45:00 +0530 Subject: [PATCH 070/146] Migrate registry data create LRO + existence check; map registry get 404 to ResourceNotFoundError --- .../azure/ai/ml/_utils/_registry_utils.py | 6 +++- .../ai/ml/operations/_data_operations.py | 32 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 9dcca28df7b8..2f8e4dd70cdb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -15,7 +15,7 @@ from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import AzureMachineLearningWorkspaces from azure.ai.ml.constants._common import REGISTRY_ASSET_ID from azure.ai.ml.exceptions import MlException -from azure.core.exceptions import HttpResponseError +from azure.core.exceptions import HttpResponseError, ResourceNotFoundError from azure.core.paging import ItemPaged from azure.core.polling import LROPoller from azure.core.rest import HttpRequest @@ -195,6 +195,8 @@ def get_registry_versioned_asset( headers={"Accept": "application/json"}, ) response = service_client.send_request(request) + if response.status_code == 404: + raise ResourceNotFoundError(response=response) response.raise_for_status() return response.json() @@ -221,6 +223,8 @@ def get_registry_container_asset(service_client, asset_plural: str, name, resour headers={"Accept": "application/json"}, ) response = service_client.send_request(request) + if response.status_code == 404: + raise ResourceNotFoundError(response=response) response.raise_for_status() return response.json() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 052bee1a2f05..5a4c3e4be192 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -52,6 +52,7 @@ from azure.ai.ml._utils._http_utils import HttpPipeline from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_versioned_asset, get_asset_body_for_registry_storage, get_registry_client, get_registry_container_asset, @@ -338,11 +339,13 @@ def create_or_update(self, data: Data) -> Data: # If the data asset is a workspace asset, promote to registry if isinstance(data, WorkspaceAssetReference): try: - self._operation.get( - name=data.name, - version=data.version, - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, + get_registry_versioned_asset( + self._registry_service_client, + "data", + data.name, + data.version, + self._resource_group_name, + self._registry_name, ) except Exception as err: # pylint: disable=W0718 if isinstance(err, ResourceNotFoundError): @@ -406,13 +409,18 @@ def create_or_update(self, data: Data) -> Data: ) else: result = ( - self._operation.begin_create_or_update( - name=name, - version=version, - registry_name=self._registry_name, - body=data_version_resource, - **self._scope_kwargs, - ).result() + DataVersionBase._deserialize( + begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "data", + name, + version, + self._operation_scope.resource_group_name, + self._registry_name, + data_version_resource, + ), + [], + ) if self._registry_name else self._operation.create_or_update( name=name, From cfc017deb11c9077886edf4782bba5040d69016b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 07:16:00 +0530 Subject: [PATCH 071/146] Migrate registry environment get/list/create to byte-identical arm-MFE send_request --- .../ml/operations/_environment_operations.py | 95 ++++++++++++------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index 744c783e662e..b93c72602d76 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -15,7 +15,7 @@ AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023Preview -from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentVersion, ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentContainer, EnvironmentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -32,9 +32,13 @@ from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_versioned_asset, get_asset_body_for_registry_storage, get_registry_client, + get_registry_container_asset, + get_registry_versioned_asset, get_sas_uri_for_registry_asset, + list_registry_assets, ) from azure.ai.ml.constants._common import ARM_ID_PREFIX, ASSET_ID_FORMAT, AzureMLResourceType from azure.ai.ml.entities._assets import Environment, WorkspaceAssetReference @@ -128,11 +132,13 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig if isinstance(environment, WorkspaceAssetReference): # verify that environment is not already in registry try: - self._version_operations.get( - name=environment.name, - version=environment.version, - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, + get_registry_versioned_asset( + self._registry_service_client, + "environments", + environment.name, + environment.version, + self._resource_group_name, + self._registry_name, ) except Exception as err: # pylint: disable=W0718 if isinstance(err, ResourceNotFoundError): @@ -185,14 +191,18 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig ) env_version_resource = environment._to_rest_object() env_rest_obj = ( - self._version_operations.begin_create_or_update( - name=environment.name, - version=environment.version, - registry_name=self._registry_name, - body=env_version_resource, - **self._scope_kwargs, - **self._kwargs, - ).result() + EnvironmentVersion._deserialize( + begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "environments", + environment.name, + environment.version, + self._operation_scope.resource_group_name, + self._registry_name, + env_version_resource, + ), + [], + ) if self._registry_name else self._version_operations.create_or_update( name=environment.name, @@ -234,12 +244,16 @@ def _try_update_latest_version( def _get(self, name: str, version: Optional[str] = None) -> EnvironmentVersion: if version: return ( - self._version_operations.get( - name=name, - version=version, - registry_name=self._registry_name, - **self._scope_kwargs, - **self._kwargs, + EnvironmentVersion._deserialize( + get_registry_versioned_asset( + self._registry_service_client, + "environments", + name, + version, + self._resource_group_name, + self._registry_name, + ), + [], ) if self._registry_name else self._version_operations.get( @@ -251,11 +265,15 @@ def _get(self, name: str, version: Optional[str] = None) -> EnvironmentVersion: ) ) return ( - self._containers_operations.get( - name=name, - registry_name=self._registry_name, - **self._scope_kwargs, - **self._kwargs, + EnvironmentContainer._deserialize( + get_registry_container_asset( + self._registry_service_client, + "environments", + name, + self._resource_group_name, + self._registry_name, + ), + [], ) if self._registry_name else self._containers_operations.get( @@ -347,12 +365,14 @@ def list( return cast( Iterable[Environment], ( - self._version_operations.list( - name=name, - registry_name=self._registry_name, - cls=lambda objs: [Environment._from_rest_object(obj) for obj in objs], - **self._scope_kwargs, - **self._kwargs, + list_registry_assets( + self._registry_service_client, + "environments", + name, + self._resource_group_name, + self._registry_name, + EnvironmentVersion, + Environment._from_rest_object, ) if self._registry_name else self._version_operations.list( @@ -368,11 +388,14 @@ def list( return cast( Iterable[Environment], ( - self._containers_operations.list( - registry_name=self._registry_name, - cls=lambda objs: [Environment._from_container_rest_object(obj) for obj in objs], - **self._scope_kwargs, - **self._kwargs, + list_registry_assets( + self._registry_service_client, + "environments", + None, + self._resource_group_name, + self._registry_name, + EnvironmentContainer, + Environment._from_container_rest_object, ) if self._registry_name else self._containers_operations.list( From 1a09a3bb8d6f4697fed632b96d5de81028b103c8 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 07:18:39 +0530 Subject: [PATCH 072/146] Migrate registry component list/get to byte-identical arm-MFE send_request; thread arm client into component --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 1 + .../ai/ml/operations/_component_operations.py | 50 ++++++++++++------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 9936bf3757c6..54e80bbd1f48 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -674,6 +674,7 @@ def __init__( ), self._operation_container, self._preflight, + registry_service_client=getattr(self, "_service_client_registry_arm", None), **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.COMPONENT, self._components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index 2146203bbbb1..d8f128b949cb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -18,7 +18,7 @@ AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient012024 -from azure.ai.ml._restclient.arm_ml_service.models import ComponentVersion, ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ComponentContainer, ComponentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -26,6 +26,10 @@ _ScopeDependentOperations, ) from azure.ai.ml._telemetry import ActivityType, monitor_with_activity, monitor_with_telemetry_mixin +from azure.ai.ml._utils._registry_utils import ( + get_registry_versioned_asset, + list_registry_assets, +) from azure.ai.ml._utils._asset_utils import ( IgnoreFile, _archive_or_restore, @@ -110,6 +114,7 @@ def __init__( self._version_operation = service_client.component_versions self._preflight_operation = preflight_operation self._container_operation = service_client.component_containers + self._registry_service_client = kwargs.pop("registry_service_client", None) self._all_operations = all_operations self._init_args = kwargs # Maps a label to a function which given an asset name, @@ -185,12 +190,14 @@ def list( return cast( Iterable[Component], ( - self._version_operation.list( - name=name, - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, - **self._init_args, - cls=lambda objs: [Component._from_rest_object(obj) for obj in objs], + list_registry_assets( + self._registry_service_client, + "components", + name, + self._resource_group_name, + self._registry_name, + ComponentVersion, + Component._from_rest_object, ) if self._registry_name else self._version_operation.list( @@ -206,11 +213,14 @@ def list( return cast( Iterable[Component], ( - self._container_operation.list( - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, - **self._init_args, - cls=lambda objs: [Component._from_container_rest_object(obj) for obj in objs], + list_registry_assets( + self._registry_service_client, + "components", + None, + self._resource_group_name, + self._registry_name, + ComponentContainer, + Component._from_container_rest_object, ) if self._registry_name else self._container_operation.list( @@ -235,12 +245,16 @@ def _get_component_version(self, name: str, version: Optional[str] = DEFAULT_COM :rtype: ~azure.ai.ml.entities.ComponentVersion """ result = ( - self._version_operation.get( - name=name, - version=version, - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, - **self._init_args, + ComponentVersion._deserialize( + get_registry_versioned_asset( + self._registry_service_client, + "components", + name, + version, + self._resource_group_name, + self._registry_name, + ), + [], ) if self._registry_name else self._version_operation.get( From 68877c3520f014476cfcbaabe313da92ea343882 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 09:53:56 +0530 Subject: [PATCH 073/146] Migrate registry component create to byte-identical arm-MFE LRO with AzureMLPolling --- .../azure/ai/ml/_utils/_registry_utils.py | 31 +++++++++++++++---- .../ai/ml/operations/_component_operations.py | 27 +++++++--------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 2f8e4dd70cdb..a5f72b5bfe95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -281,8 +281,18 @@ def extract_data(response): def begin_create_or_update_registry_versioned_asset( - service_client, asset_plural: str, name, version, resource_group, registry_name, body -) -> dict: + service_client, + asset_plural: str, + name, + version, + resource_group, + registry_name, + body, + *, + polling_cls=ARMPolling, + polling_interval=None, + wait=True, +): """Byte-identical registry versioned-asset create-or-update LRO (same MFE endpoint + api-version + wire body). Mirrors the arm ``begin_create_or_update`` machinery (initial PUT via the pipeline + ``LROPoller``/``ARMPolling``) @@ -296,8 +306,13 @@ def begin_create_or_update_registry_versioned_asset( :param resource_group: Resource group name. :param registry_name: Registry name. :param body: The arm hybrid version model to serialize as the request body. - :return: The raw camelCase final response body. - :rtype: dict + :keyword polling_cls: The polling method class (defaults to ``ARMPolling``; pass ``AzureMLPolling`` to match callers + that stream progress). + :keyword polling_interval: Optional poll interval override (defaults to the client config's polling interval). + :keyword wait: When ``True`` (default) the LRO is awaited and the final body dict is returned; when ``False`` the + ``LROPoller`` is returned so the caller can drive it (e.g. via ``polling_wait``). + :return: The raw camelCase final response body, or the ``LROPoller`` when ``wait`` is ``False``. + :rtype: dict or ~azure.core.polling.LROPoller """ subscription_id = service_client._config.subscription_id content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) @@ -325,8 +340,12 @@ def begin_create_or_update_registry_versioned_asset( def get_long_running_output(pipeline_response): return pipeline_response.http_response.json() - polling_method = ARMPolling(service_client._config.polling_interval, path_format_arguments=path_format_arguments) - return LROPoller(service_client._client, raw_result, get_long_running_output, polling_method).result() + interval = polling_interval if polling_interval is not None else service_client._config.polling_interval + polling_method = polling_cls(interval, path_format_arguments=path_format_arguments) + poller = LROPoller(service_client._client, raw_result, get_long_running_output, polling_method) + if wait: + return poller.result() + return poller def get_asset_body_for_registry_storage( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index d8f128b949cb..fc31756f50ab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -27,6 +27,7 @@ ) from azure.ai.ml._telemetry import ActivityType, monitor_with_activity, monitor_with_telemetry_mixin from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_versioned_asset, get_registry_versioned_asset, list_registry_assets, ) @@ -532,21 +533,17 @@ def _create_or_update_component_version( try: if self._registry_name: start_time = time.time() - path_format_arguments = { - "componentName": component.name, - "resourceGroupName": self._resource_group_name, - "registryName": self._registry_name, - } - poller = self._version_operation.begin_create_or_update( - name=name, - version=version, - resource_group_name=self._operation_scope.resource_group_name, - registry_name=self._registry_name, - body=rest_component_resource, - polling=AzureMLPolling( - LROConfigurations.POLL_INTERVAL, - path_format_arguments=path_format_arguments, - ), + poller = begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "components", + name, + version, + self._operation_scope.resource_group_name, + self._registry_name, + rest_component_resource, + polling_cls=AzureMLPolling, + polling_interval=LROConfigurations.POLL_INTERVAL, + wait=False, ) message = f"Creating/updating registry component {component.name} with version {component.version} " polling_wait(poller=poller, start_time=start_time, message=message, timeout=None) From c14f6787f8c1bfb122f3308cd2c5e6db3ca2916d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 09:58:11 +0530 Subject: [PATCH 074/146] Migrate registry asset import (begin_import_method) to byte-identical arm-MFE LRO; WorkspaceAssetReference JSON-direct --- .../azure/ai/ml/_utils/_registry_utils.py | 51 +++++++++++++++++++ .../_assets/workspace_asset_reference.py | 31 ++++++----- .../ai/ml/operations/_data_operations.py | 12 +++-- .../ml/operations/_environment_operations.py | 13 ++--- .../ai/ml/operations/_model_operations.py | 12 +++-- 5 files changed, 87 insertions(+), 32 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index a5f72b5bfe95..d9ab2a0f12f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -348,6 +348,57 @@ def get_long_running_output(pipeline_response): return poller +def begin_import_registry_asset( + service_client, resource_group, registry_name, body, *, polling_cls=ARMPolling, polling_interval=None, wait=True +): + """Byte-identical registry asset import LRO (``resource_management_asset_reference.begin_import_method``). + + POSTs to ``.../registries/{registry}/import`` against the discovered MFE endpoint + registry data-plane api-version. + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :param body: The camelCase import request wire dict. + :keyword polling_cls: The polling method class (defaults to ``ARMPolling``). + :keyword polling_interval: Optional poll interval override. + :keyword wait: When ``True`` (default) the LRO is awaited and the final body (or ``None``) is returned; when + ``False`` the ``LROPoller`` is returned. + :return: The raw camelCase final response body (or ``None``), or the ``LROPoller`` when ``wait`` is ``False``. + :rtype: dict or None or ~azure.core.polling.LROPoller + """ + subscription_id = service_client._config.subscription_id + request = HttpRequest( + "POST", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}/import", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + json=body, + ) + path_format_arguments = { + "endpoint": service_client._serialize.url( + "self._config.base_url", service_client._config.base_url, "str", skip_quote=True + ), + } + request.url = service_client._client.format_url(request.url, **path_format_arguments) + raw_result = service_client._client._pipeline.run(request, stream=True) + response = raw_result.http_response + response.read() + if response.status_code not in [200, 201, 202]: + response.raise_for_status() + + def get_long_running_output(pipeline_response): + http_response = pipeline_response.http_response + return http_response.json() if http_response.text() else None + + interval = polling_interval if polling_interval is not None else service_client._config.polling_interval + polling_method = polling_cls(interval, path_format_arguments=path_format_arguments) + poller = LROPoller(service_client._client, raw_result, get_long_running_output, polling_method) + if wait: + return poller.result() + return poller + + def get_asset_body_for_registry_storage( registry_name: str, asset_type: str, asset_name: str, asset_version: str ) -> dict: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py index 1e7d1ba2b0a8..5b294c5d4b5a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py @@ -6,10 +6,6 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ( - ResourceManagementAssetReferenceData, - ResourceManagementAssetReferenceDetails, -) from azure.ai.ml._schema import WorkspaceAssetReferenceSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY from azure.ai.ml.entities._assets.asset import Asset @@ -64,21 +60,24 @@ def _load( res: WorkspaceAssetReference = load_from_dict(WorkspaceAssetReferenceSchema, data, context, **kwargs) return res - def _to_rest_object(self) -> ResourceManagementAssetReferenceData: - resource_management_details = ResourceManagementAssetReferenceDetails( - destination_name=self.name, - destination_version=self.version, - source_asset_id=self.asset_id, - ) - resource_management = ResourceManagementAssetReferenceData(properties=resource_management_details) - return resource_management + def _to_rest_object(self) -> dict: + # JSON-direct wire dict, byte-identical to the legacy v2021_10 ``ResourceManagementAssetReferenceData`` + # (referenceType is a server-pinned constant; None fields are omitted, matching msrest serialization). + properties: Dict[str, Any] = {"referenceType": "Id"} + if self.name is not None: + properties["destinationName"] = self.name + if self.version is not None: + properties["destinationVersion"] = self.version + properties["sourceAssetId"] = self.asset_id + return {"properties": properties} @classmethod - def _from_rest_object(cls, resource_object: ResourceManagementAssetReferenceData) -> "WorkspaceAssetReference": + def _from_rest_object(cls, resource_object: dict) -> "WorkspaceAssetReference": + properties = resource_object["properties"] resource_management = WorkspaceAssetReference( - name=resource_object.properties.destination_name, - version=resource_object.properties.destination_version, - asset_id=resource_object.properties.source_asset_id, + name=properties.get("destinationName"), + version=properties.get("destinationVersion"), + asset_id=properties.get("sourceAssetId"), ) return resource_management diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 5a4c3e4be192..37cc544e696b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -53,6 +53,7 @@ from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( begin_create_or_update_registry_versioned_asset, + begin_import_registry_asset, get_asset_body_for_registry_storage, get_registry_client, get_registry_container_asset, @@ -361,11 +362,12 @@ def create_or_update(self, data: Data) -> Data: error_category=ErrorCategory.USER_ERROR, ) data_res_obj = data._to_rest_object() - result = self._service_client.resource_management_asset_reference.begin_import_method( - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, - body=data_res_obj, - ).result() + result = begin_import_registry_asset( + self._registry_service_client, + self._resource_group_name, + self._registry_name, + data_res_obj, + ) if not result: data_res_obj = self._get(name=data.name, version=data.version) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index b93c72602d76..f5d2abe44940 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -33,6 +33,7 @@ from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( begin_create_or_update_registry_versioned_asset, + begin_import_registry_asset, get_asset_body_for_registry_storage, get_registry_client, get_registry_container_asset, @@ -155,12 +156,12 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig ) environment_rest = environment._to_rest_object() - result = self._service_client.resource_management_asset_reference.begin_import_method( - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, - body=environment_rest, - **self._kwargs, - ).result() + result = begin_import_registry_asset( + self._registry_service_client, + self._resource_group_name, + self._registry_name, + environment_rest, + ) if not result: env_rest_obj = self._get(name=environment.name, version=environment.version) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index a791bb96b9fb..e830cf694d81 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -47,6 +47,7 @@ from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( + begin_import_registry_asset, get_asset_body_for_registry_storage, get_registry_client, get_sas_uri_for_registry_asset, @@ -226,11 +227,12 @@ def create_or_update( # type: ignore ) model_rest = model._to_rest_object() - result = self._service_client.resource_management_asset_reference.begin_import_method( - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, - body=model_rest, - ).result() + result = begin_import_registry_asset( + self._registry_service_client, + self._resource_group_name, + self._registry_name, + model_rest, + ) if not result: model_rest_obj = self._get(name=str(model.name), version=model.version) From 62045eb2670f77b40a8fabdb19395864e28d958f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 11:49:04 +0530 Subject: [PATCH 075/146] Migrate registry model get/list/existence-check to arm-MFE send_request; make Model._from_rest_object arm-hybrid robust --- .../ml/entities/_assets/_artifacts/model.py | 55 +++++++-------- .../ai/ml/operations/_model_operations.py | 68 +++++++++++++------ 2 files changed, 74 insertions(+), 49 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index 660b62281683..17bde0375388 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -1,6 +1,7 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +from collections.abc import Mapping from os import PathLike from pathlib import Path from typing import Any, Dict, List, Optional, Union @@ -161,41 +162,37 @@ def _from_rest_object(cls, model_rest_object: Union[ModelVersion, ModelVersionDa if hasattr(rest_model_version, "flavors"): flavors = {key: flavor.data for key, flavor in rest_model_version.flavors.items()} - # Handle default_deployment_template from REST object + # Handle default_deployment_template from REST object (attribute for msrest models, camelCase mapping key for + # arm hybrid models returned by the registry data-plane). default_deployment_template = None - if ( - hasattr(rest_model_version, "default_deployment_template") - and rest_model_version.default_deployment_template - ): - # REST object has default_deployment_template as a dict with 'asset_id' key - if isinstance(rest_model_version.default_deployment_template, dict): + _ddt = getattr(rest_model_version, "default_deployment_template", None) + if _ddt is None and isinstance(rest_model_version, Mapping): + _ddt = rest_model_version.get("defaultDeploymentTemplate") + if _ddt: + if isinstance(_ddt, dict): default_deployment_template = DeploymentTemplateReference( - asset_id=rest_model_version.default_deployment_template.get("asset_id") + asset_id=_ddt.get("asset_id") or _ddt.get("assetId") ) else: # Handle case where it's already an object with asset_id attribute - default_deployment_template = DeploymentTemplateReference( - asset_id=getattr(rest_model_version.default_deployment_template, "asset_id", None) - ) + default_deployment_template = DeploymentTemplateReference(asset_id=getattr(_ddt, "asset_id", None)) # Handle allowed_deployment_templates from REST object allowed_deployment_templates = None - if ( - hasattr(rest_model_version, "allowed_deployment_templates") - and rest_model_version.allowed_deployment_templates - ): - raw_list = rest_model_version.allowed_deployment_templates - if isinstance(raw_list, list): - allowed_deployment_templates = [] - for item in raw_list: - if isinstance(item, dict): - allowed_deployment_templates.append( - DeploymentTemplateReference(asset_id=item.get("asset_id") or item.get("assetId")) - ) - else: - allowed_deployment_templates.append( - DeploymentTemplateReference(asset_id=getattr(item, "asset_id", None)) - ) + _adt = getattr(rest_model_version, "allowed_deployment_templates", None) + if _adt is None and isinstance(rest_model_version, Mapping): + _adt = rest_model_version.get("allowedDeploymentTemplates") + if _adt and isinstance(_adt, list): + allowed_deployment_templates = [] + for item in _adt: + if isinstance(item, dict): + allowed_deployment_templates.append( + DeploymentTemplateReference(asset_id=item.get("asset_id") or item.get("assetId")) + ) + else: + allowed_deployment_templates.append( + DeploymentTemplateReference(asset_id=getattr(item, "asset_id", None)) + ) model = Model( id=model_rest_object.id, @@ -212,8 +209,8 @@ def _from_rest_object(cls, model_rest_object: Union[ModelVersion, ModelVersionDa type=rest_model_version.model_type, job_name=rest_model_version.job_name, intellectual_property=( - IntellectualProperty._from_rest_object(rest_model_version.intellectual_property) - if rest_model_version.intellectual_property + IntellectualProperty._from_rest_object(getattr(rest_model_version, "intellectual_property", None)) + if getattr(rest_model_version, "intellectual_property", None) else None ), system_metadata=model_system_metadata, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index e830cf694d81..25ab297d8c68 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -29,6 +29,8 @@ from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData from azure.ai.ml._restclient.arm_ml_service.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ModelContainer as ArmModelContainer +from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion from azure.ai.ml._restclient.v2023_08_01_preview.models import ModelVersion from azure.ai.ml._scope_dependent_operations import ( OperationConfig, @@ -50,8 +52,11 @@ begin_import_registry_asset, get_asset_body_for_registry_storage, get_registry_client, + get_registry_container_asset, + get_registry_versioned_asset, get_sas_uri_for_registry_asset, get_storage_details_for_registry_assets, + list_registry_assets, ) from azure.ai.ml._utils._storage_utils import get_ds_name_and_path_prefix, get_storage_client from azure.ai.ml._utils.utils import _is_evaluator, resolve_short_datastore_url, validate_ml_flow_folder @@ -206,11 +211,13 @@ def create_or_update( # type: ignore if isinstance(model, WorkspaceAssetReference): # verify that model is not already in registry try: - self._model_versions_operation.get( - name=model.name, - version=model.version, - resource_group_name=self._resource_group_name, - registry_name=self._registry_name, + get_registry_versioned_asset( + self._registry_service_client, + "models", + model.name, + model.version, + self._resource_group_name, + self._registry_name, ) except Exception as err: # pylint: disable=W0718 if isinstance(err, ResourceNotFoundError): @@ -331,14 +338,28 @@ def _begin_create_or_update_registry_model(self, name, version, model_version_re def _get_with_registry(self, name: str, version: Optional[str] = None) -> ModelVersionData: # name:latest if version: - return self._model_versions_operation.get( - name=name, - version=version, - registry_name=self._registry_name, - **self._scope_kwargs, + return ArmModelVersion._deserialize( + get_registry_versioned_asset( + self._registry_service_client, + "models", + name, + version, + self._resource_group_name, + self._registry_name, + ), + [], ) - return self._model_container_operation.get(name=name, registry_name=self._registry_name, **self._scope_kwargs) + return ArmModelContainer._deserialize( + get_registry_container_asset( + self._registry_service_client, + "models", + name, + self._resource_group_name, + self._registry_name, + ), + [], + ) def _get_with_workspace(self, name: str, version: Optional[str] = None) -> ModelVersion: # name:latest if version: @@ -579,11 +600,14 @@ def list( return cast( Iterable[Model], ( - self._model_versions_operation.list( - name=name, - registry_name=self._registry_name, - cls=lambda objs: [Model._from_rest_object(obj) for obj in objs], - **self._scope_kwargs, + list_registry_assets( + self._registry_service_client, + "models", + name, + self._resource_group_name, + self._registry_name, + ArmModelVersion, + Model._from_rest_object, ) if self._registry_name else self._model_versions_operation.list( @@ -600,11 +624,15 @@ def list( return cast( Iterable[Model], ( - self._model_container_operation.list( - registry_name=self._registry_name, - cls=lambda objs: [Model._from_container_rest_object(obj) for obj in objs], + list_registry_assets( + self._registry_service_client, + "models", + None, + self._resource_group_name, + self._registry_name, + ArmModelContainer, + Model._from_container_rest_object, list_view_type=list_view_type, - **self._scope_kwargs, ) if self._registry_name else self._model_container_operation.list( From d31bd23e4c644336c7335ac5b120bc445d0e7092 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 11:58:33 +0530 Subject: [PATCH 076/146] Migrate registry evaluator list to byte-identical arm-MFE send_request; add properties filter to list helper --- .../azure/ai/ml/_utils/_registry_utils.py | 4 ++++ .../ai/ml/operations/_evaluator_operations.py | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index d9ab2a0f12f5..c9af1394d501 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -238,6 +238,7 @@ def list_registry_assets( arm_cls, from_rest_fn, list_view_type=None, + properties=None, ) -> ItemPaged: """Byte-identical registry versioned-asset / container list (same MFE endpoint + api-version + paging contract). @@ -250,6 +251,7 @@ def list_registry_assets( :param arm_cls: The arm hybrid model class to deserialize each response item into. :param from_rest_fn: Callable mapping a deserialized arm model to an SDK entity. :param list_view_type: Optional ``listViewType`` query value. + :param properties: Optional ``properties`` filter query value. :return: An iterator of SDK entities. :rtype: ~azure.core.paging.ItemPaged """ @@ -262,6 +264,8 @@ def list_registry_assets( params = {"api-version": REGISTRY_DATAPLANE_API_VERSION} if list_view_type is not None: params["listViewType"] = list_view_type + if properties is not None: + params["properties"] = properties def get_next(continuation_token=None): if continuation_token: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 37f1fea3235f..907a5ae3fc66 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -12,6 +12,7 @@ ) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -20,6 +21,7 @@ ) from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._logger_utils import OpsLogger +from azure.ai.ml._utils._registry_utils import list_registry_assets from azure.ai.ml._utils.utils import _get_evaluator_properties, _is_evaluator from azure.ai.ml.entities._assets import Model from azure.ai.ml.entities._assets.workspace_asset_reference import WorkspaceAssetReference @@ -181,12 +183,15 @@ def list( return cast( Iterable[Model], ( - self._model_op._model_versions_operation.list( - name=name, - registry_name=self._model_op._registry_name, - cls=lambda objs: [Model._from_rest_object(obj) for obj in objs], + list_registry_assets( + self._model_op._registry_service_client, + "models", + name, + self._model_op._resource_group_name, + self._model_op._registry_name, + ArmModelVersion, + Model._from_rest_object, properties=properties_str, - **self._model_op._scope_kwargs, ) if self._registry_name else self._model_op._model_versions_operation.list( From f6d2455bfc88a3cf43eb7b396d60a20a65ea1cba Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 12:01:01 +0530 Subject: [PATCH 077/146] Migrate registry model create Path B (model_versions) to byte-identical arm-MFE LRO --- .../ai/ml/operations/_model_operations.py | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 25ab297d8c68..2270a497824d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -49,6 +49,7 @@ from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_versioned_asset, begin_import_registry_asset, get_asset_body_for_registry_storage, get_registry_client, @@ -314,26 +315,39 @@ def create_or_update( # type: ignore def _begin_create_or_update_registry_model(self, name, version, model_version_resource, cont_token): # if continuation token is None and system_metadata attribute found # we need to send the system_metadata values in the request - return ( - self._model_dataplane_operation.begin_create_or_update_model_with_system_metadata( - subscription_id=self._operation_scope._subscription_id, - name=str(name), - version=str(version), - body=model_version_resource, - registry_name=self._registry_name, - **self._scope_kwargs, - ).result() - if self._registry_name + if ( + self._registry_name and cont_token is None and hasattr(model_version_resource.properties, "system_metadata") and self._model_dataplane_operation is not None - else self._model_versions_operation.begin_create_or_update( - name=name, - version=version, + ): + return self._model_dataplane_operation.begin_create_or_update_model_with_system_metadata( + subscription_id=self._operation_scope._subscription_id, + name=str(name), + version=str(version), body=model_version_resource, registry_name=self._registry_name, **self._scope_kwargs, ).result() + # Byte-identical to the legacy v2021_10 ``model_versions.begin_create_or_update`` on the MFE endpoint. The body + # may be a msrest ``ModelVersionData`` (deployment-template path) or an arm hybrid ``ModelVersion``; serialize the + # former to a wire dict so the shared LRO helper posts the identical payload. + body = ( + model_version_resource.serialize() + if hasattr(model_version_resource, "serialize") + else model_version_resource + ) + return ArmModelVersion._deserialize( + begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "models", + name, + version, + self._resource_group_name, + self._registry_name, + body, + ), + [], ) def _get_with_registry(self, name: str, version: Optional[str] = None) -> ModelVersionData: # name:latest From 3ed582157409de591b3d7bf0913b0053aab2759d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 12:16:21 +0530 Subject: [PATCH 078/146] Migrate registry container-version readers to byte-identical arm-MFE send_request --- .../azure/ai/ml/_utils/_asset_utils.py | 67 ++++++++++--------- .../ai/ml/operations/_component_operations.py | 2 + .../ml/operations/_environment_operations.py | 2 + .../ai/ml/operations/_model_operations.py | 2 + 4 files changed, 42 insertions(+), 31 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py index ae1b487518be..ec956eae2606 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py @@ -765,25 +765,27 @@ def _get_next_version_from_container( resource_group_name: str, workspace_name: str, registry_name: str = None, + registry_service_client: Any = None, + asset_plural: str = None, **kwargs, ) -> str: try: - container = ( - container_operation.get( - name=name, - resource_group_name=resource_group_name, - registry_name=registry_name, - **kwargs, + if registry_name: + # Byte-identical to the legacy v2021_10 registry container GET (same MFE endpoint + api-version). + from azure.ai.ml._utils._registry_utils import get_registry_container_asset + + container = get_registry_container_asset( + registry_service_client, asset_plural, name, resource_group_name, registry_name ) - if registry_name - else container_operation.get( + version = container["properties"]["nextVersion"] + else: + container = container_operation.get( name=name, resource_group_name=resource_group_name, workspace_name=workspace_name, **kwargs, ) - ) - version = container.properties.next_version + version = container.properties.next_version except ResourceNotFoundError: version = "1" @@ -796,26 +798,28 @@ def _get_next_latest_versions_from_container( resource_group_name: str, workspace_name: str, registry_name: str = None, + registry_service_client: Any = None, + asset_plural: str = None, **kwargs, ) -> str: try: - container = ( - container_operation.get( - name=name, - resource_group_name=resource_group_name, - registry_name=registry_name, - **kwargs, + if registry_name: + from azure.ai.ml._utils._registry_utils import get_registry_container_asset + + container = get_registry_container_asset( + registry_service_client, asset_plural, name, resource_group_name, registry_name ) - if registry_name - else container_operation.get( + next_version = container["properties"]["nextVersion"] + latest_version = container["properties"]["latestVersion"] + else: + container = container_operation.get( name=name, resource_group_name=resource_group_name, workspace_name=workspace_name, **kwargs, ) - ) - next_version = container.properties.next_version - latest_version = container.properties.latest_version + next_version = container.properties.next_version + latest_version = container.properties.latest_version except ResourceNotFoundError: next_version = "1" @@ -829,25 +833,26 @@ def _get_latest_version_from_container( resource_group_name: str, workspace_name: Optional[str] = None, registry_name: Optional[str] = None, + registry_service_client: Any = None, + asset_plural: str = None, **kwargs, ) -> str: try: - container = ( - container_operation.get( - name=asset_name, - resource_group_name=resource_group_name, - registry_name=registry_name, - **kwargs, + if registry_name: + from azure.ai.ml._utils._registry_utils import get_registry_container_asset + + container = get_registry_container_asset( + registry_service_client, asset_plural, asset_name, resource_group_name, registry_name ) - if registry_name - else container_operation.get( + version = container["properties"]["latestVersion"] + else: + container = container_operation.get( name=asset_name, resource_group_name=resource_group_name, workspace_name=workspace_name, **kwargs, ) - ) - version = container.properties.latest_version + version = container.properties.latest_version except ResourceNotFoundError as e: message = ( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index fc31756f50ab..0cad59522a80 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -637,6 +637,8 @@ def create_or_update( resource_group_name=self._operation_scope.resource_group_name, workspace_name=self._workspace_name, registry_name=self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="components", **self._init_args, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index f5d2abe44940..1ecef49e24e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -123,6 +123,8 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig resource_group_name=self._operation_scope.resource_group_name, workspace_name=self._workspace_name, registry_name=self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="environments", **self._kwargs, ) # If user not passing the version, SDK will try to update the latest version diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 2270a497824d..1f831d2c949d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -201,6 +201,8 @@ def create_or_update( # type: ignore resource_group_name=self._operation_scope.resource_group_name, workspace_name=self._workspace_name, registry_name=self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="models", ) version = model.version From fdaa8899d7a57fea329ba5e50b25c478b289537c Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 12:20:32 +0530 Subject: [PATCH 079/146] Migrate registry _get_latest + latest-version-from-container to byte-identical arm-MFE send_request --- .../azure/ai/ml/_utils/_asset_utils.py | 26 ++++++++++++------- .../azure/ai/ml/_utils/_registry_utils.py | 6 +++++ .../ai/ml/operations/_component_operations.py | 3 +++ .../ai/ml/operations/_data_operations.py | 2 ++ .../ml/operations/_environment_operations.py | 3 +++ .../ai/ml/operations/_model_operations.py | 3 +++ 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py index ec956eae2606..e9d2e2aff8bd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py @@ -882,6 +882,9 @@ def _get_latest( workspace_name: Optional[str] = None, registry_name: Optional[str] = None, order_by: Literal[OrderString.CREATED_AT, OrderString.CREATED_AT_DESC] = OrderString.CREATED_AT_DESC, + registry_service_client: Any = None, + asset_plural: str = None, + arm_cls: Any = None, **kwargs, ) -> Union[ModelVersionData, DataVersionBaseData]: """Retrieve the latest version of the asset with the given name. @@ -903,17 +906,23 @@ def _get_latest( :return: The latest version of the requested asset :rtype: Union[ModelVersionData, DataVersionBaseData] """ - result = ( - version_operation.list( - name=asset_name, - resource_group_name=resource_group_name, - registry_name=registry_name, + if registry_name: + # Byte-identical to the legacy v2021_10 registry version list ($orderBy + $top=1 on the MFE endpoint). + from azure.ai.ml._utils._registry_utils import list_registry_assets + + result = list_registry_assets( + registry_service_client, + asset_plural, + asset_name, + resource_group_name, + registry_name, + arm_cls, + lambda x: x, order_by=order_by, top=1, - **kwargs, ) - if registry_name - else version_operation.list( + else: + result = version_operation.list( name=asset_name, resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -921,7 +930,6 @@ def _get_latest( top=1, **kwargs, ) - ) try: latest = result.next() except StopIteration: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index c9af1394d501..09b71a6279bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -239,6 +239,8 @@ def list_registry_assets( from_rest_fn, list_view_type=None, properties=None, + order_by=None, + top=None, ) -> ItemPaged: """Byte-identical registry versioned-asset / container list (same MFE endpoint + api-version + paging contract). @@ -266,6 +268,10 @@ def list_registry_assets( params["listViewType"] = list_view_type if properties is not None: params["properties"] = properties + if order_by is not None: + params["$orderBy"] = order_by + if top is not None: + params["$top"] = top def get_next(continuation_token=None): if continuation_token: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index 0cad59522a80..acced8a0d88c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -802,6 +802,9 @@ def _get_latest_version(self, component_name: str) -> Component: self._resource_group_name, workspace_name=None, registry_name=self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="components", + arm_cls=ComponentVersion, ) if self._registry_name else _get_latest( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 37cc544e696b..ebc43cc2e596 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -705,6 +705,8 @@ def _get_latest_version(self, name: str) -> Data: self._resource_group_name, self._workspace_name, self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="data", ) return self.get(name, version=latest_version) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index 1ecef49e24e0..b71abe3a31fd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -504,6 +504,9 @@ def _get_latest_version(self, name: str) -> Environment: self._resource_group_name, self._workspace_name, self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="environments", + arm_cls=EnvironmentVersion, ) return Environment._from_rest_object(result) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 1f831d2c949d..549dce99aaf1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -718,6 +718,9 @@ def _get_latest_version(self, name: str) -> Model: self._resource_group_name, self._workspace_name, self._registry_name, + registry_service_client=self._registry_service_client, + asset_plural="models", + arm_cls=ArmModelVersion, ) return Model._from_rest_object(result) From 1cd716848fb630f8a5c90a532e86648c18316fc6 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 12:24:43 +0530 Subject: [PATCH 080/146] Migrate registry archive/restore (_archive_or_restore) to byte-identical arm-MFE send_request; add container create LRO helper --- .../azure/ai/ml/_utils/_asset_utils.py | 97 +++++++++++-------- .../azure/ai/ml/_utils/_registry_utils.py | 51 ++++++++++ .../ai/ml/operations/_component_operations.py | 6 ++ .../ai/ml/operations/_data_operations.py | 6 ++ .../ml/operations/_environment_operations.py | 6 ++ .../ai/ml/operations/_model_operations.py | 6 ++ 6 files changed, 131 insertions(+), 41 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py index e9d2e2aff8bd..0b5e25de311b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py @@ -982,10 +982,14 @@ def _archive_or_restore( name: str, version: Optional[str] = None, label: Optional[str] = None, + asset_plural: str = None, + version_arm_cls: Any = None, + container_arm_cls: Any = None, ) -> None: resource_group_name = asset_operations._operation_scope._resource_group_name workspace_name = asset_operations._workspace_name registry_name = asset_operations._registry_name + registry_service_client = getattr(asset_operations, "_registry_service_client", None) if version and label: msg = "Cannot specify both version and label." raise ValidationException( @@ -999,70 +1003,81 @@ def _archive_or_restore( version = _resolve_label_to_asset(asset_operations, name, label).version if version: - version_resource = ( - version_operation.get( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, + if registry_name: + # Byte-identical registry version archive/restore: GET -> mutate is_archived/stage -> PUT (all on MFE). + from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_versioned_asset, + get_registry_versioned_asset, ) - if registry_name - else version_operation.get( - name=name, - version=version, - resource_group_name=resource_group_name, - workspace_name=workspace_name, + + version_resource = version_arm_cls._deserialize( + get_registry_versioned_asset( + registry_service_client, asset_plural, name, version, resource_group_name, registry_name + ), + [], ) - ) - version_resource.properties.is_archived = is_archived - version_resource.properties.stage = None - ( # pylint: disable=expression-not-assigned - version_operation.begin_create_or_update( + version_resource.properties.is_archived = is_archived + version_resource.properties.stage = None + begin_create_or_update_registry_versioned_asset( + registry_service_client, + asset_plural, + name, + version, + resource_group_name, + registry_name, + version_resource, + ) + else: + version_resource = version_operation.get( name=name, version=version, resource_group_name=resource_group_name, - registry_name=registry_name, - body=version_resource, + workspace_name=workspace_name, ) - if registry_name - else version_operation.create_or_update( + version_resource.properties.is_archived = is_archived + version_resource.properties.stage = None + version_operation.create_or_update( name=name, version=version, resource_group_name=resource_group_name, workspace_name=workspace_name, body=version_resource, ) - ) else: - container_resource = ( - container_operation.get( - name=name, - resource_group_name=resource_group_name, - registry_name=registry_name, + if registry_name: + from azure.ai.ml._utils._registry_utils import ( + begin_create_or_update_registry_container, + get_registry_container_asset, ) - if registry_name - else container_operation.get( - name=name, - resource_group_name=resource_group_name, - workspace_name=workspace_name, + + container_resource = container_arm_cls._deserialize( + get_registry_container_asset( + registry_service_client, asset_plural, name, resource_group_name, registry_name + ), + [], ) - ) - container_resource.properties.is_archived = is_archived - ( # pylint: disable=expression-not-assigned - container_operation.begin_create_or_update( + container_resource.properties.is_archived = is_archived + begin_create_or_update_registry_container( + registry_service_client, + asset_plural, + name, + resource_group_name, + registry_name, + container_resource, + ) + else: + container_resource = container_operation.get( name=name, resource_group_name=resource_group_name, - registry_name=registry_name, - body=container_resource, + workspace_name=workspace_name, ) - if registry_name - else container_operation.create_or_update( + container_resource.properties.is_archived = is_archived + container_operation.create_or_update( name=name, resource_group_name=resource_group_name, workspace_name=workspace_name, body=container_resource, ) - ) def _resolve_label_to_asset( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 09b71a6279bc..10d460139936 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -358,6 +358,57 @@ def get_long_running_output(pipeline_response): return poller +def begin_create_or_update_registry_container( + service_client, asset_plural: str, name, resource_group, registry_name, body, *, polling_interval=None, wait=True +): + """Byte-identical registry container create-or-update LRO (``.../registries/{registry}/{plural}/{name}``). + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param asset_plural: The plural asset segment of the URL (e.g. ``codes``, ``models``, ``data``, ``environments``). + :type asset_plural: str + :param name: Container name. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :param body: The arm hybrid container model to serialize as the request body. + :keyword polling_interval: Optional poll interval override. + :keyword wait: When ``True`` (default) the LRO is awaited and the final body dict returned. + :return: The raw camelCase final response body, or the ``LROPoller`` when ``wait`` is ``False``. + :rtype: dict or ~azure.core.polling.LROPoller + """ + subscription_id = service_client._config.subscription_id + content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) + request = HttpRequest( + "PUT", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}" + f"/{asset_plural}/{name}", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + content=content, + ) + path_format_arguments = { + "endpoint": service_client._serialize.url( + "self._config.base_url", service_client._config.base_url, "str", skip_quote=True + ), + } + request.url = service_client._client.format_url(request.url, **path_format_arguments) + raw_result = service_client._client._pipeline.run(request, stream=True) + response = raw_result.http_response + response.read() + if response.status_code not in [200, 201]: + response.raise_for_status() + + def get_long_running_output(pipeline_response): + return pipeline_response.http_response.json() + + interval = polling_interval if polling_interval is not None else service_client._config.polling_interval + polling_method = ARMPolling(interval, path_format_arguments=path_format_arguments) + poller = LROPoller(service_client._client, raw_result, get_long_running_output, polling_method) + if wait: + return poller.result() + return poller + + def begin_import_registry_asset( service_client, resource_group, registry_name, body, *, polling_cls=ARMPolling, polling_interval=None, wait=True ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index acced8a0d88c..72b7b61d2c3b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -744,6 +744,9 @@ def archive( name=name, version=version, label=label, + asset_plural="components", + version_arm_cls=ComponentVersion, + container_arm_cls=ComponentContainer, ) @monitor_with_telemetry_mixin(ops_logger, "Component.Restore", ActivityType.PUBLICAPI) @@ -781,6 +784,9 @@ def restore( name=name, version=version, label=label, + asset_plural="components", + version_arm_cls=ComponentVersion, + container_arm_cls=ComponentContainer, ) def _get_latest_version(self, component_name: str) -> Component: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index ebc43cc2e596..e126f790a929 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -649,6 +649,9 @@ def archive( name=name, version=version, label=label, + asset_plural="data", + version_arm_cls=DataVersionBase, + container_arm_cls=DataContainer, ) @monitor_with_activity(ops_logger, "Data.Restore", ActivityType.PUBLICAPI) @@ -688,6 +691,9 @@ def restore( name=name, version=version, label=label, + asset_plural="data", + version_arm_cls=DataVersionBase, + container_arm_cls=DataContainer, ) def _get_latest_version(self, name: str) -> Data: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index b71abe3a31fd..4974cab21c53 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -447,6 +447,9 @@ def archive( name=name, version=version, label=label, + asset_plural="environments", + version_arm_cls=EnvironmentVersion, + container_arm_cls=EnvironmentContainer, ) @monitor_with_activity(ops_logger, "Environment.Restore", ActivityType.PUBLICAPI) @@ -485,6 +488,9 @@ def restore( name=name, version=version, label=label, + asset_plural="environments", + version_arm_cls=EnvironmentVersion, + container_arm_cls=EnvironmentContainer, ) def _get_latest_version(self, name: str) -> Environment: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 549dce99aaf1..b0a18feb31ff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -554,6 +554,9 @@ def archive( name=name, version=version, label=label, + asset_plural="models", + version_arm_cls=ArmModelVersion, + container_arm_cls=ArmModelContainer, ) @monitor_with_activity(ops_logger, "Model.Restore", ActivityType.PUBLICAPI) @@ -590,6 +593,9 @@ def restore( name=name, version=version, label=label, + asset_plural="models", + version_arm_cls=ArmModelVersion, + container_arm_cls=ArmModelContainer, ) @monitor_with_activity(ops_logger, "Model.List", ActivityType.PUBLICAPI) From c2d3d61cbc06d000888963d06fd5a6ad14def91d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 14:14:09 +0530 Subject: [PATCH 081/146] Flip registry asset ops to the arm-MFE client; fix missing registry_service_client on evaluator --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 54e80bbd1f48..44b39cb3749c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -549,7 +549,7 @@ def __init__( self._operation_scope, self._operation_config, ( - self._service_client_10_2021_dataplanepreview + self._service_client_registry_arm if registry_name or registry_reference else self._service_client_08_2023_preview ), @@ -568,7 +568,7 @@ def __init__( self._operation_scope, self._operation_config, ( - self._service_client_10_2021_dataplanepreview + self._service_client_registry_arm if registry_name or registry_reference else self._service_client_08_2023_preview ), @@ -578,6 +578,7 @@ def __init__( control_plane_client=self._service_client_08_2023_preview, workspace_rg=self._ws_rg, workspace_sub=self._ws_sub, + registry_service_client=getattr(self, "_service_client_registry_arm", None), registry_reference=registry_reference, ) @@ -585,7 +586,7 @@ def __init__( self._code = CodeOperations( self._ws_operation_scope if registry_reference else self._operation_scope, self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023), + (self._service_client_registry_arm if registry_name else self._service_client_04_2023), self._datastores, registry_service_client=getattr(self, "_service_client_registry_arm", None), **ops_kwargs, # type: ignore[arg-type] @@ -594,7 +595,7 @@ def __init__( self._environments = EnvironmentOperations( self._ws_operation_scope if registry_reference else self._operation_scope, self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023_preview), + (self._service_client_registry_arm if registry_name else self._service_client_04_2023_preview), self._operation_container, registry_service_client=getattr(self, "_service_client_registry_arm", None), **ops_kwargs, # type: ignore[arg-type] @@ -656,7 +657,7 @@ def __init__( self._data = DataOperations( self._ws_operation_scope if registry_reference else self._operation_scope, self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023_preview), + (self._service_client_registry_arm if registry_name else self._service_client_04_2023_preview), self._datastores, requests_pipeline=self._requests_pipeline, all_operations=self._operation_container, @@ -667,11 +668,7 @@ def __init__( self._components = ComponentOperations( self._operation_scope, self._operation_config, - ( - self._service_client_10_2021_dataplanepreview - if registry_name - else self._service_client_01_2024_preview_arm - ), + (self._service_client_registry_arm if registry_name else self._service_client_01_2024_preview_arm), self._operation_container, self._preflight, registry_service_client=getattr(self, "_service_client_registry_arm", None), From 0adf574635471920bbe92e9a4cf9d91cd5a1710a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 14:16:43 +0530 Subject: [PATCH 082/146] Drop unused v2021_10 client imports + type hints from asset ops (registry now on arm-MFE client) --- .../azure-ai-ml/azure/ai/ml/operations/_code_operations.py | 5 +---- .../azure/ai/ml/operations/_component_operations.py | 5 +---- .../azure-ai-ml/azure/ai/ml/operations/_data_operations.py | 5 +---- .../azure/ai/ml/operations/_environment_operations.py | 5 +---- .../azure/ai/ml/operations/_evaluator_operations.py | 5 +---- .../azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 5 +---- 6 files changed, 6 insertions(+), 24 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index c4354fb1dc7e..f9978a80a3c9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -20,9 +20,6 @@ CHANGED_ASSET_PATH_MSG_NO_PERSONAL_DATA, ) from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023 from azure.ai.ml._restclient.arm_ml_service.models import CodeVersion as CodeVersionData from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations @@ -81,7 +78,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient102021Dataplane, ServiceClient042023], + service_client: ServiceClient042023, datastore_operations: DatastoreOperations, **kwargs: Dict, ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index 72b7b61d2c3b..ab48d031646b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -14,9 +14,6 @@ from pathlib import Path from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union, cast -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient012024 from azure.ai.ml._restclient.arm_ml_service.models import ComponentContainer, ComponentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( @@ -105,7 +102,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient012024, ServiceClient102021Dataplane], + service_client: ServiceClient012024, all_operations: OperationsContainer, preflight_operation: Optional[DeploymentsOperations] = None, **kwargs: Dict, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index e126f790a929..287da491d4aa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -21,9 +21,6 @@ CHANGED_ASSET_PATH_MSG_NO_PERSONAL_DATA, ) from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023_preview from azure.ai.ml._restclient.arm_ml_service.models import DataContainer, DataVersionBase, ListViewType from azure.ai.ml._scope_dependent_operations import ( @@ -117,7 +114,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient042023_preview, ServiceClient102021Dataplane], + service_client: ServiceClient042023_preview, datastore_operations: DatastoreOperations, **kwargs: Any, ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index 4974cab21c53..f7c72e7a585c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -11,9 +11,6 @@ from azure.ai.ml._artifacts._artifact_utilities import _check_and_upload_env_build_context from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023Preview from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentContainer, EnvironmentVersion, ListViewType from azure.ai.ml._scope_dependent_operations import ( @@ -75,7 +72,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient042023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient042023Preview, all_operations: OperationsContainer, **kwargs: Any, ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 907a5ae3fc66..3671702536c2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -7,9 +7,6 @@ from os import PathLike from typing import Any, Dict, Iterable, Optional, Union, cast -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion @@ -63,7 +60,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient082023Preview, datastore_operations: DatastoreOperations, all_operations: Optional[OperationsContainer] = None, **kwargs, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index b0a18feb31ff..a3630370051b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -23,9 +23,6 @@ ) from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData from azure.ai.ml._restclient.arm_ml_service.models import ListViewType @@ -113,7 +110,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient082023Preview, datastore_operations: DatastoreOperations, service_client_model_dataplane: ServiceClientModelDataPlane = None, all_operations: Optional[OperationsContainer] = None, From 2667f26b81426a61fbf207f4b443e662d6478f7c Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 14:23:57 +0530 Subject: [PATCH 083/146] Drop v2021_10 ModelVersionData annotations from model operations (use arm ModelVersion) --- .../azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index a3630370051b..bf4db964fb83 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -24,7 +24,6 @@ from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelContainer as ArmModelContainer from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion @@ -349,7 +348,7 @@ def _begin_create_or_update_registry_model(self, name, version, model_version_re [], ) - def _get_with_registry(self, name: str, version: Optional[str] = None) -> ModelVersionData: # name:latest + def _get_with_registry(self, name: str, version: Optional[str] = None) -> ArmModelVersion: # name:latest if version: return ArmModelVersion._deserialize( get_registry_versioned_asset( @@ -385,7 +384,7 @@ def _get_with_workspace(self, name: str, version: Optional[str] = None) -> Model return self._model_container_operation.get(name=name, workspace_name=self._workspace_name, **self._scope_kwargs) - def _get(self, name: str, version: Optional[str] = None) -> Union[ModelVersion, ModelVersionData]: # name:latest + def _get(self, name: str, version: Optional[str] = None) -> Union[ModelVersion, ArmModelVersion]: # name:latest if self._registry_name: return self._get_with_registry(name, version) return self._get_with_workspace(name, version) From acb6c0d63b28c7f8199935ca2f1bb36dd4397da4 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 14:32:30 +0530 Subject: [PATCH 084/146] Migrate Model._to_rest_object off v2021_10 to arm (byte-identical template wire); fix model_dataplane Path A arm-body serialization --- .../model_dataplane/operations/_patch.py | 9 +++- .../ml/entities/_assets/_artifacts/model.py | 54 ++++++------------- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_patch.py index 5d61b05e84d7..7e421049aa19 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_patch.py @@ -69,7 +69,14 @@ def _begin_create_or_update_model_with_system_metadata( error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {})) - _json = self._serialize.body(body, "ModelVersionData") + # ``body`` is an arm_ml_service hybrid ``ModelVersion``. Serialize it to the camelCase wire dict, then inject the + # ``system_metadata`` value under the snake_case ``properties.system_metadata`` key (byte-identical to the legacy + # behavior, which serialized a msrest ``ModelVersionData`` and then set the same snake_case key). + import json as _json_mod + + from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder + + _json = _json_mod.loads(_json_mod.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)) _json["properties"]["system_metadata"] = body.properties.system_metadata request = _build_create_or_update_model_with_system_metadata_request( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index 17bde0375388..2805d4fbc609 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -6,11 +6,6 @@ from pathlib import Path from typing import Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ( - ModelVersionData, - ModelVersionDefaultDeploymentTemplate, - ModelVersionDetails, -) from azure.ai.ml._restclient.arm_ml_service.models import ( FlavorData, ModelContainer, @@ -152,8 +147,8 @@ def _to_dict(self) -> Dict: return dict(ModelSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) @classmethod - def _from_rest_object(cls, model_rest_object: Union[ModelVersion, ModelVersionData]) -> "Model": - rest_model_version: Union[ModelVersionProperties, ModelVersionDetails] = model_rest_object.properties + def _from_rest_object(cls, model_rest_object: ModelVersion) -> "Model": + rest_model_version: ModelVersionProperties = model_rest_object.properties arm_id = AMLVersionedArmId(arm_id=model_rest_object.id) model_stage = rest_model_version.stage if hasattr(rest_model_version, "stage") else None model_system_metadata = ( @@ -235,36 +230,12 @@ def _from_container_rest_object(cls, model_container_rest_object: ModelContainer model.version = None return model - def _to_rest_object(self) -> Union[ModelVersionData, ModelVersion]: - if self.default_deployment_template or self.allowed_deployment_templates: - model_version = ModelVersionDetails( - description=self.description, - tags=self.tags, - properties=self.properties, - flavors=( - {key: FlavorData(data=dict(value)) for key, value in self.flavors.items()} if self.flavors else None - ), - model_type=self.type, - model_uri=self.path, - stage=self.stage, - is_anonymous=self._is_anonymous or False, - is_archived=False, - ) - model_version.system_metadata = self._system_metadata if hasattr(self, "_system_metadata") else None - - if self.default_deployment_template: - model_version.default_deployment_template = ModelVersionDefaultDeploymentTemplate( - asset_id=self.default_deployment_template.asset_id - ) - if self.allowed_deployment_templates: - model_version.allowed_deployment_templates = [ - ModelVersionDefaultDeploymentTemplate(asset_id=adt.asset_id) - for adt in self.allowed_deployment_templates - ] - model_version_resource = ModelVersionData(properties=model_version) - - return model_version_resource - + def _to_rest_object(self) -> ModelVersion: + # arm ModelVersion for all cases. arm lacks the registry deployment-template fields, so carry them as camelCase + # wire keys (byte-identical to the legacy v2021_10 ``ModelVersionData``). NOTE: the legacy v2021_10 + # ``ModelVersionDetails`` had NO ``stage`` field, so models WITH deployment templates dropped ``stage`` on the + # wire; that quirk is preserved by omitting ``stage`` when a deployment template is present. + has_deployment_template = bool(self.default_deployment_template or self.allowed_deployment_templates) model_version = ModelVersionProperties( description=self.description, tags=self.tags, @@ -274,12 +245,19 @@ def _to_rest_object(self) -> Union[ModelVersionData, ModelVersion]: ), # flatten OrderedDict to dict model_type=self.type, model_uri=self.path, - stage=self.stage, + stage=None if has_deployment_template else self.stage, is_anonymous=self._is_anonymous or False, is_archived=False, ) model_version.system_metadata = self._system_metadata if hasattr(self, "_system_metadata") else None + if self.default_deployment_template: + model_version["defaultDeploymentTemplate"] = {"assetId": self.default_deployment_template.asset_id} + if self.allowed_deployment_templates: + model_version["allowedDeploymentTemplates"] = [ + {"assetId": adt.asset_id} for adt in self.allowed_deployment_templates + ] + model_version_resource = ModelVersion(properties=model_version) return model_version_resource From 9861b0b6c7b80fe2211ccefa1ab39681aef7db43 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 15:13:58 +0530 Subject: [PATCH 085/146] Keep model/evaluator on v2021_10 client until registry begin_package migrated (unbreak registry package) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 4 ++-- .../azure/ai/ml/operations/_evaluator_operations.py | 5 ++++- .../azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 44b39cb3749c..3c773a961b73 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -549,7 +549,7 @@ def __init__( self._operation_scope, self._operation_config, ( - self._service_client_registry_arm + self._service_client_10_2021_dataplanepreview if registry_name or registry_reference else self._service_client_08_2023_preview ), @@ -568,7 +568,7 @@ def __init__( self._operation_scope, self._operation_config, ( - self._service_client_registry_arm + self._service_client_10_2021_dataplanepreview if registry_name or registry_reference else self._service_client_08_2023_preview ), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 3671702536c2..907a5ae3fc66 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -7,6 +7,9 @@ from os import PathLike from typing import Any, Dict, Iterable, Optional, Union, cast +from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( + AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, +) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion @@ -60,7 +63,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: ServiceClient082023Preview, + service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], datastore_operations: DatastoreOperations, all_operations: Optional[OperationsContainer] = None, **kwargs, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index bf4db964fb83..fa011c363781 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -23,6 +23,9 @@ ) from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane +from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( + AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, +) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelContainer as ArmModelContainer @@ -109,7 +112,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: ServiceClient082023Preview, + service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], datastore_operations: DatastoreOperations, service_client_model_dataplane: ServiceClientModelDataPlane = None, all_operations: Optional[OperationsContainer] = None, From 0d812d89c427436392caec5f784ce57510eb0454 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 15:25:06 +0530 Subject: [PATCH 086/146] Migrate registry model begin_package to byte-identical arm-MFE send_request LRO --- .../azure/ai/ml/_utils/_package_utils.py | 6 ++- .../azure/ai/ml/_utils/_registry_utils.py | 46 +++++++++++++++++++ .../ai/ml/operations/_model_operations.py | 29 +++++++----- 3 files changed, 68 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py index f50a61403aa9..89818a7f7af4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py @@ -91,7 +91,11 @@ def package_deployment(deployment: Deployment, model_ops) -> Deployment: if not model_str.startswith(REGISTRY_URI_FORMAT): deployment.environment = packaged_env.id else: - deployment.environment = packaged_env.target_environment_id + deployment.environment = ( + packaged_env.get("targetEnvironmentId") + if isinstance(packaged_env, dict) + else packaged_env.target_environment_id + ) deployment.model = None deployment.code_configuration = None except Exception: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 10d460139936..2031b1e07897 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -409,6 +409,52 @@ def get_long_running_output(pipeline_response): return poller +def begin_package_registry_model( + service_client, name, version, resource_group, registry_name, body, *, polling_interval=None +) -> dict: + """Byte-identical registry model ``begin_package`` LRO (POST ``.../models/{name}/versions/{version}/package``). + + :param service_client: The hybrid arm client bound to the registry MFE endpoint. + :param name: Model name. + :param version: Model version. + :param resource_group: Resource group name. + :param registry_name: Registry name. + :param body: The camelCase package-request wire dict. + :keyword polling_interval: Optional poll interval override. + :return: The raw camelCase final ``PackageResponse`` body. + :rtype: dict + """ + subscription_id = service_client._config.subscription_id + request = HttpRequest( + "POST", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/registries/{registry_name}" + f"/models/{name}/versions/{version}/package", + params={"api-version": REGISTRY_DATAPLANE_API_VERSION}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + json=body, + ) + path_format_arguments = { + "endpoint": service_client._serialize.url( + "self._config.base_url", service_client._config.base_url, "str", skip_quote=True + ), + } + request.url = service_client._client.format_url(request.url, **path_format_arguments) + raw_result = service_client._client._pipeline.run(request, stream=True) + response = raw_result.http_response + response.read() + if response.status_code not in [200, 201, 202]: + response.raise_for_status() + + def get_long_running_output(pipeline_response): + http_response = pipeline_response.http_response + return http_response.json() if http_response.text() else None + + interval = polling_interval if polling_interval is not None else service_client._config.polling_interval + polling_method = ARMPolling(interval, path_format_arguments=path_format_arguments) + return LROPoller(service_client._client, raw_result, get_long_running_output, polling_method).result() + + def begin_import_registry_asset( service_client, resource_group, registry_name, body, *, polling_cls=ARMPolling, polling_interval=None, wait=True ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index fa011c363781..61b51a50bb83 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -50,6 +50,7 @@ from azure.ai.ml._utils._registry_utils import ( begin_create_or_update_registry_versioned_asset, begin_import_registry_asset, + begin_package_registry_model, get_asset_body_for_registry_storage, get_registry_client, get_registry_container_asset, @@ -844,26 +845,30 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar if self._registry_reference: package_request.target_environment_id = f"azureml://locations/{self._operation_scope._workspace_location}/workspaces/{self._operation_scope._workspace_id}/environments/{package_request.target_environment_id}" - package_out = ( - self._model_versions_operation.begin_package( - name=name, - version=version, - registry_name=self._registry_name if self._registry_name else self._registry_reference, - body=package_request, - **self._scope_kwargs, - ).result() - if self._registry_name or self._registry_reference - else self._model_versions_operation.begin_package( + if self._registry_name or self._registry_reference: + # Byte-identical to the legacy v2021_10 registry ``begin_package`` (same MFE endpoint + api-version + wire body). + package_body = package_request.serialize() if hasattr(package_request, "serialize") else package_request + package_out = begin_package_registry_model( + self._registry_service_client, + name, + version, + self._resource_group_name, + self._registry_name if self._registry_name else self._registry_reference, + package_body, + ) + else: + package_out = self._model_versions_operation.begin_package( name=name, version=version, workspace_name=self._workspace_name, body=package_request, **self._scope_kwargs, ).result() - ) if is_deployment_flow: # No need to go through the schema, as this is for deployment notification only return package_out - if hasattr(package_out, "target_environment_id"): + if isinstance(package_out, dict): + environment_id = package_out.get("targetEnvironmentId") + elif hasattr(package_out, "target_environment_id"): environment_id = package_out.target_environment_id else: environment_id = package_out.additional_properties["targetEnvironmentId"] From de3509bd7a01190a514c1174d72c3b3382e41edd Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 15:29:09 +0530 Subject: [PATCH 087/146] Convert registry package request to byte-identical JSON-direct dict (drop v2021_10 DataPlanePackageRequest) --- .../azure/ai/ml/_utils/_package_utils.py | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py index 89818a7f7af4..7b781932bebb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py @@ -15,9 +15,6 @@ AzureMLOnlineInferencingServer, AzureMLBatchInferencingServer, ) -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ( - PackageRequest as DataPlanePackageRequest, -) from azure.ai.ml.constants._common import REGISTRY_URI_FORMAT from azure.ai.ml._utils._logger_utils import initialize_logger_info @@ -54,32 +51,36 @@ def package_deployment(deployment: Deployment, model_ops) -> Deployment: else: base_environment_source = None - package_request = ( - PackageRequest( + package_request: Any = None + is_registry = model_str.startswith(REGISTRY_URI_FORMAT) + + # Mutate the (shared v2023_04) nested models in place, then assemble the request. For a registry package the + # request envelope is a byte-identical JSON-direct dict (the legacy v2021_10 ``PackageRequest`` wire) so no + # v2021_10 model is required. + if deployment.environment: + base_environment_source.resource_id = ( + deployment.environment if is_registry else "azureml:/" + deployment.environment + ) + if deployment.code_configuration: + inferencing_server.code_configuration.code_id = ( + deployment.code_configuration.code + if deployment.code_configuration.code.startswith(REGISTRY_URI_FORMAT) + else "azureml:/" + deployment.code_configuration.code + ) + + if is_registry: + package_request = {} + if base_environment_source is not None: + package_request["baseEnvironmentSource"] = base_environment_source.serialize() + if inferencing_server is not None: + package_request["inferencingServer"] = inferencing_server.serialize() + package_request["targetEnvironmentId"] = target_environment_name + else: + package_request = PackageRequest( target_environment_name=target_environment_name, base_environment_source=base_environment_source, inferencing_server=inferencing_server, ) - if not model_str.startswith(REGISTRY_URI_FORMAT) - else DataPlanePackageRequest( - inferencing_server=inferencing_server, - target_environment_id=target_environment_name, - base_environment_source=base_environment_source, - ) - ) - - if deployment.environment: - if not model_str.startswith(REGISTRY_URI_FORMAT): - package_request.base_environment_source.resource_id = "azureml:/" + deployment.environment - else: - package_request.base_environment_source.resource_id = deployment.environment - if deployment.code_configuration: - if not deployment.code_configuration.code.startswith(REGISTRY_URI_FORMAT): - package_request.inferencing_server.code_configuration.code_id = ( - "azureml:/" + deployment.code_configuration.code - ) - else: - package_request.inferencing_server.code_configuration.code_id = deployment.code_configuration.code try: packaged_env = model_ops.package( From ca997b63c04e603e57e1c36b06b7337fd38457c6 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 15:31:31 +0530 Subject: [PATCH 088/146] Flip model/evaluator registry ops to arm-MFE client; drop v2021_10 client imports --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 4 ++-- .../azure/ai/ml/operations/_evaluator_operations.py | 5 +---- .../azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 3c773a961b73..44b39cb3749c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -549,7 +549,7 @@ def __init__( self._operation_scope, self._operation_config, ( - self._service_client_10_2021_dataplanepreview + self._service_client_registry_arm if registry_name or registry_reference else self._service_client_08_2023_preview ), @@ -568,7 +568,7 @@ def __init__( self._operation_scope, self._operation_config, ( - self._service_client_10_2021_dataplanepreview + self._service_client_registry_arm if registry_name or registry_reference else self._service_client_08_2023_preview ), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 907a5ae3fc66..3671702536c2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -7,9 +7,6 @@ from os import PathLike from typing import Any, Dict, Iterable, Optional, Union, cast -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion @@ -63,7 +60,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient082023Preview, datastore_operations: DatastoreOperations, all_operations: Optional[OperationsContainer] = None, **kwargs, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 61b51a50bb83..c2333b1740e5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -23,9 +23,6 @@ ) from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( - AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, -) from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelContainer as ArmModelContainer @@ -113,7 +110,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient082023Preview, datastore_operations: DatastoreOperations, service_client_model_dataplane: ServiceClientModelDataPlane = None, all_operations: Optional[OperationsContainer] = None, From 507fcd9a176b03fa28946dc8c366dbee8c167d47 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 15:35:00 +0530 Subject: [PATCH 089/146] Thread arm-MFE client into share-to-registry (_set_registry_client) so migrated registry paths use correct client --- .../azure-ai-ml/azure/ai/ml/operations/_data_operations.py | 5 ++++- .../azure/ai/ml/operations/_environment_operations.py | 5 ++++- .../azure-ai-ml/azure/ai/ml/operations/_model_operations.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 287da491d4aa..aa0697ce1437 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -906,16 +906,18 @@ def _set_registry_client(self, registry_name: str) -> Generator: sub_ = self._operation_scope._subscription_id registry_ = self._operation_scope.registry_name client_ = self._service_client + registry_service_client_ = self._registry_service_client data_versions_operation_ = self._operation try: - _client, _rg, _sub, _model_client, _ = get_registry_client( + _client, _rg, _sub, _model_client, _arm_client = get_registry_client( self._service_client._config.credential, registry_name ) self._operation_scope.registry_name = registry_name self._operation_scope._resource_group_name = _rg self._operation_scope._subscription_id = _sub self._service_client = _client + self._registry_service_client = _arm_client self._operation = _client.data_versions yield finally: @@ -923,6 +925,7 @@ def _set_registry_client(self, registry_name: str) -> Generator: self._operation_scope._resource_group_name = rg_ self._operation_scope._subscription_id = sub_ self._service_client = client_ + self._registry_service_client = registry_service_client_ self._operation = data_versions_operation_ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index f7c72e7a585c..a3547112c7ad 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -578,16 +578,18 @@ def _set_registry_client(self, registry_name: str) -> Generator: sub_ = self._operation_scope._subscription_id registry_ = self._operation_scope.registry_name client_ = self._service_client + registry_service_client_ = self._registry_service_client environment_versions_operation_ = self._version_operations try: - _client, _rg, _sub, _model_client, _ = get_registry_client( + _client, _rg, _sub, _model_client, _arm_client = get_registry_client( self._service_client._config.credential, registry_name ) self._operation_scope.registry_name = registry_name self._operation_scope._resource_group_name = _rg self._operation_scope._subscription_id = _sub self._service_client = _client + self._registry_service_client = _arm_client self._version_operations = _client.environment_versions yield finally: @@ -595,6 +597,7 @@ def _set_registry_client(self, registry_name: str) -> Generator: self._operation_scope._resource_group_name = rg_ self._operation_scope._subscription_id = sub_ self._service_client = client_ + self._registry_service_client = registry_service_client_ self._version_operations = environment_versions_operation_ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index c2333b1740e5..22fafda36d78 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -738,16 +738,18 @@ def _set_registry_client(self, registry_name: str) -> Generator: sub_ = self._operation_scope._subscription_id registry_ = self._operation_scope.registry_name client_ = self._service_client + registry_service_client_ = self._registry_service_client model_versions_operation_ = self._model_versions_operation try: - _client, _rg, _sub, _model_client, _ = get_registry_client( + _client, _rg, _sub, _model_client, _arm_client = get_registry_client( self._service_client._config.credential, registry_name ) self._operation_scope.registry_name = registry_name self._operation_scope._resource_group_name = _rg self._operation_scope._subscription_id = _sub self._service_client = _client + self._registry_service_client = _arm_client self._model_versions_operation = _client.model_versions yield finally: @@ -755,6 +757,7 @@ def _set_registry_client(self, registry_name: str) -> Generator: self._operation_scope._resource_group_name = rg_ self._operation_scope._subscription_id = sub_ self._service_client = client_ + self._registry_service_client = registry_service_client_ self._model_versions_operation = model_versions_operation_ @experimental From ece206d3de7f4e86498f98cdaad608030d8777f9 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 15:37:28 +0530 Subject: [PATCH 090/146] Stop building the v2021_10 msrest registry client; registry runs entirely on arm-MFE send_request --- .../azure/ai/ml/_utils/_registry_utils.py | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 2031b1e07897..99af8a9f1c5d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -12,7 +12,6 @@ from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane from azure.ai.ml._restclient.registry_discovery import RegistryDiscoveryClient as ServiceClientRegistryDiscovery -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import AzureMachineLearningWorkspaces from azure.ai.ml.constants._common import REGISTRY_ASSET_ID from azure.ai.ml.exceptions import MlException from azure.core.exceptions import HttpResponseError, ResourceNotFoundError @@ -62,24 +61,20 @@ def _get_registry_details(self) -> str: self._subscription_id = response.subscription_id self._resource_group = response.resource_group - def get_registry_service_client(self) -> AzureMachineLearningWorkspaces: - self._get_registry_details() + def get_registry_service_client(self) -> ServiceClientModelDataPlane: + # The registry data-plane control client is now the arm-MFE hybrid client (see get_registry_arm_service_client); + # this only builds the model-dataplane client used for the create-with-system-metadata path. + if self._base_url is None: + self._get_registry_details() self.kwargs.pop("subscription_id", None) self.kwargs.pop("resource_group", None) - service_client_10_2021_dataplanepreview = AzureMachineLearningWorkspaces( - subscription_id=self._subscription_id, - resource_group=self._resource_group, - credential=self.credential, - base_url=self._base_url, - **self.kwargs, - ) service_model_client_10_2021_dataplanepreview = ServiceClientModelDataPlane( credential=self.credential, subscription_id=self._subscription_id, base_url=self._base_url, **self.kwargs, ) - return service_client_10_2021_dataplanepreview, service_model_client_10_2021_dataplanepreview + return service_model_client_10_2021_dataplanepreview def get_registry_arm_service_client(self) -> MachineLearningServicesMgmtClient: """Build a hybrid arm_ml_service client bound to the discovered registry MFE endpoint. @@ -604,16 +599,14 @@ def get_registry_client(credential, registry_name, workspace_location: Optional[ registry_discovery = RegistryDiscovery( credential, registry_name, service_client_registry_discovery_client, **kwargs ) - service_client_10_2021_dataplanepreview, service_model_client_10_2021_dataplanepreview = ( - registry_discovery.get_registry_service_client() - ) - # Byte-identical hybrid client bound to the same discovered MFE endpoint + registry data-plane api-version. - # Registry consumers are being migrated off the msrest client above to this client's ``send_request``. + service_model_client_10_2021_dataplanepreview = registry_discovery.get_registry_service_client() + # Byte-identical hybrid client bound to the discovered MFE endpoint + registry data-plane api-version; all registry + # operations are driven through its ``send_request`` (the legacy v2021_10 msrest client is no longer built). service_client_registry_arm = registry_discovery.get_registry_arm_service_client() subscription_id = registry_discovery.subscription_id resource_group_name = registry_discovery.resource_group return ( - service_client_10_2021_dataplanepreview, + service_client_registry_arm, resource_group_name, subscription_id, service_model_client_10_2021_dataplanepreview, From 2554b5ae17ecf09aa82ddc491e83572ca56c2178 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 17:54:42 +0530 Subject: [PATCH 091/146] Migrate test_model_default_deployment_template off v2021_10 to arm models --- .../test_model_default_deployment_template.py | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py index a80fea4d79bb..c8df1afbe18b 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py @@ -6,7 +6,6 @@ import pytest from azure.ai.ml import load_model -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData, ModelVersionDetails from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion, ModelVersionProperties from azure.ai.ml.entities import Model from azure.ai.ml.entities._assets.default_deployment_template import DeploymentTemplateReference @@ -71,11 +70,11 @@ def test_model_to_rest_object_with_default_deployment_template(self) -> None: rest_object = model._to_rest_object() - # Should return ModelVersionData when default_deployment_template is present - assert isinstance(rest_object, ModelVersionData) - assert isinstance(rest_object.properties, ModelVersionDetails) - assert rest_object.properties.default_deployment_template is not None - assert rest_object.properties.default_deployment_template.asset_id == template.asset_id + # Returns an arm ModelVersion; the deployment-template fields are carried as camelCase wire keys. + assert isinstance(rest_object, ModelVersion) + assert isinstance(rest_object.properties, ModelVersionProperties) + assert rest_object.properties["defaultDeploymentTemplate"] is not None + assert rest_object.properties["defaultDeploymentTemplate"]["assetId"] == template.asset_id def test_model_to_rest_object_without_default_deployment_template(self) -> None: """Test Model._to_rest_object() without default_deployment_template.""" @@ -99,7 +98,7 @@ def test_model_from_rest_object_with_default_deployment_template_dict(self) -> N template_asset_id = "azureml://registries/test-registry/deploymenttemplates/template1/versions/1" # Create mock REST object - rest_properties = Mock(spec=ModelVersionDetails) + rest_properties = Mock() rest_properties.description = "Test model" rest_properties.tags = {"key": "value"} rest_properties.properties = {} @@ -112,7 +111,7 @@ def test_model_from_rest_object_with_default_deployment_template_dict(self) -> N rest_properties.system_metadata = None rest_properties.default_deployment_template = {"asset_id": template_asset_id} - rest_object = Mock(spec=ModelVersionData) + rest_object = Mock() rest_object.id = "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/ws/models/test-model/versions/1" rest_object.properties = rest_properties @@ -135,7 +134,7 @@ def test_model_from_rest_object_with_default_deployment_template_object(self) -> template_asset_id = "azureml://registries/test-registry/deploymenttemplates/template1/versions/1" # Create mock REST object - rest_properties = Mock(spec=ModelVersionDetails) + rest_properties = Mock() rest_properties.description = "Test model" rest_properties.tags = {"key": "value"} rest_properties.properties = {} @@ -152,7 +151,7 @@ def test_model_from_rest_object_with_default_deployment_template_object(self) -> template_obj.asset_id = template_asset_id rest_properties.default_deployment_template = template_obj - rest_object = Mock(spec=ModelVersionData) + rest_object = Mock() rest_object.id = "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/ws/models/test-model/versions/1" rest_object.properties = rest_properties @@ -220,10 +219,9 @@ def test_model_with_stage_and_default_deployment_template(self) -> None: # Serialize to REST object rest_object = model._to_rest_object() - # Note: When default_deployment_template is present, it uses ModelVersionDetails - # which doesn't support stage in the v2021_10_01_dataplanepreview API - # This is expected behavior - stage is only supported in workspace operations - assert isinstance(rest_object, ModelVersionData) + # When default_deployment_template is present the template fields are carried as wire keys and + # stage is dropped (matching the legacy registry package API behavior). + assert isinstance(rest_object, ModelVersion) def test_model_yaml_with_default_deployment_template(self, tmp_path: Path) -> None: """Test loading a Model from YAML with default_deployment_template.""" From d026c4bbed7b30c7d4f2ea7e7dab703388f86993 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 18:08:17 +0530 Subject: [PATCH 092/146] Migrate remaining tests and docstrings off v2021_10 dataplane client --- .../ai/ml/operations/_code_operations.py | 6 +-- .../ai/ml/operations/_component_operations.py | 5 +-- .../ai/ml/operations/_data_operations.py | 8 ++-- .../ml/operations/_environment_operations.py | 8 ++-- .../ai/ml/operations/_evaluator_operations.py | 5 +-- .../ai/ml/operations/_model_operations.py | 5 +-- sdk/ml/azure-ai-ml/tests/conftest.py | 3 +- .../environment/unittests/test_env_entity.py | 2 +- .../unittests/test_environment_operations.py | 2 +- ...test_model_allowed_deployment_templates.py | 40 +++++++++---------- .../model/unittests/test_model_schema.py | 18 +++++---- .../unittests/test_model_package.py | 1 - 12 files changed, 46 insertions(+), 57 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index f9978a80a3c9..1756ab42fc01 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -66,10 +66,8 @@ class CodeOperations(_ScopeDependentOperations): :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources. - :type service_client: typing.Union[ - ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. - AzureMachineLearningWorkspaces, - ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient] + :type service_client: + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param datastore_operations: Represents a client for performing operations on Datastores. :type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py index ab48d031646b..d5cf3befdc44 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @@ -87,9 +87,8 @@ class ComponentOperations(_ScopeDependentOperations): :param operation_config: The operation configuration. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: The service client for API operations. - :type service_client: Union[ - ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient, - ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview.AzureMachineLearningWorkspaces] + :type service_client: + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param all_operations: The container for all available operations. :type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer :param preflight_operation: The preflight operation for deployments. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index aa0697ce1437..3c7e3cf5a3bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -101,11 +101,9 @@ class DataOperations(_ScopeDependentOperations): :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace - resources (ServiceClient042023Preview or ServiceClient102021Dataplane). - :type service_client: typing.Union[ - ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient, - ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. - AzureMachineLearningWorkspaces] + resources. + :type service_client: + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param datastore_operations: Represents a client for performing operations on Datastores. :type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index a3547112c7ad..6d8c52caae84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -59,11 +59,9 @@ class EnvironmentOperations(_ScopeDependentOperations): :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace - resources (ServiceClient042023Preview or ServiceClient102021Dataplane). - :type service_client: typing.Union[ - ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient, - ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. - AzureMachineLearningWorkspaces] + resources. + :type service_client: + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param all_operations: All operations classes of an MLClient object. :type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 3671702536c2..735aadd7e62d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -42,11 +42,10 @@ class EvaluatorOperations(_ScopeDependentOperations): :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace - resources (ServiceClient082023Preview or ServiceClient102021Dataplane). + resources (ServiceClient082023Preview). :type service_client: typing.Union[ azure.ai.ml._restclient.v2023_08_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, - azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. - AzureMachineLearningWorkspaces] + azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient] :param datastore_operations: Represents a client for performing operations on Datastores. :type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations :param all_operations: All operations classes of an MLClient object. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 22fafda36d78..e9666d461c30 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -92,11 +92,10 @@ class ModelOperations(_ScopeDependentOperations): :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace - resources (ServiceClient082023Preview or ServiceClient102021Dataplane). + resources (ServiceClient082023Preview). :type service_client: typing.Union[ azure.ai.ml._restclient.v2023_08_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, - azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. - AzureMachineLearningWorkspaces] + azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient] :param datastore_operations: Represents a client for performing operations on Datastores. :type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations :param all_operations: All operations classes of an MLClient object. diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index d633d99ec0fe..91aa9797608b 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -263,7 +263,8 @@ def mock_aml_services_2022_02_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2021_10_01_dataplanepreview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2021_10_01_dataplanepreview") + # Registry data-plane assets now flow through the shared arm_ml_service hybrid client. + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py index a022b92a17a8..9c23e37ef8a6 100644 --- a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py +++ b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py @@ -10,7 +10,7 @@ from azure.ai.ml.entities import Component as ComponentEntity from azure.ai.ml.entities._assets import Environment from azure.ai.ml.entities._assets.environment import BuildContext -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import EnvironmentVersionData as RestEnvironment +from azure.ai.ml._restclient.v2023_08_01_preview.models import EnvironmentVersion as RestEnvironment @pytest.mark.unittest diff --git a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations.py b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations.py index ea346cda2608..1932fab4ccf3 100644 --- a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations.py +++ b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations.py @@ -274,7 +274,7 @@ def test_restore_container(self, mock_environment_operation: EnvironmentOperatio def side_effect(self, args): print(args) - # #Mock(azure.ai.ml._restclient.v2021_10_01_dataplanepreview.operations._environment_versions_operations, "get") + # #Mock(azure.ai.ml._restclient.arm_ml_service.operations._operations, "get") # def test_promote_environment_from_workspace( # self, # mock_environment_operation_reg: EnvironmentOperations, diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py index 67def226c682..a1453b2df91c 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py @@ -9,10 +9,6 @@ import pytest -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ( - ModelVersionData, - ModelVersionDetails, -) from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion, ModelVersionProperties from azure.ai.ml.entities import Model from azure.ai.ml.entities._assets.default_deployment_template import DeploymentTemplateReference @@ -104,12 +100,12 @@ def test_model_to_rest_object_with_allowed_only(self) -> None: rest_object = model._to_rest_object() - # Should use ModelVersionData path - assert isinstance(rest_object, ModelVersionData) - assert isinstance(rest_object.properties, ModelVersionDetails) - assert rest_object.properties.allowed_deployment_templates is not None - assert len(rest_object.properties.allowed_deployment_templates) == 1 - assert rest_object.properties.allowed_deployment_templates[0].asset_id == allowed[0].asset_id + # Deployment-template fields are carried as camelCase wire keys on the arm ModelVersion. + assert isinstance(rest_object, ModelVersion) + assert isinstance(rest_object.properties, ModelVersionProperties) + assert rest_object.properties["allowedDeploymentTemplates"] is not None + assert len(rest_object.properties["allowedDeploymentTemplates"]) == 1 + assert rest_object.properties["allowedDeploymentTemplates"][0]["assetId"] == allowed[0].asset_id def test_model_to_rest_object_with_both(self) -> None: """Test _to_rest_object with both default and allowed templates.""" @@ -128,11 +124,11 @@ def test_model_to_rest_object_with_both(self) -> None: rest_object = model._to_rest_object() - assert isinstance(rest_object, ModelVersionData) - assert rest_object.properties.default_deployment_template is not None - assert rest_object.properties.default_deployment_template.asset_id == default.asset_id - assert rest_object.properties.allowed_deployment_templates is not None - assert len(rest_object.properties.allowed_deployment_templates) == 2 + assert isinstance(rest_object, ModelVersion) + assert rest_object.properties["defaultDeploymentTemplate"] is not None + assert rest_object.properties["defaultDeploymentTemplate"]["assetId"] == default.asset_id + assert rest_object.properties["allowedDeploymentTemplates"] is not None + assert len(rest_object.properties["allowedDeploymentTemplates"]) == 2 def test_model_to_rest_object_without_templates(self) -> None: """Test _to_rest_object without any deployment templates uses ModelVersion path.""" @@ -150,7 +146,7 @@ def test_model_to_rest_object_without_templates(self) -> None: def test_model_from_rest_object_with_allowed_deployment_templates_dict(self) -> None: """Test _from_rest_object with allowed_deployment_templates as list of dicts.""" - rest_properties = Mock(spec=ModelVersionDetails) + rest_properties = Mock() rest_properties.description = "Test model" rest_properties.tags = {} rest_properties.properties = {} @@ -167,7 +163,7 @@ def test_model_from_rest_object_with_allowed_deployment_templates_dict(self) -> {"asset_id": "azureml://registries/reg1/deploymenttemplates/dt2/versions/1"}, ] - rest_object = Mock(spec=ModelVersionData) + rest_object = Mock() rest_object.id = "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/ws/models/test-model/versions/1" rest_object.properties = rest_properties @@ -194,7 +190,7 @@ def test_model_from_rest_object_with_allowed_deployment_templates_dict(self) -> def test_model_from_rest_object_with_allowed_deployment_templates_objects(self) -> None: """Test _from_rest_object with allowed_deployment_templates as list of objects.""" - rest_properties = Mock(spec=ModelVersionDetails) + rest_properties = Mock() rest_properties.description = "Test model" rest_properties.tags = {} rest_properties.properties = {} @@ -213,7 +209,7 @@ def test_model_from_rest_object_with_allowed_deployment_templates_objects(self) template_obj2.asset_id = "azureml://registries/reg1/deploymenttemplates/dt2/versions/1" rest_properties.allowed_deployment_templates = [template_obj1, template_obj2] - rest_object = Mock(spec=ModelVersionData) + rest_object = Mock() rest_object.id = "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/ws/models/test-model/versions/1" rest_object.properties = rest_properties @@ -311,9 +307,9 @@ def test_model_round_trip_rest_with_both_templates(self) -> None: rest_object = original._to_rest_object() # Verify REST object shape - assert isinstance(rest_object, ModelVersionData) - assert rest_object.properties.default_deployment_template.asset_id == default.asset_id - assert len(rest_object.properties.allowed_deployment_templates) == 2 + assert isinstance(rest_object, ModelVersion) + assert rest_object.properties["defaultDeploymentTemplate"]["assetId"] == default.asset_id + assert len(rest_object.properties["allowedDeploymentTemplates"]) == 2 # Now simulate deserialization from the REST object # We can't do a full round-trip via _from_rest_object because it expects ARM IDs, diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py index 2e21aeecfbf1..041b14bdfcdf 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py @@ -6,7 +6,7 @@ from test_utilities.utils import verify_entity_load_and_dump from azure.ai.ml import load_model -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData +from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion from azure.ai.ml._schema import ModelSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, AssetTypes from azure.ai.ml.entities._assets import Model @@ -77,7 +77,10 @@ def test_ipp_model(self) -> None: "systemData": {}, } - from_rest_ipp_model = Model._from_rest_object(ModelVersionData.deserialize(rest_ipp_model)) + # intellectual_property is a workspace-model field (v2023_08); deserialize into that model for this test. + from azure.ai.ml._restclient.v2023_08_01_preview.models import ModelVersion as ModelVersion2308 + + from_rest_ipp_model = Model._from_rest_object(ModelVersion2308.deserialize(rest_ipp_model)) assert from_rest_ipp_model._intellectual_property assert from_rest_ipp_model._intellectual_property.protection_level == "All" @@ -116,7 +119,6 @@ def test_model_with_default_deployment_template_from_yaml(self, tmp_path: Path) def test_model_with_default_deployment_template_to_rest_object(self) -> None: """Test Model._to_rest_object() with default_deployment_template.""" - from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData from azure.ai.ml.entities._assets.default_deployment_template import DeploymentTemplateReference template = DeploymentTemplateReference( @@ -133,10 +135,10 @@ def test_model_with_default_deployment_template_to_rest_object(self) -> None: rest_object = model._to_rest_object() - # Should return ModelVersionData when default_deployment_template is present - assert isinstance(rest_object, ModelVersionData) - assert rest_object.properties.default_deployment_template is not None - assert rest_object.properties.default_deployment_template.asset_id == template.asset_id + # Deployment-template fields are carried as camelCase wire keys on the arm ModelVersion. + assert isinstance(rest_object, ModelVersion) + assert rest_object.properties["defaultDeploymentTemplate"] is not None + assert rest_object.properties["defaultDeploymentTemplate"]["assetId"] == template.asset_id def test_model_with_default_deployment_template_from_rest_object(self) -> None: """Test Model._from_rest_object() with default_deployment_template.""" @@ -160,7 +162,7 @@ def test_model_with_default_deployment_template_from_rest_object(self) -> None: "systemData": {}, } - from_rest_model = Model._from_rest_object(ModelVersionData.deserialize(rest_model_with_template)) + from_rest_model = Model._from_rest_object(ModelVersion._deserialize(rest_model_with_template, [])) assert from_rest_model.default_deployment_template is not None assert from_rest_model.default_deployment_template.asset_id is not None diff --git a/sdk/ml/azure-ai-ml/tests/model_package/unittests/test_model_package.py b/sdk/ml/azure-ai-ml/tests/model_package/unittests/test_model_package.py index b6dcfd917fb1..2aaf9492cd45 100644 --- a/sdk/ml/azure-ai-ml/tests/model_package/unittests/test_model_package.py +++ b/sdk/ml/azure-ai-ml/tests/model_package/unittests/test_model_package.py @@ -6,7 +6,6 @@ from test_utilities.utils import verify_entity_load_and_dump from azure.ai.ml import load_model -from azure.ai.ml._restclient.v2021_10_01_dataplanepreview.models import ModelVersionData, EnvironmentVersionData from azure.ai.ml._schema import ModelSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, AssetTypes from azure.ai.ml.entities._assets import Model, Environment From 9dc0ab1647b068f858629a3ed6329a17154cc143 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 18:09:07 +0530 Subject: [PATCH 093/146] Remove v2021_10_01_dataplanepreview REST client (migrated to shared arm_ml_service) --- .../v2021_10_01_dataplanepreview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 148 - .../_configuration.py | 76 - .../v2021_10_01_dataplanepreview/_patch.py | 31 - .../v2021_10_01_dataplanepreview/_vendor.py | 27 - .../v2021_10_01_dataplanepreview/_version.py | 9 - .../aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 144 - .../aio/_configuration.py | 72 - .../aio/_patch.py | 31 - .../aio/operations/__init__.py | 37 - .../operations/_code_containers_operations.py | 335 - .../operations/_code_versions_operations.py | 423 - .../_component_containers_operations.py | 335 - .../_component_versions_operations.py | 423 - .../operations/_data_containers_operations.py | 340 - .../operations/_data_references_operations.py | 118 - .../operations/_data_versions_operations.py | 437 -- .../_environment_containers_operations.py | 340 - .../_environment_versions_operations.py | 433 -- .../_model_containers_operations.py | 410 - .../operations/_model_versions_operations.py | 596 -- ...e_management_asset_reference_operations.py | 187 - .../_temporary_data_references_operations.py | 118 - .../models/__init__.py | 474 -- ...azure_machine_learning_workspaces_enums.py | 254 - .../models/_models.py | 6374 --------------- .../models/_models_py3.py | 6895 ----------------- .../operations/__init__.py | 37 - .../operations/_code_containers_operations.py | 507 -- .../operations/_code_versions_operations.py | 610 -- .../_component_containers_operations.py | 507 -- .../_component_versions_operations.py | 610 -- .../operations/_data_containers_operations.py | 515 -- .../operations/_data_references_operations.py | 172 - .../operations/_data_versions_operations.py | 630 -- .../_environment_containers_operations.py | 515 -- .../_environment_versions_operations.py | 626 -- .../_model_containers_operations.py | 586 -- .../operations/_model_versions_operations.py | 844 -- ...e_management_asset_reference_operations.py | 238 - .../_temporary_data_references_operations.py | 172 - .../v2021_10_01_dataplanepreview/py.typed | 1 - 43 files changed, 25670 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 26648d9adfd5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, DataReferencesOperations, DataVersionsOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, ModelContainersOperations, ModelVersionsOperations, ResourceManagementAssetReferenceOperations, TemporaryDataReferencesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes - """AzureMachineLearningWorkspaces. - - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar data_references: DataReferencesOperations operations - :vartype data_references: - azure.mgmt.machinelearningservices.operations.DataReferencesOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar resource_management_asset_reference: ResourceManagementAssetReferenceOperations - operations - :vartype resource_management_asset_reference: - azure.mgmt.machinelearningservices.operations.ResourceManagementAssetReferenceOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar temporary_data_references: TemporaryDataReferencesOperations operations - :vartype temporary_data_references: - azure.mgmt.machinelearningservices.operations.TemporaryDataReferencesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2021-10-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_references = DataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_management_asset_reference = ResourceManagementAssetReferenceOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.temporary_data_references = TemporaryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py deleted file mode 100644 index 18489c4a72f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2021-10-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index c1ffbde30522..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -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 .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, DataReferencesOperations, DataVersionsOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, ModelContainersOperations, ModelVersionsOperations, ResourceManagementAssetReferenceOperations, TemporaryDataReferencesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes - """AzureMachineLearningWorkspaces. - - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar data_references: DataReferencesOperations operations - :vartype data_references: - azure.mgmt.machinelearningservices.aio.operations.DataReferencesOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar resource_management_asset_reference: ResourceManagementAssetReferenceOperations - operations - :vartype resource_management_asset_reference: - azure.mgmt.machinelearningservices.aio.operations.ResourceManagementAssetReferenceOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar temporary_data_references: TemporaryDataReferencesOperations operations - :vartype temporary_data_references: - azure.mgmt.machinelearningservices.aio.operations.TemporaryDataReferencesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2021-10-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_references = DataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_management_asset_reference = ResourceManagementAssetReferenceOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.temporary_data_references = TemporaryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py deleted file mode 100644 index 6f6c301a5c01..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2021-10-01-dataplanepreview". Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py deleted file mode 100644 index b7a43c68f0ab..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._data_references_operations import DataReferencesOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._resource_management_asset_reference_operations import ResourceManagementAssetReferenceOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._temporary_data_references_operations import TemporaryDataReferencesOperations - -__all__ = [ - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DataReferencesOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'ResourceManagementAssetReferenceOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'TemporaryDataReferencesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py deleted file mode 100644 index ed95a78a50fa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,335 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.CodeContainerData": - """Get container. - - Get container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - name: str, - resource_group_name: str, - registry_name: str, - body: "_models.CodeContainerData", - **kwargs: Any - ) -> "_models.CodeContainerData": - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py deleted file mode 100644 index df1b5ab482e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,423 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - name: str, - resource_group_name: str, - registry_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.CodeVersionData": - """Get version. - - Get version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.CodeVersionData", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.CodeVersionData", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 0e7f704895b7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,335 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.ComponentContainerData": - """Get container. - - Get container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - name: str, - resource_group_name: str, - registry_name: str, - body: "_models.ComponentContainerData", - **kwargs: Any - ) -> "_models.ComponentContainerData": - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py deleted file mode 100644 index c3a0581ad891..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,423 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - name: str, - resource_group_name: str, - registry_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.ComponentVersionData": - """Get version. - - Get version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.ComponentVersionData", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.ComponentVersionData", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py deleted file mode 100644 index bf5bf6363d40..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,340 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skiptoken: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :param list_view_type: - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.DataContainerData": - """Get container. - - Get container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - name: str, - resource_group_name: str, - registry_name: str, - body: "_models.DataContainerData", - **kwargs: Any - ) -> "_models.DataContainerData": - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py deleted file mode 100644 index 50aa0581ba6d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_references_operations import build_get_blob_reference_sas_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataReferencesOperations: - """DataReferencesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get_blob_reference_sas( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.BlobReferenceSASRequestDto", - **kwargs: Any - ) -> "_models.BlobReferenceSASResponseDto": - """get_blob_reference_sas. - - :param name: - :type name: str - :param version: - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.BlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datarefs/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py deleted file mode 100644 index a6120711e87a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,437 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - name: str, - resource_group_name: str, - registry_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param name: Data container's name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.DataVersionBaseData": - """Get version. - - Get version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.DataVersionBaseData", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBaseData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.DataVersionBaseData", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 9af68184c7cc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,340 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skiptoken: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainerData": - """Get container. - - Get container. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - name: str, - resource_group_name: str, - registry_name: str, - body: "_models.EnvironmentContainerData", - **kwargs: Any - ) -> "_models.EnvironmentContainerData": - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 9e32bc8d003b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,433 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - name: str, - resource_group_name: str, - registry_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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 - :param stage: - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.EnvironmentVersionData": - """Get version. - - Get version. - - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.EnvironmentVersionData", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.EnvironmentVersionData", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 5fcde018b488..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,410 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skiptoken: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.ModelContainerData": - """Get container. - - Get container. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - name: str, - resource_group_name: str, - registry_name: str, - body: "_models.ModelContainerData", - **kwargs: Any - ) -> "_models.ModelContainerData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainerData') - - request = build_create_or_update_request_initial( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - name: str, - resource_group_name: str, - registry_name: str, - body: "_models.ModelContainerData", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainerData"]: - """Create or update model container. - - Create or update model container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainerData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainerData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - name=name, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 3314542a46a8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,596 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - name: str, - resource_group_name: str, - registry_name: str, - skiptoken: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.ModelVersionData": - """Get version. - - Get version. - - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.ModelVersionData", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.ModelVersionData", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _package_initial( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py deleted file mode 100644 index 9bc62a3ef530..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py +++ /dev/null @@ -1,187 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._resource_management_asset_reference_operations import build_import_method_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ResourceManagementAssetReferenceOperations: - """ResourceManagementAssetReferenceOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _import_method_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.ResourceManagementAssetReferenceData", - **kwargs: Any - ) -> Optional[Any]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[Any]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ResourceManagementAssetReferenceData') - - request = build_import_method_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._import_method_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('object', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _import_method_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import"} # type: ignore - - - @distributed_trace_async - async def begin_import_method( - self, - resource_group_name: str, - registry_name: str, - body: "_models.ResourceManagementAssetReferenceData", - **kwargs: Any - ) -> AsyncLROPoller[Any]: - """Import the source asset provided in the request into registry. - The import performs a deep copy of the source asset given in the request into the registry. - The destination name/version value in ImportSourceAssetReference allows the client to update - the name/version value after being imported. - If the destination resource exists, it will be overwritten. - - Import the source asset provided in the request into registry. - The import performs a deep copy of the source asset given in the request into the registry. - The destination name/version value in ImportSourceAssetReference allows the client to update - the name/version value after being imported. - If the destination resource exists, it will be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Import request contains the source asset reference value and destination version - value. - :type body: ~azure.mgmt.machinelearningservices.models.ResourceManagementAssetReferenceData - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either any or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[any] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._import_method_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_import_method.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py deleted file mode 100644 index 1c1b230a74db..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._temporary_data_references_operations import build_create_or_get_temporary_data_reference_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class TemporaryDataReferencesOperations: - """TemporaryDataReferencesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def create_or_get_temporary_data_reference( - self, - name: str, - version: str, - resource_group_name: str, - registry_name: str, - body: "_models.TemporaryDataReferenceRequestDto", - **kwargs: Any - ) -> "_models.TemporaryDataReferenceResponseDto": - """create_or_get_temporary_data_reference. - - :param name: - :type name: str - :param version: - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.TemporaryDataReferenceRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TemporaryDataReferenceResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.TemporaryDataReferenceResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TemporaryDataReferenceResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'TemporaryDataReferenceRequestDto') - - request = build_create_or_get_temporary_data_reference_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_temporary_data_reference.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('TemporaryDataReferenceResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_temporary_data_reference.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/tempdatarefs/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/__init__.py deleted file mode 100644 index 4a496ccf2965..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/__init__.py +++ /dev/null @@ -1,474 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AcrDetail - from ._models_py3 import AmlToken - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureFileDatastore - from ._models_py3 import AzureMLBatchInferencingServer - from ._models_py3 import AzureMLOnlineInferencingServer - from ._models_py3 import BanditPolicy - from ._models_py3 import BaseEnvironmentId - from ._models_py3 import BaseEnvironmentSource - from ._models_py3 import BasicBinding - from ._models_py3 import Binding - from ._models_py3 import BlobReferenceForConsumptionDto - from ._models_py3 import BlobReferenceSASRequestDto - from ._models_py3 import BlobReferenceSASResponseDto - from ._models_py3 import BuildContext - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainerData - from ._models_py3 import CodeContainerDetails - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersionData - from ._models_py3 import CodeVersionDetails - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentContainerData - from ._models_py3 import ComponentContainerDetails - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentJob - from ._models_py3 import ComponentVersionData - from ._models_py3 import ComponentVersionDetails - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import CustomInferencingServer - from ._models_py3 import DataContainerData - from ._models_py3 import DataContainerDetails - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataReferenceCredentialDto - from ._models_py3 import DataVersionBaseData - from ._models_py3 import DataVersionBaseDetails - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import Datastore - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DistributionConfiguration - from ._models_py3 import DockerCredentialDto - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EnvironmentContainerData - from ._models_py3 import EnvironmentContainerDetails - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVersionData - from ._models_py3 import EnvironmentVersionDetails - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import FlavorData - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import ImageReferenceForConsumptionDto - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InferencingServer - from ._models_py3 import IntellectualProperty - from ._models_py3 import Job - from ._models_py3 import JobBase - from ._models_py3 import JobInput - from ._models_py3 import JobInputDataset - from ._models_py3 import JobInputLiteral - from ._models_py3 import JobInputUri - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobOutputDataset - from ._models_py3 import JobOutputUri - from ._models_py3 import JobService - from ._models_py3 import MLTableData - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityCredentialDto - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelConfiguration - from ._models_py3 import ModelContainerData - from ._models_py3 import ModelContainerDetails - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelPackageInput - from ._models_py3 import ModelVersionAllowedDeploymentTemplatesItem - from ._models_py3 import ModelVersionData - from ._models_py3 import ModelVersionDefaultDeploymentTemplate - from ._models_py3 import ModelVersionDetails - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import Mpi - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import Objective - from ._models_py3 import OnlineInferenceConfiguration - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PackageInputPathBase - from ._models_py3 import PackageInputPathId - from ._models_py3 import PackageInputPathUrl - from ._models_py3 import PackageInputPathVersion - from ._models_py3 import PackageRequest - from ._models_py3 import PackageResponse - from ._models_py3 import PipelineJob - from ._models_py3 import PyTorch - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import ResourceManagementAssetReferenceData - from ._models_py3 import ResourceManagementAssetReferenceDetails - from ._models_py3 import Route - from ._models_py3 import SASCredentialDto - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SystemData - from ._models_py3 import TemporaryDataReferenceRequestDto - from ._models_py3 import TemporaryDataReferenceResponseDto - from ._models_py3 import TensorFlow - from ._models_py3 import TrialComponent - from ._models_py3 import TritonInferencingServer - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriReference -except (SyntaxError, ImportError): - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AcrDetail # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # type: ignore - from ._models import BasicBinding # type: ignore - from ._models import Binding # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BlobReferenceSASRequestDto # type: ignore - from ._models import BlobReferenceSASResponseDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainerData # type: ignore - from ._models import CodeContainerDetails # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersionData # type: ignore - from ._models import CodeVersionDetails # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentContainerData # type: ignore - from ._models import ComponentContainerDetails # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentJob # type: ignore - from ._models import ComponentVersionData # type: ignore - from ._models import ComponentVersionDetails # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import CustomInferencingServer # type: ignore - from ._models import DataContainerData # type: ignore - from ._models import DataContainerDetails # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataReferenceCredentialDto # type: ignore - from ._models import DataVersionBaseData # type: ignore - from ._models import DataVersionBaseDetails # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import DockerCredentialDto # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EnvironmentContainerData # type: ignore - from ._models import EnvironmentContainerDetails # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVersionData # type: ignore - from ._models import EnvironmentVersionDetails # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import FlavorData # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import ImageReferenceForConsumptionDto # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferencingServer # type: ignore - from ._models import IntellectualProperty # type: ignore - from ._models import Job # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobInputDataset # type: ignore - from ._models import JobInputLiteral # type: ignore - from ._models import JobInputUri # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobOutputDataset # type: ignore - from ._models import JobOutputUri # type: ignore - from ._models import JobService # type: ignore - from ._models import MLTableData # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityCredentialDto # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainerData # type: ignore - from ._models import ModelContainerDetails # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelVersionAllowedDeploymentTemplatesItem # type: ignore - from ._models import ModelVersionData # type: ignore - from ._models import ModelVersionDefaultDeploymentTemplate # type: ignore - from ._models import ModelVersionDetails # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import Mpi # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import Objective # type: ignore - from ._models import OnlineInferenceConfiguration # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PyTorch # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceManagementAssetReferenceData # type: ignore - from ._models import ResourceManagementAssetReferenceDetails # type: ignore - from ._models import Route # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SystemData # type: ignore - from ._models import TemporaryDataReferenceRequestDto # type: ignore - from ._models import TemporaryDataReferenceResponseDto # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TritonInferencingServer # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriReference # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - BaseEnvironmentSourceType, - BindingType, - CreatedByType, - CredentialsType, - DataReferenceCredentialType, - DataType, - DatastoreType, - DistributionType, - EarlyTerminationPolicyType, - EnvironmentType, - Goal, - IdentityConfigurationType, - InferencingServerType, - InputDataDeliveryMode, - InputPathType, - JobInputType, - JobLimitsType, - JobOutputType, - JobStatus, - JobType, - ListViewType, - OperatingSystemType, - OutputDataDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - ProtectionLevel, - ReferenceType, - SamplingAlgorithm, - SecretsType, - ServiceDataAccessAuthIdentity, -) - -__all__ = [ - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetail', - 'AmlToken', - 'AssetBase', - 'AssetContainer', - 'AssetReferenceBase', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BasicBinding', - 'Binding', - 'BlobReferenceForConsumptionDto', - 'BlobReferenceSASRequestDto', - 'BlobReferenceSASResponseDto', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'CodeConfiguration', - 'CodeContainerData', - 'CodeContainerDetails', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersionData', - 'CodeVersionDetails', - 'CodeVersionResourceArmPaginatedResult', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainerData', - 'ComponentContainerDetails', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentJob', - 'ComponentVersionData', - 'ComponentVersionDetails', - 'ComponentVersionResourceArmPaginatedResult', - 'CustomInferencingServer', - 'DataContainerData', - 'DataContainerDetails', - 'DataContainerResourceArmPaginatedResult', - 'DataPathAssetReference', - 'DataReferenceCredentialDto', - 'DataVersionBaseData', - 'DataVersionBaseDetails', - 'DataVersionBaseResourceArmPaginatedResult', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreSecrets', - 'DistributionConfiguration', - 'DockerCredentialDto', - 'EarlyTerminationPolicy', - 'EnvironmentContainerData', - 'EnvironmentContainerDetails', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVersionData', - 'EnvironmentVersionDetails', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'FlavorData', - 'IdAssetReference', - 'IdentityConfiguration', - 'ImageReferenceForConsumptionDto', - 'InferenceContainerProperties', - 'InferencingServer', - 'IntellectualProperty', - 'Job', - 'JobBase', - 'JobInput', - 'JobInputDataset', - 'JobInputLiteral', - 'JobInputUri', - 'JobLimits', - 'JobOutput', - 'JobOutputDataset', - 'JobOutputUri', - 'JobService', - 'MLTableData', - 'ManagedIdentity', - 'ManagedIdentityCredentialDto', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainerData', - 'ModelContainerDetails', - 'ModelContainerResourceArmPaginatedResult', - 'ModelPackageInput', - 'ModelVersionAllowedDeploymentTemplatesItem', - 'ModelVersionData', - 'ModelVersionDefaultDeploymentTemplate', - 'ModelVersionDetails', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NoneDatastoreCredentials', - 'Objective', - 'OnlineInferenceConfiguration', - 'OutputPathAssetReference', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PipelineJob', - 'PyTorch', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceManagementAssetReferenceData', - 'ResourceManagementAssetReferenceDetails', - 'Route', - 'SASCredentialDto', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'SweepJob', - 'SweepJobLimits', - 'SystemData', - 'TemporaryDataReferenceRequestDto', - 'TemporaryDataReferenceResponseDto', - 'TensorFlow', - 'TrialComponent', - 'TritonInferencingServer', - 'TruncationSelectionPolicy', - 'UriFileDataVersion', - 'UriFolderDataVersion', - 'UriReference', - 'BaseEnvironmentSourceType', - 'BindingType', - 'CreatedByType', - 'CredentialsType', - 'DataReferenceCredentialType', - 'DataType', - 'DatastoreType', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EnvironmentType', - 'Goal', - 'IdentityConfigurationType', - 'InferencingServerType', - 'InputDataDeliveryMode', - 'InputPathType', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobType', - 'ListViewType', - 'OperatingSystemType', - 'OutputDataDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'ProtectionLevel', - 'ReferenceType', - 'SamplingAlgorithm', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index b29099d9e0e4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,254 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta - - -class BaseEnvironmentSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Base environment type. - """ - - ENVIRONMENT_ASSET = "EnvironmentAsset" - -class BindingType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Different Binding types - """ - - BASIC = "Basic" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class DataReferenceCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - SAS = "SAS" - DOCKER_CREDENTIALS = "DockerCredentials" - MANAGED_IDENTITY = "ManagedIdentity" - NO_CREDENTIALS = "NoCredentials" - -class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - -class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - -class InferencingServerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Inferencing server type for various targets. - """ - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - -class InputDataDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - -class InputPathType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Input path type for package inputs. - """ - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - -class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ - - DATASET = "Dataset" - URI = "Uri" - LITERAL = "Literal" - -class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ - - URI = "Uri" - DATASET = "Dataset" - -class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ - - NOT_STARTED = "NotStarted" - STARTING = "Starting" - PROVISIONING = "Provisioning" - PREPARING = "Preparing" - QUEUED = "Queued" - RUNNING = "Running" - FINALIZING = "Finalizing" - CANCEL_REQUESTED = "CancelRequested" - COMPLETED = "Completed" - FAILED = "Failed" - CANCELED = "Canceled" - NOT_RESPONDING = "NotResponding" - PAUSED = "Paused" - UNKNOWN = "Unknown" - -class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ - - COMMAND = "Command" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - BASE = "Base" - -class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDataDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - -class PackageBuildState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Package build state returned in package response. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class PackageInputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mounting type of the model or the inputs - """ - - COPY = "Copy" - DOWNLOAD = "Download" - -class PackageInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the inputs. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - -class ProtectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protection level associated with the Intellectual Property. - """ - - ALL = "All" - NONE = "None" - -class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class SamplingAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py deleted file mode 100644 index 57accb2b82e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py +++ /dev/null @@ -1,6374 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class AcrDetail(msrest.serialization.Model): - """AcrDetail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar acr_address: - :vartype acr_address: str - :ivar acr_name: - :vartype acr_name: str - :ivar acr_region: - :vartype acr_region: str - :ivar arm_scope: - :vartype arm_scope: str - :ivar resource_group_name: - :vartype resource_group_name: str - :ivar subscription_id: - :vartype subscription_id: str - """ - - _validation = { - 'arm_scope': {'readonly': True}, - } - - _attribute_map = { - 'acr_address': {'key': 'acrAddress', 'type': 'str'}, - 'acr_name': {'key': 'acrName', 'type': 'str'}, - 'acr_region': {'key': 'acrRegion', 'type': 'str'}, - 'arm_scope': {'key': 'armScope', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_address: - :paramtype acr_address: str - :keyword acr_name: - :paramtype acr_name: str - :keyword acr_region: - :paramtype acr_region: str - :keyword resource_group_name: - :paramtype resource_group_name: str - :keyword subscription_id: - :paramtype subscription_id: str - """ - super(AcrDetail, self).__init__(**kwargs) - self.acr_address = kwargs.get('acr_address', None) - self.acr_name = kwargs.get('acr_name', None) - self.acr_region = kwargs.get('acr_region', None) - self.arm_scope = None - self.resource_group_name = kwargs.get('resource_group_name', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. Specifies the type of identity framework.Constant filled by - server. Possible values include: "Managed", "AMLToken". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. Specifies the type of identity framework.Constant filled by - server. Possible values include: "Managed", "AMLToken". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class Datastore(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(Datastore, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'Datastore' # type: str - self.is_default = None - - -class AzureBlobDatastore(Datastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureBlob' # type: str - 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(Datastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - - -class AzureDataLakeGen2Datastore(Datastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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(Datastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. TODO - File share name. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. TODO - File share name. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureFile' # type: str - 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 InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. Base environment type.Constant filled by server. - Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. Base environment type.Constant filled by server. - Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Required. Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] - - -class Binding(msrest.serialization.Model): - """Binding Inputs/Outputs to ComponentJob Inputs/Outputs etc. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BasicBinding. - - All required parameters must be populated in order to send to Azure. - - :ivar binding_type: Required. Type of Binding.Constant filled by server. Possible values - include: "Basic". - :vartype binding_type: str or ~azure.mgmt.machinelearningservices.models.BindingType - """ - - _validation = { - 'binding_type': {'required': True}, - } - - _attribute_map = { - 'binding_type': {'key': 'bindingType', 'type': 'str'}, - } - - _subtype_map = { - 'binding_type': {'Basic': 'BasicBinding'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Binding, self).__init__(**kwargs) - self.binding_type = None # type: Optional[str] - - -class BasicBinding(Binding): - """Basic binding with simple source and destination. - - All required parameters must be populated in order to send to Azure. - - :ivar binding_type: Required. Type of Binding.Constant filled by server. Possible values - include: "Basic". - :vartype binding_type: str or ~azure.mgmt.machinelearningservices.models.BindingType - :ivar destination: Destination reference. - :vartype destination: str - :ivar source: Source reference. - :vartype source: str - """ - - _validation = { - 'binding_type': {'required': True}, - } - - _attribute_map = { - 'binding_type': {'key': 'bindingType', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword destination: Destination reference. - :paramtype destination: str - :keyword source: Source reference. - :paramtype source: str - """ - super(BasicBinding, self).__init__(**kwargs) - self.binding_type = 'Basic' # type: str - self.destination = kwargs.get('destination', None) - self.source = kwargs.get('source', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :ivar storage_account_arm_id: - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :keyword storage_account_arm_id: - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequestDto. - - :ivar asset_id: - :vartype asset_id: str - :ivar blob_uri: - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - :keyword blob_uri: - :paramtype blob_uri: str - """ - super(BlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.blob_uri = kwargs.get('blob_uri', None) - - -class BlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponseDto. - - :ivar blob_reference_for_consumption: - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - """ - super(BlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. URI of the Docker build context used to build the image. Supports - blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. URI of the Docker build context used to build the image. - Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. ID of the tenant to which the service principal belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. Thumbprint of the certificate used for authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class CodeContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - super(CodeContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerDetails(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerDetails, self).__init__(**kwargs) - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - super(CodeVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionDetails(AssetBase): - """Code asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionDetails, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobBase(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Job, CommandJob, PipelineJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'Base': 'Job', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBase, self).__init__(**kwargs) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBase' # type: str - self.parent_job_name = None - self.services = kwargs.get('services', None) - self.status = None - - -class CommandJob(JobBase): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. The command to execute on startup of the job. eg. "python train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. The command to execute on startup of the job. eg. "python - train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.identity = kwargs.get('identity', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. JobLimit type.Constant filled by server. Possible values - include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. JobLimit type.Constant filled by server. Possible values - include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - super(ComponentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerDetails(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerDetails, self).__init__(**kwargs) - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentJob(msrest.serialization.Model): - """Definition of a ComponentJob. - - :ivar component_id: Reference to component artifact. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar inputs: Data input set for job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar outputs: Data output set for job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar overrides: Override component default settings. - :vartype overrides: any - """ - - _attribute_map = { - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'overrides': {'key': 'overrides', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: Reference to component artifact. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword inputs: Data input set for job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword outputs: Data output set for job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword overrides: Override component default settings. - :paramtype overrides: any - """ - super(ComponentJob, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.inputs = kwargs.get('inputs', None) - self.outputs = kwargs.get('outputs', None) - self.overrides = kwargs.get('overrides', None) - - -class ComponentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - super(ComponentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionDetails(AssetBase): - """Definition of a component version: defines resources that span component types. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionDetails, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class DataContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - super(DataContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerDetails(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. Specifies the type of data. Possible values include: "uri_file", - "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. Specifies the type of data. Possible values include: "uri_file", - "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerDetails, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataReferenceCredentialDto(msrest.serialization.Model): - """DataReferenceCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: . - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. Constant filled by server. Possible values include: "SAS", - "DockerCredentials", "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - - -class DataVersionBaseData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - super(DataVersionBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseDetails(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DataVersionBaseDetails, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class DockerCredentialDto(msrest.serialization.Model): - """DockerCredentialDto. - - :ivar password: - :vartype password: str - :ivar user_name: - :vartype user_name: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword user_name: - :paramtype user_name: str - """ - super(DockerCredentialDto, self).__init__(**kwargs) - self.password = kwargs.get('password', None) - self.user_name = kwargs.get('user_name', None) - - -class EnvironmentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - super(EnvironmentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerDetails(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerDetails, self).__init__(**kwargs) - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - super(EnvironmentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionDetails(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . - Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionDetails, self).__init__(**kwargs) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.os_type = kwargs.get('os_type', None) - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class ImageReferenceForConsumptionDto(msrest.serialization.Model): - """ImageReferenceForConsumptionDto. - - :ivar acr_details: - :vartype acr_details: ~azure.mgmt.machinelearningservices.models.AcrDetail - :ivar credential: - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :ivar image_name: - :vartype image_name: str - :ivar image_registry_reference: - :vartype image_registry_reference: str - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': 'AcrDetail'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, - 'image_name': {'key': 'imageName', 'type': 'str'}, - 'image_registry_reference': {'key': 'imageRegistryReference', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: - :paramtype acr_details: ~azure.mgmt.machinelearningservices.models.AcrDetail - :keyword credential: - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :keyword image_name: - :paramtype image_name: str - :keyword image_registry_reference: - :paramtype image_registry_reference: str - """ - super(ImageReferenceForConsumptionDto, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.credential = kwargs.get('credential', None) - self.image_name = kwargs.get('image_name', None) - self.image_registry_reference = kwargs.get('image_registry_reference', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. Publisher of the Intellectual Property. Must be the same as Registry - publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. Publisher of the Intellectual Property. Must be the same as - Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] - - -class Job(JobBase): - """Basic Job class with all job base properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(Job, self).__init__(**kwargs) - self.job_type = 'Base' # type: str - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobInputDataset, JobInputLiteral, JobInputUri. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'Dataset': 'JobInputDataset', 'Literal': 'JobInputLiteral', 'Uri': 'JobInputUri'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class JobInputDataset(JobInput): - """InputDataset type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar dataset_id: Required. Dataset ARM Id for the input. - :vartype dataset_id: str - :ivar mode: Dataset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - """ - - _validation = { - 'job_input_type': {'required': True}, - 'dataset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword dataset_id: Required. Dataset ARM Id for the input. - :paramtype dataset_id: str - :keyword mode: Dataset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - """ - super(JobInputDataset, self).__init__(**kwargs) - self.job_input_type = 'Dataset' # type: str - self.dataset_id = kwargs['dataset_id'] - self.mode = kwargs.get('mode', None) - - -class JobInputLiteral(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Literal value for the input. - :paramtype value: str - """ - super(JobInputLiteral, self).__init__(**kwargs) - self.job_input_type = 'Literal' # type: str - self.value = kwargs.get('value', None) - - -class JobInputUri(JobInput): - """Input uri type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar mode: Input Uri Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - :ivar uri: Required. Uri path. - :vartype uri: ~azure.mgmt.machinelearningservices.models.UriReference - """ - - _validation = { - 'job_input_type': {'required': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'UriReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword mode: Input Uri Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - :keyword uri: Required. Uri path. - :paramtype uri: ~azure.mgmt.machinelearningservices.models.UriReference - """ - super(JobInputUri, self).__init__(**kwargs) - self.job_input_type = 'Uri' # type: str - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobOutputDataset, JobOutputUri. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Uri", "Dataset". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'Dataset': 'JobOutputDataset', 'Uri': 'JobOutputUri'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class JobOutputDataset(JobOutput): - """Dataset output. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Uri", "Dataset". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - :ivar mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - :keyword mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode - """ - super(JobOutputDataset, self).__init__(**kwargs) - self.job_output_type = 'Dataset' # type: str - self.mode = kwargs.get('mode', None) - - -class JobOutputUri(JobOutput): - """Uri output. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Uri", "Dataset". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - :ivar mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode - :ivar uri: Uri path. - :vartype uri: ~azure.mgmt.machinelearningservices.models.UriReference - """ - - _validation = { - 'job_output_type': {'required': True}, - 'mode': {'readonly': True}, - 'uri': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'UriReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutputUri, self).__init__(**kwargs) - self.job_output_type = 'Uri' # type: str - self.mode = None - self.uri = None - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. Specifies the type of identity framework.Constant filled by - server. Possible values include: "Managed", "AMLToken". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityCredentialDto(msrest.serialization.Model): - """ManagedIdentityCredentialDto. - - :ivar managed_identity_type: - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _attribute_map = { - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword managed_identity_type: - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredentialDto, self).__init__(**kwargs) - self.managed_identity_type = kwargs.get('managed_identity_type', None) - self.user_managed_identity_client_id = kwargs.get('user_managed_identity_client_id', None) - self.user_managed_identity_principal_id = kwargs.get('user_managed_identity_principal_id', None) - self.user_managed_identity_resource_id = kwargs.get('user_managed_identity_resource_id', None) - self.user_managed_identity_tenant_id = kwargs.get('user_managed_identity_tenant_id', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLTableData(DataVersionBaseDetails): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - - -class ModelContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - super(ModelContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerDetails(AssetContainer): - """ModelContainerDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerDetails, self).__init__(**kwargs) - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. Type of the input included in the target image. Possible values - include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword input_type: Required. Type of the input included in the target image. Possible values - include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] - - -class ModelVersionAllowedDeploymentTemplatesItem(msrest.serialization.Model): - """ModelVersionAllowedDeploymentTemplatesItem. - - :ivar asset_id: - :vartype asset_id: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - """ - super(ModelVersionAllowedDeploymentTemplatesItem, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - - -class ModelVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - super(ModelVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionDefaultDeploymentTemplate(msrest.serialization.Model): - """ModelVersionDefaultDeploymentTemplate. - - :ivar asset_id: - :vartype asset_id: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - """ - super(ModelVersionDefaultDeploymentTemplate, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - - -class ModelVersionDetails(AssetBase): - """Model asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar origin_asset_id: AssetId of origin model. - :vartype origin_asset_id: str - :ivar default_deployment_template: - :vartype default_deployment_template: - ~azure.mgmt.machinelearningservices.models.ModelVersionDefaultDeploymentTemplate - :ivar allowed_deployment_templates: - :vartype allowed_deployment_templates: - list[~azure.mgmt.machinelearningservices.models.ModelVersionAllowedDeploymentTemplatesItem] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'origin_asset_id': {'key': 'originAssetId', 'type': 'str'}, - 'default_deployment_template': {'key': 'defaultDeploymentTemplate', 'type': 'ModelVersionDefaultDeploymentTemplate'}, - 'allowed_deployment_templates': {'key': 'allowedDeploymentTemplates', 'type': '[ModelVersionAllowedDeploymentTemplatesItem]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword origin_asset_id: AssetId of origin model. - :paramtype origin_asset_id: str - :keyword default_deployment_template: - :paramtype default_deployment_template: - ~azure.mgmt.machinelearningservices.models.ModelVersionDefaultDeploymentTemplate - :keyword allowed_deployment_templates: - :paramtype allowed_deployment_templates: - list[~azure.mgmt.machinelearningservices.models.ModelVersionAllowedDeploymentTemplatesItem] - """ - super(ModelVersionDetails, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.origin_asset_id = kwargs.get('origin_asset_id', None) - self.default_deployment_template = kwargs.get('default_deployment_template', None) - self.allowed_deployment_templates = kwargs.get('allowed_deployment_templates', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. Defines supported metric goals for hyperparameter tuning. Possible values - include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. Defines supported metric goals for hyperparameter tuning. Possible - values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Properties dictionary. - :vartype properties: dict[str, str] - :ivar sku_architecture_type: The sku architecture type. - :vartype sku_architecture_type: str - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. Arm ID of the target environment to be created by - package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'sku_architecture_type': {'key': 'skuArchitectureType', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Properties dictionary. - :paramtype properties: dict[str, str] - :keyword sku_architecture_type: The sku architecture type. - :paramtype sku_architecture_type: str - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. Arm ID of the target environment to be created by - package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.properties = kwargs.get('properties', None) - self.sku_architecture_type = kwargs.get('sku_architecture_type', None) - self.tags = kwargs.get('tags', None) - self.target_environment_id = kwargs['target_environment_id'] - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Properties dictionary. - :vartype properties: dict[str, str] - :ivar sku_architecture_type: The sku architecture type. - :vartype sku_architecture_type: str - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'sku_architecture_type': {'key': 'skuArchitectureType', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties dictionary. - :paramtype properties: dict[str, str] - :keyword sku_architecture_type: The sku architecture type. - :paramtype sku_architecture_type: str - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = kwargs.get('properties', None) - self.sku_architecture_type = kwargs.get('sku_architecture_type', None) - self.tags = None - self.target_environment_id = None - - -class PipelineJob(JobBase): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar bindings: Binding to represent relation between inputs, outputs and parameters. - :vartype bindings: list[~azure.mgmt.machinelearningservices.models.Binding] - :ivar component_jobs: JobDefinition set for PipelineStepJobs. - :vartype component_jobs: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentJob] - :ivar inputs: Data input set for jobs. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar outputs: Data output set for jobs. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'bindings': {'key': 'bindings', 'type': '[Binding]'}, - 'component_jobs': {'key': 'componentJobs', 'type': '{ComponentJob}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword bindings: Binding to represent relation between inputs, outputs and parameters. - :paramtype bindings: list[~azure.mgmt.machinelearningservices.models.Binding] - :keyword component_jobs: JobDefinition set for PipelineStepJobs. - :paramtype component_jobs: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentJob] - :keyword inputs: Data input set for jobs. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword outputs: Data output set for jobs. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.bindings = kwargs.get('bindings', None) - self.component_jobs = kwargs.get('component_jobs', None) - self.inputs = kwargs.get('inputs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) - - -class ResourceManagementAssetReferenceData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.ResourceManagementAssetReferenceDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ResourceManagementAssetReferenceDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.ResourceManagementAssetReferenceDetails - """ - super(ResourceManagementAssetReferenceData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ResourceManagementAssetReferenceDetails(AssetReferenceBase): - """Resource Management asset reference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar destination_name: Destination asset name for import. - :vartype destination_name: str - :ivar destination_version: Destination asset version for import. - :vartype destination_version: str - :ivar source_asset_id: Required. ARM resource ID of the source asset. - :vartype source_asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'source_asset_id': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'source_asset_id': {'key': 'sourceAssetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword destination_name: Destination asset name for import. - :paramtype destination_name: str - :keyword destination_version: Destination asset version for import. - :paramtype destination_version: str - :keyword source_asset_id: Required. ARM resource ID of the source asset. - :paramtype source_asset_id: str - """ - super(ResourceManagementAssetReferenceDetails, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.destination_name = kwargs.get('destination_name', None) - self.destination_version = kwargs.get('destination_version', None) - self.source_asset_id = kwargs['source_asset_id'] - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. The path for the route. - :vartype path: str - :ivar port: Required. The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. The path for the route. - :paramtype path: str - :keyword port: Required. The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASCredentialDto(msrest.serialization.Model): - """SASCredentialDto. - - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _attribute_map = { - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. ID of the tenant to which the service principal belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class SweepJob(JobBase): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar identity: Identity configuration. If set, this should be one of AmlToken, ManagedIdentity - or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar sampling_algorithm: Required. Type of the hyperparameter sampling algorithms. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. A dictionary containing each parameter and its distribution. The - dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword sampling_algorithm: Required. Type of the hyperparameter sampling algorithms. Possible - values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. A dictionary containing each parameter and its distribution. - The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.identity = kwargs.get('identity', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. JobLimit type.Constant filled by server. Possible values - include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TemporaryDataReferenceRequestDto(msrest.serialization.Model): - """TemporaryDataReferenceRequestDto. - - :ivar asset_id: - :vartype asset_id: str - :ivar temporary_data_reference_id: If TemporaryDataReferenceId = null then random guid will be - used. - :vartype temporary_data_reference_id: str - :ivar temporary_data_reference_type: Either TemporaryBlobReference or TemporaryImageReference. - :vartype temporary_data_reference_type: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'temporary_data_reference_id': {'key': 'temporaryDataReferenceId', 'type': 'str'}, - 'temporary_data_reference_type': {'key': 'temporaryDataReferenceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - :keyword temporary_data_reference_id: If TemporaryDataReferenceId = null then random guid will - be used. - :paramtype temporary_data_reference_id: str - :keyword temporary_data_reference_type: Either TemporaryBlobReference or - TemporaryImageReference. - :paramtype temporary_data_reference_type: str - """ - super(TemporaryDataReferenceRequestDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.temporary_data_reference_id = kwargs.get('temporary_data_reference_id', None) - self.temporary_data_reference_type = kwargs.get('temporary_data_reference_type', None) - - -class TemporaryDataReferenceResponseDto(msrest.serialization.Model): - """TemporaryDataReferenceResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar image_reference_for_consumption: - :vartype image_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.ImageReferenceForConsumptionDto - :ivar temporary_data_reference_id: - :vartype temporary_data_reference_id: str - :ivar temporary_data_reference_type: - :vartype temporary_data_reference_type: str - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'image_reference_for_consumption': {'key': 'imageReferenceForConsumption', 'type': 'ImageReferenceForConsumptionDto'}, - 'temporary_data_reference_id': {'key': 'temporaryDataReferenceId', 'type': 'str'}, - 'temporary_data_reference_type': {'key': 'temporaryDataReferenceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword image_reference_for_consumption: - :paramtype image_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.ImageReferenceForConsumptionDto - :keyword temporary_data_reference_id: - :paramtype temporary_data_reference_id: str - :keyword temporary_data_reference_type: - :paramtype temporary_data_reference_type: str - """ - super(TemporaryDataReferenceResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.image_reference_for_consumption = kwargs.get('image_reference_for_consumption', None) - self.temporary_data_reference_id = kwargs.get('temporary_data_reference_id', None) - self.temporary_data_reference_type = kwargs.get('temporary_data_reference_type', None) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. The command to execute on startup of the job. eg. "python train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. The command to execute on startup of the job. eg. "python - train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UriFileDataVersion(DataVersionBaseDetails): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFolderDataVersion(DataVersionBaseDetails): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriReference(msrest.serialization.Model): - """TODO - UriReference. - - :ivar file: Single file uri path. - :vartype file: str - :ivar folder: Folder uri path. - :vartype folder: str - """ - - _attribute_map = { - 'file': {'key': 'file', 'type': 'str'}, - 'folder': {'key': 'folder', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Single file uri path. - :paramtype file: str - :keyword folder: Folder uri path. - :paramtype folder: str - """ - super(UriReference, self).__init__(**kwargs) - self.file = kwargs.get('file', None) - self.folder = kwargs.get('folder', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py deleted file mode 100644 index 89722d4325aa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py +++ /dev/null @@ -1,6895 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class AcrDetail(msrest.serialization.Model): - """AcrDetail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar acr_address: - :vartype acr_address: str - :ivar acr_name: - :vartype acr_name: str - :ivar acr_region: - :vartype acr_region: str - :ivar arm_scope: - :vartype arm_scope: str - :ivar resource_group_name: - :vartype resource_group_name: str - :ivar subscription_id: - :vartype subscription_id: str - """ - - _validation = { - 'arm_scope': {'readonly': True}, - } - - _attribute_map = { - 'acr_address': {'key': 'acrAddress', 'type': 'str'}, - 'acr_name': {'key': 'acrName', 'type': 'str'}, - 'acr_region': {'key': 'acrRegion', 'type': 'str'}, - 'arm_scope': {'key': 'armScope', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - acr_address: Optional[str] = None, - acr_name: Optional[str] = None, - acr_region: Optional[str] = None, - resource_group_name: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword acr_address: - :paramtype acr_address: str - :keyword acr_name: - :paramtype acr_name: str - :keyword acr_region: - :paramtype acr_region: str - :keyword resource_group_name: - :paramtype resource_group_name: str - :keyword subscription_id: - :paramtype subscription_id: str - """ - super(AcrDetail, self).__init__(**kwargs) - self.acr_address = acr_address - self.acr_name = acr_name - self.acr_region = acr_region - self.arm_scope = None - self.resource_group_name = resource_group_name - self.subscription_id = subscription_id - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. Specifies the type of identity framework.Constant filled by - server. Possible values include: "Managed", "AMLToken". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. Specifies the type of identity framework.Constant filled by - server. Possible values include: "Managed", "AMLToken". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class Datastore(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(Datastore, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'Datastore' # type: str - self.is_default = None - - -class AzureBlobDatastore(Datastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureBlob' # type: str - 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(Datastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - - -class AzureDataLakeGen2Datastore(Datastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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(Datastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. Storage type backing the datastore.Constant filled by server. - Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. TODO - File share name. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. TODO - File share name. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureFile' # type: str - 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 InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = code_configuration - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. Base environment type.Constant filled by server. - Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. Base environment type.Constant filled by server. - Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - **kwargs - ): - """ - :keyword resource_id: Required. Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = resource_id - - -class Binding(msrest.serialization.Model): - """Binding Inputs/Outputs to ComponentJob Inputs/Outputs etc. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BasicBinding. - - All required parameters must be populated in order to send to Azure. - - :ivar binding_type: Required. Type of Binding.Constant filled by server. Possible values - include: "Basic". - :vartype binding_type: str or ~azure.mgmt.machinelearningservices.models.BindingType - """ - - _validation = { - 'binding_type': {'required': True}, - } - - _attribute_map = { - 'binding_type': {'key': 'bindingType', 'type': 'str'}, - } - - _subtype_map = { - 'binding_type': {'Basic': 'BasicBinding'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Binding, self).__init__(**kwargs) - self.binding_type = None # type: Optional[str] - - -class BasicBinding(Binding): - """Basic binding with simple source and destination. - - All required parameters must be populated in order to send to Azure. - - :ivar binding_type: Required. Type of Binding.Constant filled by server. Possible values - include: "Basic". - :vartype binding_type: str or ~azure.mgmt.machinelearningservices.models.BindingType - :ivar destination: Destination reference. - :vartype destination: str - :ivar source: Source reference. - :vartype source: str - """ - - _validation = { - 'binding_type': {'required': True}, - } - - _attribute_map = { - 'binding_type': {'key': 'bindingType', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - *, - destination: Optional[str] = None, - source: Optional[str] = None, - **kwargs - ): - """ - :keyword destination: Destination reference. - :paramtype destination: str - :keyword source: Source reference. - :paramtype source: str - """ - super(BasicBinding, self).__init__(**kwargs) - self.binding_type = 'Basic' # type: str - self.destination = destination - self.source = source - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :ivar storage_account_arm_id: - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["DataReferenceCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :keyword storage_account_arm_id: - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequestDto. - - :ivar asset_id: - :vartype asset_id: str - :ivar blob_uri: - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - blob_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - :keyword blob_uri: - :paramtype blob_uri: str - """ - super(BlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = asset_id - self.blob_uri = blob_uri - - -class BlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponseDto. - - :ivar blob_reference_for_consumption: - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - """ - super(BlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. URI of the Docker build context used to build the image. Supports - blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. URI of the Docker build context used to build the image. - Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. ID of the tenant to which the service principal belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. Thumbprint of the certificate used for authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class CodeContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, - } - - def __init__( - self, - *, - properties: "CodeContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - super(CodeContainerData, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerDetails(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, - } - - def __init__( - self, - *, - properties: "CodeVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - super(CodeVersionData, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionDetails(AssetBase): - """Code asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobBase(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Job, CommandJob, PipelineJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'Base': 'Job', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - is_archived: Optional[bool] = False, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.is_archived = is_archived - self.job_type = 'JobBase' # type: str - self.parent_job_name = None - self.services = services - self.status = None - - -class CommandJob(JobBase): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. The command to execute on startup of the job. eg. "python train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - is_archived: Optional[bool] = False, - services: Optional[Dict[str, "JobService"]] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - identity: Optional["IdentityConfiguration"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - resources: Optional["ResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. The command to execute on startup of the job. eg. "python - train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.identity = identity - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. JobLimit type.Constant filled by server. Possible values - include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. JobLimit type.Constant filled by server. Possible values - include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - super(ComponentContainerData, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerDetails(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentJob(msrest.serialization.Model): - """Definition of a ComponentJob. - - :ivar component_id: Reference to component artifact. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar inputs: Data input set for job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar outputs: Data output set for job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar overrides: Override component default settings. - :vartype overrides: any - """ - - _attribute_map = { - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'overrides': {'key': 'overrides', 'type': 'object'}, - } - - def __init__( - self, - *, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - overrides: Optional[Any] = None, - **kwargs - ): - """ - :keyword component_id: Reference to component artifact. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword inputs: Data input set for job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword outputs: Data output set for job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword overrides: Override component default settings. - :paramtype overrides: any - """ - super(ComponentJob, self).__init__(**kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.inputs = inputs - self.outputs = outputs - self.overrides = overrides - - -class ComponentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - super(ComponentVersionData, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionDetails(AssetBase): - """Definition of a component version: defines resources that span component types. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = inference_configuration - - -class DataContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, - } - - def __init__( - self, - *, - properties: "DataContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - super(DataContainerData, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerDetails(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. Specifies the type of data. Possible values include: "uri_file", - "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. Specifies the type of data. Possible values include: "uri_file", - "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataReferenceCredentialDto(msrest.serialization.Model): - """DataReferenceCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: . - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. Constant filled by server. Possible values include: "SAS", - "DockerCredentials", "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - - -class DataVersionBaseData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - super(DataVersionBaseData, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseDetails(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DataVersionBaseDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str - self.data_uri = data_uri - self.intellectual_property = intellectual_property - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBaseData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class DockerCredentialDto(msrest.serialization.Model): - """DockerCredentialDto. - - :ivar password: - :vartype password: str - :ivar user_name: - :vartype user_name: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - user_name: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword user_name: - :paramtype user_name: str - """ - super(DockerCredentialDto, self).__init__(**kwargs) - self.password = password - self.user_name = user_name - - -class EnvironmentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - super(EnvironmentContainerData, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerDetails(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - super(EnvironmentVersionData, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionDetails(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . - Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.intellectual_property = intellectual_property - self.os_type = os_type - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class ImageReferenceForConsumptionDto(msrest.serialization.Model): - """ImageReferenceForConsumptionDto. - - :ivar acr_details: - :vartype acr_details: ~azure.mgmt.machinelearningservices.models.AcrDetail - :ivar credential: - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :ivar image_name: - :vartype image_name: str - :ivar image_registry_reference: - :vartype image_registry_reference: str - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': 'AcrDetail'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, - 'image_name': {'key': 'imageName', 'type': 'str'}, - 'image_registry_reference': {'key': 'imageRegistryReference', 'type': 'str'}, - } - - def __init__( - self, - *, - acr_details: Optional["AcrDetail"] = None, - credential: Optional["DataReferenceCredentialDto"] = None, - image_name: Optional[str] = None, - image_registry_reference: Optional[str] = None, - **kwargs - ): - """ - :keyword acr_details: - :paramtype acr_details: ~azure.mgmt.machinelearningservices.models.AcrDetail - :keyword credential: - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto - :keyword image_name: - :paramtype image_name: str - :keyword image_registry_reference: - :paramtype image_registry_reference: str - """ - super(ImageReferenceForConsumptionDto, self).__init__(**kwargs) - self.acr_details = acr_details - self.credential = credential - self.image_name = image_name - self.image_registry_reference = image_registry_reference - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. Publisher of the Intellectual Property. Must be the same as Registry - publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - publisher: str, - protection_level: Optional[Union[str, "ProtectionLevel"]] = None, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. Publisher of the Intellectual Property. Must be the same as - Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = protection_level - self.publisher = publisher - - -class Job(JobBase): - """Basic Job class with all job base properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - is_archived: Optional[bool] = False, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(Job, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Base' # type: str - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobInputDataset, JobInputLiteral, JobInputUri. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'Dataset': 'JobInputDataset', 'Literal': 'JobInputLiteral', 'Uri': 'JobInputUri'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class JobInputDataset(JobInput): - """InputDataset type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar dataset_id: Required. Dataset ARM Id for the input. - :vartype dataset_id: str - :ivar mode: Dataset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - """ - - _validation = { - 'job_input_type': {'required': True}, - 'dataset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_id: str, - description: Optional[str] = None, - mode: Optional[Union[str, "InputDataDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword dataset_id: Required. Dataset ARM Id for the input. - :paramtype dataset_id: str - :keyword mode: Dataset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - """ - super(JobInputDataset, self).__init__(description=description, **kwargs) - self.job_input_type = 'Dataset' # type: str - self.dataset_id = dataset_id - self.mode = mode - - -class JobInputLiteral(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Literal value for the input. - :paramtype value: str - """ - super(JobInputLiteral, self).__init__(description=description, **kwargs) - self.job_input_type = 'Literal' # type: str - self.value = value - - -class JobInputUri(JobInput): - """Input uri type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Dataset", "Uri", "Literal". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar mode: Input Uri Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - :ivar uri: Required. Uri path. - :vartype uri: ~azure.mgmt.machinelearningservices.models.UriReference - """ - - _validation = { - 'job_input_type': {'required': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'UriReference'}, - } - - def __init__( - self, - *, - uri: "UriReference", - description: Optional[str] = None, - mode: Optional[Union[str, "InputDataDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword mode: Input Uri Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode - :keyword uri: Required. Uri path. - :paramtype uri: ~azure.mgmt.machinelearningservices.models.UriReference - """ - super(JobInputUri, self).__init__(description=description, **kwargs) - self.job_input_type = 'Uri' # type: str - self.mode = mode - self.uri = uri - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobOutputDataset, JobOutputUri. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Uri", "Dataset". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'Dataset': 'JobOutputDataset', 'Uri': 'JobOutputUri'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class JobOutputDataset(JobOutput): - """Dataset output. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Uri", "Dataset". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - :ivar mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - mode: Optional[Union[str, "OutputDataDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - :keyword mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode - """ - super(JobOutputDataset, self).__init__(description=description, **kwargs) - self.job_output_type = 'Dataset' # type: str - self.mode = mode - - -class JobOutputUri(JobOutput): - """Uri output. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. Specifies the type of job.Constant filled by server. Possible - values include: "Uri", "Dataset". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - :ivar mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode - :ivar uri: Uri path. - :vartype uri: ~azure.mgmt.machinelearningservices.models.UriReference - """ - - _validation = { - 'job_output_type': {'required': True}, - 'mode': {'readonly': True}, - 'uri': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'UriReference'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutputUri, self).__init__(description=description, **kwargs) - self.job_output_type = 'Uri' # type: str - self.mode = None - self.uri = None - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.port = port - self.properties = properties - self.status = None - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. Specifies the type of identity framework.Constant filled by - server. Possible values include: "Managed", "AMLToken". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityCredentialDto(msrest.serialization.Model): - """ManagedIdentityCredentialDto. - - :ivar managed_identity_type: - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _attribute_map = { - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - managed_identity_type: Optional[str] = None, - user_managed_identity_client_id: Optional[str] = None, - user_managed_identity_principal_id: Optional[str] = None, - user_managed_identity_resource_id: Optional[str] = None, - user_managed_identity_tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword managed_identity_type: - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredentialDto, self).__init__(**kwargs) - self.managed_identity_type = managed_identity_type - self.user_managed_identity_client_id = user_managed_identity_client_id - self.user_managed_identity_principal_id = user_managed_identity_principal_id - self.user_managed_identity_resource_id = user_managed_identity_resource_id - self.user_managed_identity_tenant_id = user_managed_identity_tenant_id - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLTableData(DataVersionBaseDetails): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, - } - - def __init__( - self, - *, - properties: "ModelContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - super(ModelContainerData, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerDetails(AssetContainer): - """ModelContainerDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. Type of the input included in the target image. Possible values - include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. Type of the input included in the target image. Possible values - include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelVersionAllowedDeploymentTemplatesItem(msrest.serialization.Model): - """ModelVersionAllowedDeploymentTemplatesItem. - - :ivar asset_id: - :vartype asset_id: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - """ - super(ModelVersionAllowedDeploymentTemplatesItem, self).__init__(**kwargs) - self.asset_id = asset_id - - -class ModelVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, - } - - def __init__( - self, - *, - properties: "ModelVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - super(ModelVersionData, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionDefaultDeploymentTemplate(msrest.serialization.Model): - """ModelVersionDefaultDeploymentTemplate. - - :ivar asset_id: - :vartype asset_id: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - """ - super(ModelVersionDefaultDeploymentTemplate, self).__init__(**kwargs) - self.asset_id = asset_id - - -class ModelVersionDetails(AssetBase): - """Model asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar origin_asset_id: AssetId of origin model. - :vartype origin_asset_id: str - :ivar default_deployment_template: - :vartype default_deployment_template: - ~azure.mgmt.machinelearningservices.models.ModelVersionDefaultDeploymentTemplate - :ivar allowed_deployment_templates: - :vartype allowed_deployment_templates: - list[~azure.mgmt.machinelearningservices.models.ModelVersionAllowedDeploymentTemplatesItem] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'origin_asset_id': {'key': 'originAssetId', 'type': 'str'}, - 'default_deployment_template': {'key': 'defaultDeploymentTemplate', 'type': 'ModelVersionDefaultDeploymentTemplate'}, - 'allowed_deployment_templates': {'key': 'allowedDeploymentTemplates', 'type': '[ModelVersionAllowedDeploymentTemplatesItem]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - origin_asset_id: Optional[str] = None, - default_deployment_template: Optional["ModelVersionDefaultDeploymentTemplate"] = None, - allowed_deployment_templates: Optional[List["ModelVersionAllowedDeploymentTemplatesItem"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword origin_asset_id: AssetId of origin model. - :paramtype origin_asset_id: str - :keyword default_deployment_template: - :paramtype default_deployment_template: - ~azure.mgmt.machinelearningservices.models.ModelVersionDefaultDeploymentTemplate - :keyword allowed_deployment_templates: - :paramtype allowed_deployment_templates: - list[~azure.mgmt.machinelearningservices.models.ModelVersionAllowedDeploymentTemplatesItem] - """ - super(ModelVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.intellectual_property = intellectual_property - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.origin_asset_id = origin_asset_id - self.default_deployment_template = default_deployment_template - self.allowed_deployment_templates = allowed_deployment_templates - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. Defines supported metric goals for hyperparameter tuning. Possible values - include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. Defines supported metric goals for hyperparameter tuning. Possible - values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. Input path type for package inputs.Constant filled by server. - Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_name: Optional[str] = None, - resource_version: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Properties dictionary. - :vartype properties: dict[str, str] - :ivar sku_architecture_type: The sku architecture type. - :vartype sku_architecture_type: str - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. Arm ID of the target environment to be created by - package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'sku_architecture_type': {'key': 'skuArchitectureType', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_id: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - properties: Optional[Dict[str, str]] = None, - sku_architecture_type: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Properties dictionary. - :paramtype properties: dict[str, str] - :keyword sku_architecture_type: The sku architecture type. - :paramtype sku_architecture_type: str - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. Arm ID of the target environment to be created by - package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.properties = properties - self.sku_architecture_type = sku_architecture_type - self.tags = tags - self.target_environment_id = target_environment_id - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Properties dictionary. - :vartype properties: dict[str, str] - :ivar sku_architecture_type: The sku architecture type. - :vartype sku_architecture_type: str - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'sku_architecture_type': {'key': 'skuArchitectureType', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - *, - properties: Optional[Dict[str, str]] = None, - sku_architecture_type: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: Properties dictionary. - :paramtype properties: dict[str, str] - :keyword sku_architecture_type: The sku architecture type. - :paramtype sku_architecture_type: str - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = properties - self.sku_architecture_type = sku_architecture_type - self.tags = None - self.target_environment_id = None - - -class PipelineJob(JobBase): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar bindings: Binding to represent relation between inputs, outputs and parameters. - :vartype bindings: list[~azure.mgmt.machinelearningservices.models.Binding] - :ivar component_jobs: JobDefinition set for PipelineStepJobs. - :vartype component_jobs: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentJob] - :ivar inputs: Data input set for jobs. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar outputs: Data output set for jobs. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'bindings': {'key': 'bindings', 'type': '[Binding]'}, - 'component_jobs': {'key': 'componentJobs', 'type': '{ComponentJob}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - is_archived: Optional[bool] = False, - services: Optional[Dict[str, "JobService"]] = None, - bindings: Optional[List["Binding"]] = None, - component_jobs: Optional[Dict[str, "ComponentJob"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword bindings: Binding to represent relation between inputs, outputs and parameters. - :paramtype bindings: list[~azure.mgmt.machinelearningservices.models.Binding] - :keyword component_jobs: JobDefinition set for PipelineStepJobs. - :paramtype component_jobs: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentJob] - :keyword inputs: Data input set for jobs. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword outputs: Data output set for jobs. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.bindings = bindings - self.component_jobs = component_jobs - self.inputs = inputs - self.outputs = outputs - self.settings = settings - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.properties = properties - - -class ResourceManagementAssetReferenceData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.ResourceManagementAssetReferenceDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ResourceManagementAssetReferenceDetails'}, - } - - def __init__( - self, - *, - properties: "ResourceManagementAssetReferenceDetails", - **kwargs - ): - """ - :keyword properties: Required. Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.ResourceManagementAssetReferenceDetails - """ - super(ResourceManagementAssetReferenceData, self).__init__(**kwargs) - self.properties = properties - - -class ResourceManagementAssetReferenceDetails(AssetReferenceBase): - """Resource Management asset reference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. Specifies the type of asset reference.Constant filled by - server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar destination_name: Destination asset name for import. - :vartype destination_name: str - :ivar destination_version: Destination asset version for import. - :vartype destination_version: str - :ivar source_asset_id: Required. ARM resource ID of the source asset. - :vartype source_asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'source_asset_id': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'source_asset_id': {'key': 'sourceAssetId', 'type': 'str'}, - } - - def __init__( - self, - *, - source_asset_id: str, - destination_name: Optional[str] = None, - destination_version: Optional[str] = None, - **kwargs - ): - """ - :keyword destination_name: Destination asset name for import. - :paramtype destination_name: str - :keyword destination_version: Destination asset version for import. - :paramtype destination_version: str - :keyword source_asset_id: Required. ARM resource ID of the source asset. - :paramtype source_asset_id: str - """ - super(ResourceManagementAssetReferenceDetails, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.destination_name = destination_name - self.destination_version = destination_version - self.source_asset_id = source_asset_id - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. The path for the route. - :vartype path: str - :ivar port: Required. The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. The path for the route. - :paramtype path: str - :keyword port: Required. The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASCredentialDto(msrest.serialization.Model): - """SASCredentialDto. - - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _attribute_map = { - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "None", "Sas", - "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. ID of the tenant to which the service principal belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. Credential type used to authentication with storage.Constant - filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class SweepJob(JobBase): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. Specifies the type of job.Constant filled by server. Possible values - include: "Command", "Sweep", "Pipeline", "Base". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar parent_job_name: TODO - Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar identity: Identity configuration. If set, this should be one of AmlToken, ManagedIdentity - or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar sampling_algorithm: Required. Type of the hyperparameter sampling algorithms. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. A dictionary containing each parameter and its distribution. The - dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'parent_job_name': {'readonly': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: Union[str, "SamplingAlgorithm"], - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - is_archived: Optional[bool] = False, - services: Optional[Dict[str, "JobService"]] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - identity: Optional["IdentityConfiguration"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword sampling_algorithm: Required. Type of the hyperparameter sampling algorithms. Possible - values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. A dictionary containing each parameter and its distribution. - The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = early_termination - self.identity = identity - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. JobLimit type.Constant filled by server. Possible values - include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TemporaryDataReferenceRequestDto(msrest.serialization.Model): - """TemporaryDataReferenceRequestDto. - - :ivar asset_id: - :vartype asset_id: str - :ivar temporary_data_reference_id: If TemporaryDataReferenceId = null then random guid will be - used. - :vartype temporary_data_reference_id: str - :ivar temporary_data_reference_type: Either TemporaryBlobReference or TemporaryImageReference. - :vartype temporary_data_reference_type: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'temporary_data_reference_id': {'key': 'temporaryDataReferenceId', 'type': 'str'}, - 'temporary_data_reference_type': {'key': 'temporaryDataReferenceType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - temporary_data_reference_id: Optional[str] = None, - temporary_data_reference_type: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: - :paramtype asset_id: str - :keyword temporary_data_reference_id: If TemporaryDataReferenceId = null then random guid will - be used. - :paramtype temporary_data_reference_id: str - :keyword temporary_data_reference_type: Either TemporaryBlobReference or - TemporaryImageReference. - :paramtype temporary_data_reference_type: str - """ - super(TemporaryDataReferenceRequestDto, self).__init__(**kwargs) - self.asset_id = asset_id - self.temporary_data_reference_id = temporary_data_reference_id - self.temporary_data_reference_type = temporary_data_reference_type - - -class TemporaryDataReferenceResponseDto(msrest.serialization.Model): - """TemporaryDataReferenceResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar image_reference_for_consumption: - :vartype image_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.ImageReferenceForConsumptionDto - :ivar temporary_data_reference_id: - :vartype temporary_data_reference_id: str - :ivar temporary_data_reference_type: - :vartype temporary_data_reference_type: str - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'image_reference_for_consumption': {'key': 'imageReferenceForConsumption', 'type': 'ImageReferenceForConsumptionDto'}, - 'temporary_data_reference_id': {'key': 'temporaryDataReferenceId', 'type': 'str'}, - 'temporary_data_reference_type': {'key': 'temporaryDataReferenceType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - image_reference_for_consumption: Optional["ImageReferenceForConsumptionDto"] = None, - temporary_data_reference_id: Optional[str] = None, - temporary_data_reference_type: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword image_reference_for_consumption: - :paramtype image_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.ImageReferenceForConsumptionDto - :keyword temporary_data_reference_id: - :paramtype temporary_data_reference_id: str - :keyword temporary_data_reference_type: - :paramtype temporary_data_reference_type: str - """ - super(TemporaryDataReferenceResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.image_reference_for_consumption = image_reference_for_consumption - self.temporary_data_reference_id = temporary_data_reference_id - self.temporary_data_reference_type = temporary_data_reference_type - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. Specifies the type of distribution framework.Constant filled - by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. The command to execute on startup of the job. eg. "python train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["ResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. The command to execute on startup of the job. eg. "python - train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. The ARM resource ID of the Environment specification for the - job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. Inferencing server type for various targets.Constant filled by - server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = inference_configuration - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. Name of policy configuration.Constant filled by server. Possible - values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UriFileDataVersion(DataVersionBaseDetails): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFolderDataVersion(DataVersionBaseDetails): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. Specifies the type of data.Constant filled by server. Possible - values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20211001Dataplane.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriReference(msrest.serialization.Model): - """TODO - UriReference. - - :ivar file: Single file uri path. - :vartype file: str - :ivar folder: Folder uri path. - :vartype folder: str - """ - - _attribute_map = { - 'file': {'key': 'file', 'type': 'str'}, - 'folder': {'key': 'folder', 'type': 'str'}, - } - - def __init__( - self, - *, - file: Optional[str] = None, - folder: Optional[str] = None, - **kwargs - ): - """ - :keyword file: Single file uri path. - :paramtype file: str - :keyword folder: Folder uri path. - :paramtype folder: str - """ - super(UriReference, self).__init__(**kwargs) - self.file = file - self.folder = folder diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py deleted file mode 100644 index b7a43c68f0ab..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._data_references_operations import DataReferencesOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._resource_management_asset_reference_operations import ResourceManagementAssetReferenceOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._temporary_data_references_operations import TemporaryDataReferencesOperations - -__all__ = [ - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DataReferencesOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'ResourceManagementAssetReferenceOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'TemporaryDataReferencesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py deleted file mode 100644 index 4d7d90a1f8a7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py +++ /dev/null @@ -1,507 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skiptoken=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainerData" - """Get container. - - Get container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.CodeContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainerData" - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py deleted file mode 100644 index 02622b338cd7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py +++ /dev/null @@ -1,610 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^(?![\-_.])[a-zA-Z0-9\-_.]{1,255}(? Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersionData" - """Get version. - - Get version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.CodeVersionData" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.CodeVersionData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py deleted file mode 100644 index 6e8dd1904272..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py +++ /dev/null @@ -1,507 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skiptoken=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainerData" - """Get container. - - Get container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ComponentContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainerData" - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py deleted file mode 100644 index 71d46340bc69..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py +++ /dev/null @@ -1,610 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^(?![\-_.])[a-zA-Z0-9\-_.]{1,255}(? Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersionData" - """Get version. - - Get version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ComponentVersionData" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ComponentVersionData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py deleted file mode 100644 index 0f4a047184ae..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py +++ /dev/null @@ -1,515 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), - } - - _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') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - if list_view_type is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skiptoken=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :param list_view_type: - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainerData" - """Get container. - - Get container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.DataContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainerData" - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py deleted file mode 100644 index 8ae8169926d7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py +++ /dev/null @@ -1,172 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_blob_reference_sas_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datarefs/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataReferencesOperations(object): - """DataReferencesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_blob_reference_sas( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.BlobReferenceSASRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.BlobReferenceSASResponseDto" - """get_blob_reference_sas. - - :param name: - :type name: str - :param version: - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.BlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datarefs/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py deleted file mode 100644 index 7957240c841f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py +++ /dev/null @@ -1,630 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - if tags is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^(?![\-_.])[a-zA-Z0-9\-_.]{1,255}(? Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param name: Data container's name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBaseData" - """Get version. - - Get version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.DataVersionBaseData" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBaseData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.DataVersionBaseData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py deleted file mode 100644 index 4be77b67bd7b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,515 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - if list_view_type is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skiptoken=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainerData" - """Get container. - - Get container. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.EnvironmentContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainerData" - """Create or update container. - - Create or update container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainerData') - - request = build_create_or_update_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py deleted file mode 100644 index 7960ee575ae7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,626 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^(?![\-_.])[a-zA-Z0-9\-_.]{1,255}(? Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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 - :param stage: - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - order_by=order_by, - top=top, - skiptoken=skiptoken, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersionData" - """Get version. - - Get version. - - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.EnvironmentVersionData" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.EnvironmentVersionData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py deleted file mode 100644 index e955bf76e97c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py +++ /dev/null @@ -1,586 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - if list_view_type is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skiptoken=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: 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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainerData" - """Get container. - - Get container. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ModelContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainerData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainerData') - - request = build_create_or_update_request_initial( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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 [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ModelContainerData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainerData"] - """Create or update model container. - - Create or update model container. - - :param name: Container name. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainerData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainerData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - name=name, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py deleted file mode 100644 index 14fdf9ffa294..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py +++ /dev/null @@ -1,844 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - name, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - skiptoken = kwargs.pop('skiptoken', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skiptoken is not None: - _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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 = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^(?![\-_.])[a-zA-Z0-9\-_.]{1,255}(? HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - name, # type: str - resource_group_name, # type: str - registry_name, # type: str - skiptoken=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param name: Container name. This is case-sensitive. - :type name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param skiptoken: Continuation token for pagination. - :type skiptoken: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - name=name, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skiptoken=skiptoken, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_delete_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersionData" - """Get version. - - Get version. - - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - - - request = build_get_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ModelVersionData" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersionData') - - request = build_create_or_update_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( # pylint: disable=inconsistent-return-statements - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ModelVersionData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Create or update version. - - Create or update version. - - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _package_initial( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - name, # type: str - version, # type: str - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - name=name, - version=version, - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py deleted file mode 100644 index 1179bac0ee72..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py +++ /dev/null @@ -1,238 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_import_method_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import") # 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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ResourceManagementAssetReferenceOperations(object): - """ResourceManagementAssetReferenceOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _import_method_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ResourceManagementAssetReferenceData" - **kwargs # type: Any - ): - # type: (...) -> Optional[Any] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[Any]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ResourceManagementAssetReferenceData') - - request = build_import_method_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._import_method_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('object', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _import_method_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import"} # type: ignore - - - @distributed_trace - def begin_import_method( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.ResourceManagementAssetReferenceData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[Any] - """Import the source asset provided in the request into registry. - The import performs a deep copy of the source asset given in the request into the registry. - The destination name/version value in ImportSourceAssetReference allows the client to update - the name/version value after being imported. - If the destination resource exists, it will be overwritten. - - Import the source asset provided in the request into registry. - The import performs a deep copy of the source asset given in the request into the registry. - The destination name/version value in ImportSourceAssetReference allows the client to update - the name/version value after being imported. - If the destination resource exists, it will be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: Import request contains the source asset reference value and destination version - value. - :type body: ~azure.mgmt.machinelearningservices.models.ResourceManagementAssetReferenceData - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either any or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[any] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._import_method_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_import_method.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py deleted file mode 100644 index bfb6bf3ca808..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py +++ /dev/null @@ -1,172 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_create_or_get_temporary_data_reference_request( - name, # type: str - version, # type: str - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/tempdatarefs/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^(?![\-_.])[a-zA-Z0-9\-_.]{1,255}(? "_models.TemporaryDataReferenceResponseDto" - """create_or_get_temporary_data_reference. - - :param name: - :type name: str - :param version: - :type version: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. - :type registry_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.TemporaryDataReferenceRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TemporaryDataReferenceResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.TemporaryDataReferenceResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TemporaryDataReferenceResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'TemporaryDataReferenceRequestDto') - - request = build_create_or_get_temporary_data_reference_request( - name=name, - version=version, - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_temporary_data_reference.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('TemporaryDataReferenceResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_temporary_data_reference.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/tempdatarefs/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file From ef2751c6177b5fc616e8673b14c678cbaf3f0704 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 18:37:09 +0530 Subject: [PATCH 094/146] Migrate distribution/pipeline/job-resource-config off v2023_04 to arm (Ray+locations via hybrid wire keys) --- .../azure/ai/ml/entities/_job/distribution.py | 41 ++++++++----------- .../_job/job_resource_configuration.py | 23 +++++++---- .../_job/pipeline/_pipeline_job_helpers.py | 30 -------------- sdk/ml/azure-ai-ml/tests/conftest.py | 5 ++- 4 files changed, 36 insertions(+), 63 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py index 6390ac069bab..d72045093e11 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py @@ -9,28 +9,14 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( DistributionConfiguration as RestDistributionConfiguration, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( - DistributionType as RestDistributionType, -) from azure.ai.ml._restclient.arm_ml_service.models import Mpi as RestMpi from azure.ai.ml._restclient.arm_ml_service.models import PyTorch as RestPyTorch - -# ``Ray`` distribution is not modeled on the shared arm_ml_service client yet, so keep the legacy msrest -# model for that subtype; the ``to_hybrid_rest_model`` boundary converts it when embedded in an arm envelope. -from azure.ai.ml._restclient.v2023_04_01_preview.models import Ray as RestRay from azure.ai.ml._restclient.arm_ml_service.models import TensorFlow as RestTensorFlow from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.constants import DistributionType from azure.ai.ml.entities._mixins import RestTranslatableMixin -SDK_TO_REST = { - DistributionType.MPI: RestDistributionType.MPI, - DistributionType.TENSORFLOW: RestDistributionType.TENSOR_FLOW, - DistributionType.PYTORCH: RestDistributionType.PY_TORCH, - DistributionType.RAY: RestDistributionType.RAY, -} - class DistributionConfiguration(RestTranslatableMixin): """Distribution configuration for a component or job. @@ -225,15 +211,24 @@ def __init__( self.head_node_additional_args = head_node_additional_args self.worker_node_additional_args = worker_node_additional_args - def _to_rest_object(self) -> RestRay: - return RestRay( - port=self.port, - address=self.address, - include_dashboard=self.include_dashboard, - dashboard_port=self.dashboard_port, - head_node_additional_args=self.head_node_additional_args, - worker_node_additional_args=self.worker_node_additional_args, - ) + def _to_rest_object(self) -> RestDistributionConfiguration: + # ``Ray`` is not modeled on the shared arm_ml_service client. Build the wire dict directly (omitting + # None fields to match the legacy msrest ``Ray.serialize()`` output) and deserialize it into the arm + # ``DistributionConfiguration`` hybrid so it serializes byte-identically inside an arm job envelope. + wire: Dict[str, Any] = {"distributionType": "Ray"} + if self.port is not None: + wire["port"] = self.port + if self.address is not None: + wire["address"] = self.address + if self.include_dashboard is not None: + wire["includeDashboard"] = self.include_dashboard + if self.dashboard_port is not None: + wire["dashboardPort"] = self.dashboard_port + if self.head_node_additional_args is not None: + wire["headNodeAdditionalArgs"] = self.head_node_additional_args + if self.worker_node_additional_args is not None: + wire["workerNodeAdditionalArgs"] = self.worker_node_additional_args + return RestDistributionConfiguration._deserialize(wire, []) DISTRIBUTION_TYPE_MAP = { diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py index 5b1d53ce1245..e20d3f998b96 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py @@ -6,8 +6,7 @@ import logging from typing import Any, Dict, List, Optional, Union, cast -from azure.ai.ml._restclient.arm_ml_service.models import JobResourceConfiguration as RestJobResourceConfiguration202501 -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobResourceConfiguration as RestJobResourceConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import JobResourceConfiguration as RestJobResourceConfiguration from azure.ai.ml.constants._job.job import JobComputePropertyFields from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin from azure.ai.ml.entities._util import convert_ordered_dict_to_dict @@ -161,32 +160,38 @@ def properties(self, properties: Optional[Dict[str, Any]]) -> None: else: raise TypeError("properties must be a dict.") - def _to_rest_object(self) -> Union[RestJobResourceConfiguration, RestJobResourceConfiguration202501]: + def _to_rest_object(self) -> RestJobResourceConfiguration: if self.docker_args and isinstance(self.docker_args, list): # NOTE: max_instance_count is intentionally NOT set here. The 2025-01-01-preview wire # contract (mfe.json) has no maxInstanceCount on JobResourceConfiguration/ResourceConfiguration, # and the old v2025 autorest model silently ignored it too, so omitting it keeps the wire - # output identical. It remains supported on the v2023_04 path below, whose swagger declares it. - return RestJobResourceConfiguration202501( + # output identical. It remains supported on the string-docker_args path below. + return RestJobResourceConfiguration( instance_count=self.instance_count, instance_type=self.instance_type, properties=self.properties.as_dict() if isinstance(self.properties, Properties) else None, docker_args_list=self.docker_args, shm_size=self.shm_size, ) - return RestJobResourceConfiguration( - locations=self.locations, + # ``locations`` and ``max_instance_count`` are not fields on the shared arm_ml_service (2025-01) + # JobResourceConfiguration model, so carry them as camelCase wire keys on the hybrid model. This + # reproduces the legacy v2023_04 wire byte-for-byte (verified). + rest_obj = RestJobResourceConfiguration( instance_count=self.instance_count, instance_type=self.instance_type, - max_instance_count=self.max_instance_count, properties=self.properties.as_dict() if isinstance(self.properties, Properties) else None, docker_args=self.docker_args, shm_size=self.shm_size, ) + if self.locations is not None: + rest_obj["locations"] = self.locations + if self.max_instance_count is not None: + rest_obj["maxInstanceCount"] = self.max_instance_count + return rest_obj @classmethod def _from_rest_object( - cls, obj: Optional[Union[RestJobResourceConfiguration, RestJobResourceConfiguration202501]] + cls, obj: Optional[Union[RestJobResourceConfiguration, Dict]] ) -> Optional["JobResourceConfiguration"]: if obj is None: return None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py index 22f6091f2ccd..b5c38c975fcf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_pipeline_job_helpers.py @@ -7,15 +7,6 @@ from azure.ai.ml._restclient.arm_ml_service.models import InputDeliveryMode from azure.ai.ml._restclient.arm_ml_service.models import JobInput as RestJobInput from azure.ai.ml._restclient.arm_ml_service.models import JobOutput as RestJobOutput - -# Ray has no arm_ml_service subtype (arm DistributionType only has PyTorch/TensorFlow/Mpi), so the -# distribution helper below must keep building the msrest v2023_04 distribution models. -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( - Mpi, - PyTorch, - Ray, - TensorFlow, -) from azure.ai.ml._utils.utils import snake_to_camel from azure.ai.ml.constants._component import ComponentJobConstants from azure.ai.ml.entities._inputs_outputs import Input, Output @@ -178,24 +169,3 @@ def from_dict_to_rest_io( error_category=ErrorCategory.USER_ERROR, ) return io_bindings, rest_io_objects - - -def from_dict_to_rest_distribution( - distribution_dict: Dict, -) -> Union[PyTorch, Mpi, TensorFlow, Ray]: - target_type = distribution_dict["distribution_type"].lower() - if target_type == "pytorch": - return PyTorch(**distribution_dict) - if target_type == "mpi": - return Mpi(**distribution_dict) - if target_type == "tensorflow": - return TensorFlow(**distribution_dict) - if target_type == "ray": - return Ray(**distribution_dict) - msg = "Distribution type must be pytorch, mpi, tensorflow or ray: {}".format(target_type) - raise ValidationException( - message=msg, - no_personal_data_message=msg, - target=ErrorTarget.PIPELINE, - error_category=ErrorCategory.USER_ERROR, - ) diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 91aa9797608b..01e31627764e 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -248,7 +248,10 @@ def mock_aml_services_2022_01_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2020_09_01_dataplanepreview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2020_09_01_dataplanepreview") + # Production code no longer imports v2020_09_01_dataplanepreview (migrated to arm_ml_service). This + # fixture is only used as a passed-in service_client mock, so return a plain mock rather than patching the + # (now removed) module. + return mocker.MagicMock() @pytest.fixture From 40da23e1d25182c148d27fc9966feb6d1c80bd8e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 19:56:18 +0530 Subject: [PATCH 095/146] Migrate model-package tree + workspace client off v2023_04/v2023_08 to arm (dicts + send_request begin_package) --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../azure/ai/ml/_utils/_package_utils.py | 72 +++---- .../azure/ai/ml/_utils/_registry_utils.py | 51 +++++ .../_package/base_environment_source.py | 16 +- .../_artifacts/_package/inferencing_server.py | 188 ++++++++++------- .../_artifacts/_package/model_package.py | 196 +++++++++++------- .../azure/ai/ml/entities/_schedule/trigger.py | 8 +- .../ai/ml/operations/_compute_operations.py | 2 +- .../ai/ml/operations/_evaluator_operations.py | 7 +- .../ml/operations/_feature_set_operations.py | 2 +- .../ai/ml/operations/_model_operations.py | 41 ++-- sdk/ml/azure-ai-ml/tests/conftest.py | 4 +- 12 files changed, 352 insertions(+), 237 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 44b39cb3749c..a738600f696c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -22,7 +22,6 @@ ) from azure.ai.ml._file_utils.file_utils import traverse_up_path_and_find_file from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient -from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.workspace_dataplane import WorkspaceDataplaneClient as ServiceClientWorkspaceDataplane from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope from azure.ai.ml._telemetry.logging_handler import configure_appinsights_logging @@ -100,6 +99,7 @@ ServiceClient022023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-02-01-preview") ServiceClient042023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-04-01-preview") ServiceClient062023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-06-01-preview") +ServiceClient082023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-08-01-preview") ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") ServiceClient102024PreviewTsp = partial(MachineLearningServicesMgmtClient, api_version="2024-10-01-preview") # arm_ml_service-backed client pinned to the 2024-04-01-preview wire api-version. Used by the workspace diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py index 7b781932bebb..239f8da829f8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py @@ -8,13 +8,6 @@ from azure.ai.ml.entities import BatchDeployment, OnlineDeployment, Deployment -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( - PackageRequest, - CodeConfiguration, - BaseEnvironmentId, - AzureMLOnlineInferencingServer, - AzureMLBatchInferencingServer, -) from azure.ai.ml.constants._common import REGISTRY_URI_FORMAT from azure.ai.ml._utils._logger_utils import initialize_logger_info @@ -29,58 +22,49 @@ def package_deployment(deployment: Deployment, model_ops) -> Deployment: model_name = model_str.split("/")[-3] target_environment_name = "packaged-env" - if deployment.code_configuration: - code_configuration = CodeConfiguration( - code_id=deployment.code_configuration.code, - scoring_script=deployment.code_configuration.scoring_script, - ) - else: - code_configuration = None + is_registry = model_str.startswith(REGISTRY_URI_FORMAT) + # The model-package models are not on the shared arm_ml_service client, so build every part of the + # request as a JSON-direct wire dict. These are byte-identical to the legacy v2023_04 msrest models + # (``AzureML*InferencingServer`` / ``BaseEnvironmentId`` / ``PackageRequest``) they replace. + inferencing_server: Any = None if isinstance(deployment, OnlineDeployment): - inferencing_server = AzureMLOnlineInferencingServer(code_configuration=code_configuration) + inferencing_server = {"serverType": "AzureMLOnline"} elif isinstance(deployment, BatchDeployment): - inferencing_server = AzureMLBatchInferencingServer(code_configuration=code_configuration) - else: - inferencing_server = None - - if deployment.environment: - base_environment_source = BaseEnvironmentId( - base_environment_source_type="EnvironmentAsset", resource_id=deployment.environment - ) - else: - base_environment_source = None + inferencing_server = {"serverType": "AzureMLBatch"} - package_request: Any = None - is_registry = model_str.startswith(REGISTRY_URI_FORMAT) - - # Mutate the (shared v2023_04) nested models in place, then assemble the request. For a registry package the - # request envelope is a byte-identical JSON-direct dict (the legacy v2021_10 ``PackageRequest`` wire) so no - # v2021_10 model is required. - if deployment.environment: - base_environment_source.resource_id = ( - deployment.environment if is_registry else "azureml:/" + deployment.environment - ) - if deployment.code_configuration: - inferencing_server.code_configuration.code_id = ( + if deployment.code_configuration and inferencing_server is not None: + code_id = ( deployment.code_configuration.code if deployment.code_configuration.code.startswith(REGISTRY_URI_FORMAT) else "azureml:/" + deployment.code_configuration.code ) + code_wire: Any = {"codeId": code_id} + if deployment.code_configuration.scoring_script is not None: + code_wire["scoringScript"] = deployment.code_configuration.scoring_script + inferencing_server["codeConfiguration"] = code_wire + + base_environment_source: Any = None + if deployment.environment: + base_environment_source = { + "baseEnvironmentSourceType": "EnvironmentAsset", + "resourceId": (deployment.environment if is_registry else "azureml:/" + deployment.environment), + } + package_request: Any = None if is_registry: package_request = {} if base_environment_source is not None: - package_request["baseEnvironmentSource"] = base_environment_source.serialize() + package_request["baseEnvironmentSource"] = base_environment_source if inferencing_server is not None: - package_request["inferencingServer"] = inferencing_server.serialize() + package_request["inferencingServer"] = inferencing_server package_request["targetEnvironmentId"] = target_environment_name else: - package_request = PackageRequest( - target_environment_name=target_environment_name, - base_environment_source=base_environment_source, - inferencing_server=inferencing_server, - ) + package_request = {"targetEnvironmentName": target_environment_name} + if base_environment_source is not None: + package_request["baseEnvironmentSource"] = base_environment_source + if inferencing_server is not None: + package_request["inferencingServer"] = inferencing_server try: packaged_env = model_ops.package( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 99af8a9f1c5d..4addfcffdc01 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -450,6 +450,57 @@ def get_long_running_output(pipeline_response): return LROPoller(service_client._client, raw_result, get_long_running_output, polling_method).result() +def begin_package_workspace_model( + service_client, name, version, resource_group, workspace_name, body, *, polling_interval=None +) -> dict: + """Byte-identical workspace model ``begin_package`` LRO. + + POST ``.../workspaces/{workspace_name}/models/{name}/versions/{version}/package`` at api-version + 2023-08-01-preview. Mirrors the legacy v2023_08 ``ModelVersionsOperations.begin_package`` (same URL, + api-version, JSON body, and 200/202 LRO handling) using the shared arm hybrid client's ``send_request`` + pipeline, so no per-version msrest client is required. + + :param service_client: The hybrid arm client bound to the workspace control-plane endpoint. + :param name: Model name. + :param version: Model version. + :param resource_group: Resource group name. + :param workspace_name: Workspace name. + :param body: The camelCase package-request wire dict. + :keyword polling_interval: Optional poll interval override. + :return: The raw camelCase final ``PackageResponse`` body. + :rtype: dict + """ + subscription_id = service_client._config.subscription_id + request = HttpRequest( + "POST", + f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + f"/providers/Microsoft.MachineLearningServices/workspaces/{workspace_name}" + f"/models/{name}/versions/{version}/package", + params={"api-version": "2023-08-01-preview"}, + headers={"Content-Type": "application/json", "Accept": "application/json"}, + json=body, + ) + path_format_arguments = { + "endpoint": service_client._serialize.url( + "self._config.base_url", service_client._config.base_url, "str", skip_quote=True + ), + } + request.url = service_client._client.format_url(request.url, **path_format_arguments) + raw_result = service_client._client._pipeline.run(request, stream=True) + response = raw_result.http_response + response.read() + if response.status_code not in [200, 202]: + response.raise_for_status() + + def get_long_running_output(pipeline_response): + http_response = pipeline_response.http_response + return http_response.json() if http_response.text() else None + + interval = polling_interval if polling_interval is not None else service_client._config.polling_interval + polling_method = ARMPolling(interval, path_format_arguments=path_format_arguments) + return LROPoller(service_client._client, raw_result, get_long_running_output, polling_method).result() + + def begin_import_registry_asset( service_client, resource_group, registry_name, body, *, polling_cls=ARMPolling, polling_interval=None, wait=True ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py index 1be671448d26..c3d154c57d11 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py @@ -4,9 +4,8 @@ # pylint: disable=redefined-builtin -from typing import Dict, Optional +from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2023_08_01_preview.models import BaseEnvironmentId as RestBaseEnvironmentId from azure.ai.ml._schema.assets.package.base_environment_source import BaseEnvironmentSourceSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY @@ -38,11 +37,18 @@ def __init__(self, type: str, resource_id: Optional[str] = None): self.resource_id = resource_id @classmethod - def _from_rest_object(cls, rest_obj: RestBaseEnvironmentId) -> "RestBaseEnvironmentId": + def _from_rest_object(cls, rest_obj: Any) -> "BaseEnvironment": + if isinstance(rest_obj, dict): + return BaseEnvironment( + type=rest_obj.get("baseEnvironmentSourceType"), resource_id=rest_obj.get("resourceId") + ) return BaseEnvironment(type=rest_obj.base_environment_source_type, resource_id=rest_obj.resource_id) def _to_dict(self) -> Dict: return dict(BaseEnvironmentSourceSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) - def _to_rest_object(self) -> RestBaseEnvironmentId: - return RestBaseEnvironmentId(base_environment_source_type=self.type, resource_id=self.resource_id) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"baseEnvironmentSourceType": self.type} + if self.resource_id is not None: + rest["resourceId"] = self.resource_id + return rest diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py index 659b0f2d6cc6..125d09a0048f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py @@ -4,25 +4,37 @@ # pylint: disable=protected-access,unused-argument -from typing import Any, Optional - -from azure.ai.ml._restclient.v2023_08_01_preview.models import CustomInferencingServer as RestCustomInferencingServer -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( - OnlineInferenceConfiguration as RestOnlineInferenceConfiguration, -) -from azure.ai.ml._restclient.v2023_08_01_preview.models import Route as RestRoute -from azure.ai.ml._restclient.v2023_08_01_preview.models import TritonInferencingServer as RestTritonInferencingServer -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( - AzureMLBatchInferencingServer as RestAzureMLBatchInferencingServer, -) -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( - AzureMLOnlineInferencingServer as RestAzureMLOnlineInferencingServer, -) +from typing import Any, Dict, Optional + from azure.ai.ml._utils._experimental import experimental from ...._deployment.code_configuration import CodeConfiguration +def _code_configuration_to_wire(code_configuration: Any) -> Optional[Dict[str, Any]]: + """Serialize a code configuration (entity, dict, or None) into the model-package wire shape. + + :param code_configuration: The code configuration to serialize. + :type code_configuration: Any + :return: The camelCase wire dict, or None. + :rtype: Optional[Dict[str, Any]] + """ + if code_configuration is None: + return None + if isinstance(code_configuration, dict): + return code_configuration + code_id = getattr(code_configuration, "code_id", None) + if code_id is None: + code_id = getattr(code_configuration, "code", None) + scoring_script = getattr(code_configuration, "scoring_script", None) + wire: Dict[str, Any] = {} + if code_id is not None: + wire["codeId"] = code_id + if scoring_script is not None: + wire["scoringScript"] = scoring_script + return wire + + @experimental class AzureMLOnlineInferencingServer: """Azure ML online inferencing configurations. @@ -37,11 +49,20 @@ def __init__(self, *, code_configuration: Optional[CodeConfiguration] = None, ** self.code_configuration = code_configuration @classmethod - def _from_rest_object(cls, rest_obj: RestAzureMLOnlineInferencingServer) -> "RestAzureMLOnlineInferencingServer": - return AzureMLOnlineInferencingServer(type=rest_obj.server_type, code_configuration=rest_obj.code_configuration) + def _from_rest_object(cls, rest_obj: Any) -> "AzureMLOnlineInferencingServer": + code = ( + rest_obj.get("codeConfiguration") + if isinstance(rest_obj, dict) + else getattr(rest_obj, "code_configuration", None) + ) + return AzureMLOnlineInferencingServer(code_configuration=code) - def _to_rest_object(self) -> RestAzureMLOnlineInferencingServer: - return RestAzureMLOnlineInferencingServer(server_type=self.type, code_configuration=self.code_configuration) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"serverType": "AzureMLOnline"} + code = _code_configuration_to_wire(self.code_configuration) + if code is not None: + rest["codeConfiguration"] = code + return rest @experimental @@ -58,11 +79,20 @@ def __init__(self, *, code_configuration: Optional[CodeConfiguration] = None, ** self.code_configuration = code_configuration @classmethod - def _from_rest_object(cls, rest_obj: RestAzureMLBatchInferencingServer) -> "RestAzureMLBatchInferencingServer": - return AzureMLBatchInferencingServer(code_configuration=rest_obj.code_configuration) + def _from_rest_object(cls, rest_obj: Any) -> "AzureMLBatchInferencingServer": + code = ( + rest_obj.get("codeConfiguration") + if isinstance(rest_obj, dict) + else getattr(rest_obj, "code_configuration", None) + ) + return AzureMLBatchInferencingServer(code_configuration=code) - def _to_rest_object(self) -> RestAzureMLBatchInferencingServer: - return RestAzureMLBatchInferencingServer(server_type=self.type, code_configuration=self.code_configuration) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"serverType": "AzureMLBatch"} + code = _code_configuration_to_wire(self.code_configuration) + if code is not None: + rest["codeConfiguration"] = code + return rest @experimental @@ -79,13 +109,22 @@ def __init__(self, *, inference_configuration: Optional[CodeConfiguration] = Non self.inference_configuration = inference_configuration @classmethod - def _from_rest_object(cls, rest_obj: RestTritonInferencingServer) -> "RestTritonInferencingServer": - return CustomInferencingServer( - type=rest_obj.server_type, inference_configuration=rest_obj.inference_configuration + def _from_rest_object(cls, rest_obj: Any) -> "CustomInferencingServer": + ic = ( + rest_obj.get("inferenceConfiguration") + if isinstance(rest_obj, dict) + else getattr(rest_obj, "inference_configuration", None) ) + return CustomInferencingServer(inference_configuration=ic) - def _to_rest_object(self) -> RestTritonInferencingServer: - return RestCustomInferencingServer(server_type=self.type, inference_configuration=self.inference_configuration) + def _to_rest_object(self) -> Dict[str, Any]: + # NOTE: preserves the legacy wire shape exactly — the original built a ``CustomInferencingServer`` + # (server discriminator "Custom") from a Triton entity, so this path emits ``serverType: Custom``. + rest: Dict[str, Any] = {"serverType": "Custom"} + if self.inference_configuration is not None: + ic = self.inference_configuration + rest["inferenceConfiguration"] = ic._to_rest_object() if hasattr(ic, "_to_rest_object") else ic + return rest @experimental @@ -103,11 +142,18 @@ def __init__(self, *, port: Optional[str] = None, path: Optional[str] = None): self.path = path @classmethod - def _from_rest_object(cls, rest_obj: RestRoute) -> "RestRoute": + def _from_rest_object(cls, rest_obj: Any) -> "Route": + if isinstance(rest_obj, dict): + return Route(port=rest_obj.get("port"), path=rest_obj.get("path")) return Route(port=rest_obj.port, path=rest_obj.path) - def _to_rest_object(self) -> Optional[RestRoute]: - return RestRoute(port=self.port, path=self.path) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {} + if self.port is not None: + rest["port"] = int(self.port) + if self.path is not None: + rest["path"] = self.path + return rest @experimental @@ -141,53 +187,31 @@ def __init__( self.configuration = configuration @classmethod - def _from_rest_object(cls, rest_obj: RestOnlineInferenceConfiguration) -> "RestOnlineInferenceConfiguration": + def _from_rest_object(cls, rest_obj: Any) -> "OnlineInferenceConfiguration": + def _get(obj: Any, key: str, attr: str) -> Any: + return obj.get(key) if isinstance(obj, dict) else getattr(obj, attr, None) + return OnlineInferenceConfiguration( - liveness_route=Route._from_rest_object(rest_obj.liveness_route), - readiness_route=Route._from_rest_object(rest_obj.readiness_route), - scoring_route=Route._from_rest_object(rest_obj.scoring_route), - entry_script=rest_obj.entry_script, - configuration=rest_obj.configuration, + liveness_route=Route._from_rest_object(_get(rest_obj, "livenessRoute", "liveness_route")), + readiness_route=Route._from_rest_object(_get(rest_obj, "readinessRoute", "readiness_route")), + scoring_route=Route._from_rest_object(_get(rest_obj, "scoringRoute", "scoring_route")), + entry_script=_get(rest_obj, "entryScript", "entry_script"), + configuration=_get(rest_obj, "configuration", "configuration"), ) - def _to_rest_object(self) -> RestOnlineInferenceConfiguration: - if self.liveness_route is not None and self.readiness_route is not None and self.scoring_route is not None: - return RestOnlineInferenceConfiguration( - liveness_route=self.liveness_route._to_rest_object(), - readiness_route=self.readiness_route._to_rest_object(), - scoring_route=self.scoring_route._to_rest_object(), - entry_script=self.entry_script, - configuration=self.configuration, - ) - - if self.liveness_route is None: - return RestOnlineInferenceConfiguration( - readiness_route=self.readiness_route._to_rest_object() if self.readiness_route is not None else None, - scoring_route=self.scoring_route._to_rest_object() if self.scoring_route is not None else None, - entry_script=self.entry_script, - configuration=self.configuration, - ) - - if self.readiness_route is None: - return RestOnlineInferenceConfiguration( - liveness_route=self.liveness_route._to_rest_object(), - scoring_route=self.scoring_route._to_rest_object() if self.scoring_route is not None else None, - entry_script=self.entry_script, - configuration=self.configuration, - ) - - if self.scoring_route is None: - return RestOnlineInferenceConfiguration( - liveness_route=self.liveness_route._to_rest_object(), - readiness_route=self.readiness_route._to_rest_object(), - entry_script=self.entry_script, - configuration=self.configuration, - ) - - return RestOnlineInferenceConfiguration( - entry_script=self.entry_script, - configuration=self.configuration, - ) + def _to_rest_object(self) -> Dict[str, Any]: + # NOTE: ``configuration`` is intentionally omitted — the legacy msrest + # ``OnlineInferenceConfiguration`` model had no such field and dropped it on the wire. + rest: Dict[str, Any] = {} + if self.liveness_route is not None: + rest["livenessRoute"] = self.liveness_route._to_rest_object() + if self.readiness_route is not None: + rest["readinessRoute"] = self.readiness_route._to_rest_object() + if self.scoring_route is not None: + rest["scoringRoute"] = self.scoring_route._to_rest_object() + if self.entry_script is not None: + rest["entryScript"] = self.entry_script + return rest @experimental @@ -204,10 +228,16 @@ def __init__(self, *, inference_configuration: Optional[OnlineInferenceConfigura self.inference_configuration = inference_configuration @classmethod - def _from_rest_object(cls, rest_obj: RestCustomInferencingServer) -> "RestCustomInferencingServer": - return CustomInferencingServer( - type=rest_obj.server_type, inference_configuration=rest_obj.inference_configuration + def _from_rest_object(cls, rest_obj: Any) -> "CustomInferencingServer": + ic = ( + rest_obj.get("inferenceConfiguration") + if isinstance(rest_obj, dict) + else getattr(rest_obj, "inference_configuration", None) ) + return CustomInferencingServer(inference_configuration=ic) - def _to_rest_object(self) -> RestCustomInferencingServer: - return RestCustomInferencingServer(server_type=self.type, inference_configuration=self.inference_configuration) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"serverType": "Custom"} + if self.inference_configuration is not None: + rest["inferenceConfiguration"] = self.inference_configuration._to_rest_object() + return rest diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py index c4797c20bec0..580438a8ecc9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py @@ -9,12 +9,6 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2023_08_01_preview.models import CodeConfiguration -from azure.ai.ml._restclient.v2023_08_01_preview.models import ModelPackageInput as RestModelPackageInput -from azure.ai.ml._restclient.v2023_08_01_preview.models import PackageInputPathId as RestPackageInputPathId -from azure.ai.ml._restclient.v2023_08_01_preview.models import PackageInputPathUrl as RestPackageInputPathUrl -from azure.ai.ml._restclient.v2023_08_01_preview.models import PackageInputPathVersion as RestPackageInputPathVersion -from azure.ai.ml._restclient.v2023_08_01_preview.models import PackageRequest, PackageResponse from azure.ai.ml._schema.assets.package.model_package import ModelPackageSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils.utils import dump_yaml_to_file, snake_to_pascal @@ -27,6 +21,26 @@ from .model_configuration import ModelConfiguration +def _package_input_path_from_rest(path: Any) -> Any: + """Reconstruct a package input path entity from its wire representation (dict or msrest model). + + :param path: The wire representation of the input path. + :type path: Any + :return: The reconstructed input path entity, or None. + :rtype: Any + """ + if path is None: + return None + input_path_type = path.get("inputPathType") if isinstance(path, dict) else getattr(path, "input_path_type", None) + if input_path_type == "PathId": + return PackageInputPathId._from_rest_object(path) + if input_path_type == "PathVersion": + return PackageInputPathVersion._from_rest_object(path) + if input_path_type == "Url": + return PackageInputPathUrl._from_rest_object(path) + return None + + @experimental class PackageInputPathId: """Package input path specified with a resource ID. @@ -47,17 +61,20 @@ def __init__( self.input_path_type = input_path_type self.resource_id = resource_id - def _to_rest_object(self) -> RestPackageInputPathId: - return RestPackageInputPathId( - input_path_type=self.input_path_type, - resource_id=self.resource_id, - ) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"inputPathType": "PathId"} + if self.resource_id is not None: + rest["resourceId"] = self.resource_id + return rest @classmethod - def _from_rest_object(cls, package_input_path_id_rest_object: RestPackageInputPathId) -> "PackageInputPathId": + def _from_rest_object(cls, package_input_path_id_rest_object: Any) -> "PackageInputPathId": + obj = package_input_path_id_rest_object + if isinstance(obj, dict): + return PackageInputPathId(input_path_type=obj.get("inputPathType"), resource_id=obj.get("resourceId")) return PackageInputPathId( - input_path_type=package_input_path_id_rest_object.input_path_type, - resource_id=package_input_path_id_rest_object.resource_id, + input_path_type=obj.input_path_type, + resource_id=obj.resource_id, ) @@ -84,21 +101,27 @@ def __init__( self.resource_name = resource_name self.resource_version = resource_version - def _to_rest_object(self) -> RestPackageInputPathVersion: - return RestPackageInputPathVersion( - input_path_type=self.input_path_type, - resource_name=self.resource_name, - resource_version=self.resource_version, - ) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"inputPathType": "PathVersion"} + if self.resource_name is not None: + rest["resourceName"] = self.resource_name + if self.resource_version is not None: + rest["resourceVersion"] = self.resource_version + return rest @classmethod - def _from_rest_object( - cls, package_input_path_version_rest_object: RestPackageInputPathVersion - ) -> "PackageInputPathVersion": + def _from_rest_object(cls, package_input_path_version_rest_object: Any) -> "PackageInputPathVersion": + obj = package_input_path_version_rest_object + if isinstance(obj, dict): + return PackageInputPathVersion( + input_path_type=obj.get("inputPathType"), + resource_name=obj.get("resourceName"), + resource_version=obj.get("resourceVersion"), + ) return PackageInputPathVersion( - input_path_type=package_input_path_version_rest_object.input_path_type, - resource_name=package_input_path_version_rest_object.resource_name, - resource_version=package_input_path_version_rest_object.resource_version, + input_path_type=obj.input_path_type, + resource_name=obj.resource_name, + resource_version=obj.resource_version, ) @@ -117,17 +140,20 @@ def __init__(self, *, input_path_type: Optional[str] = None, url: Optional[str] self.input_path_type = input_path_type self.url = url - def _to_rest_object(self) -> RestPackageInputPathUrl: - return RestPackageInputPathUrl( - input_path_type=self.input_path_type, - url=self.url, - ) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {"inputPathType": "Url"} + if self.url is not None: + rest["url"] = self.url + return rest @classmethod - def _from_rest_object(cls, package_input_path_url_rest_object: RestPackageInputPathUrl) -> "PackageInputPathUrl": + def _from_rest_object(cls, package_input_path_url_rest_object: Any) -> "PackageInputPathUrl": + obj = package_input_path_url_rest_object + if isinstance(obj, dict): + return PackageInputPathUrl(input_path_type=obj.get("inputPathType"), url=obj.get("url")) return PackageInputPathUrl( - input_path_type=package_input_path_url_rest_object.input_path_type, - url=package_input_path_url_rest_object.url, + input_path_type=obj.input_path_type, + url=obj.url, ) @@ -168,33 +194,40 @@ def __init__( self.mode = mode self.mount_path = mount_path - def _to_rest_object(self) -> RestModelPackageInput: - if self.path is None: - return RestModelPackageInput( - input_type=snake_to_pascal(self.type), - path=None, - mode=snake_to_pascal(self.mode), - mount_path=self.mount_path, - ) - return RestModelPackageInput( - input_type=snake_to_pascal(self.type), - path=self.path._to_rest_object(), - mode=snake_to_pascal(self.mode), - mount_path=self.mount_path, - ) + def _to_rest_object(self) -> Dict[str, Any]: + rest: Dict[str, Any] = {} + input_type = snake_to_pascal(self.type) + if input_type is not None: + rest["inputType"] = input_type + if self.path is not None: + rest["path"] = self.path._to_rest_object() + mode = snake_to_pascal(self.mode) + if mode is not None: + rest["mode"] = mode + if self.mount_path is not None: + rest["mountPath"] = self.mount_path + return rest @classmethod - def _from_rest_object(cls, model_package_input_rest_object: RestModelPackageInput) -> "ModelPackageInput": + def _from_rest_object(cls, model_package_input_rest_object: Any) -> "ModelPackageInput": + obj = model_package_input_rest_object + if isinstance(obj, dict): + return ModelPackageInput( + type=obj.get("inputType"), + path=_package_input_path_from_rest(obj.get("path")), + mode=obj.get("mode"), + mount_path=obj.get("mountPath"), + ) return ModelPackageInput( - type=model_package_input_rest_object.input_type, - path=model_package_input_rest_object.path._from_rest_object(), - mode=model_package_input_rest_object.mode, - mount_path=model_package_input_rest_object.mount_path, + type=obj.input_type, + path=obj.path._from_rest_object(), + mode=obj.mode, + mount_path=obj.mount_path, ) @experimental -class ModelPackage(Resource, PackageRequest): +class ModelPackage(Resource): """Model package. :param target_environment_name: The target environment name for the model package. @@ -251,14 +284,15 @@ def __init__( super().__init__( name=target_environment, - target_environment_id=target_environment, - base_environment_source=base_environment_source, - inferencing_server=inferencing_server, - model_configuration=model_configuration, - inputs=inputs, tags=tags, - environment_variables=environment_variables, + **kwargs, ) + self.target_environment_id = target_environment + self.base_environment_source = base_environment_source + self.inferencing_server = inferencing_server + self.model_configuration = model_configuration + self.inputs = inputs + self.environment_variables = environment_variables self.environment_version = env_version @classmethod @@ -299,11 +333,12 @@ def _to_dict(self) -> Dict: return dict(ModelPackageSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) @classmethod - def _from_rest_object(cls, model_package_rest_object: PackageResponse) -> Any: - target_environment_id = model_package_rest_object.target_environment_id - return target_environment_id + def _from_rest_object(cls, model_package_rest_object: Any) -> Any: + if isinstance(model_package_rest_object, dict): + return model_package_rest_object.get("targetEnvironmentId") + return model_package_rest_object.target_environment_id - def _to_rest_object(self) -> PackageRequest: + def _to_rest_object(self) -> Dict[str, Any]: code = None if ( @@ -317,22 +352,25 @@ def _to_rest_object(self) -> PackageRequest: if isinstance(self.inferencing_server.code_configuration.code, str) else self.inferencing_server.code_configuration.code.id ) - code = CodeConfiguration( - code_id=code_id, - scoring_script=self.inferencing_server.code_configuration.scoring_script, - ) + code = {"codeId": code_id} + if self.inferencing_server.code_configuration.scoring_script is not None: + code["scoringScript"] = self.inferencing_server.code_configuration.scoring_script self.inferencing_server.code_configuration = code - package_request = PackageRequest( - target_environment_id=self.target_environment_id, - base_environment_source=( - self.base_environment_source._to_rest_object() if self.base_environment_source else None - ), - inferencing_server=self.inferencing_server._to_rest_object() if self.inferencing_server else None, - model_configuration=self.model_configuration._to_rest_object() if self.model_configuration else None, - inputs=[input._to_rest_object() for input in self.inputs] if self.inputs else None, - tags=self.tags, - environment_variables=self.environment_variables, - ) + package_request: Dict[str, Any] = {} + if self.target_environment_id is not None: + package_request["targetEnvironmentId"] = self.target_environment_id + if self.base_environment_source is not None: + package_request["baseEnvironmentSource"] = self.base_environment_source._to_rest_object() + if self.inferencing_server is not None: + package_request["inferencingServer"] = self.inferencing_server._to_rest_object() + if self.model_configuration is not None: + package_request["modelConfiguration"] = self.model_configuration._to_rest_object() + if self.inputs: + package_request["inputs"] = [model_input._to_rest_object() for model_input in self.inputs] + if self.tags is not None: + package_request["tags"] = self.tags + if self.environment_variables is not None: + package_request["environmentVariables"] = self.environment_variables return package_request diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py index 89fba06546a8..48ba319fd2d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py @@ -190,7 +190,7 @@ def __init__( ) self.expression = expression - def _to_rest_object(self) -> RestCronTrigger: # v2023_04_01_preview.models.CronTrigger + def _to_rest_object(self) -> RestCronTrigger: # arm_ml_service.models.CronTrigger return RestCronTrigger( trigger_type=self.type, expression=self.expression, @@ -199,7 +199,7 @@ def _to_rest_object(self) -> RestCronTrigger: # v2023_04_01_preview.models.Cron time_zone=self.time_zone, ) - def _to_rest_compute_cron_object(self) -> RestCronTrigger: # v2023_04_01_preview.models.CronTrigger + def _to_rest_compute_cron_object(self) -> RestCronTrigger: # arm_ml_service.models.CronTrigger # This function is added because we can't make compute trigger to use same class # with schedule from service side. if self.end_time: @@ -271,7 +271,7 @@ def __init__( self.frequency = frequency self.interval = interval - def _to_rest_object(self) -> RestRecurrenceTrigger: # v2023_04_01_preview.models.RecurrenceTrigger + def _to_rest_object(self) -> RestRecurrenceTrigger: # arm_ml_service.models.RecurrenceTrigger return RestRecurrenceTrigger( frequency=snake_to_camel(self.frequency), interval=self.interval, @@ -282,7 +282,7 @@ def _to_rest_object(self) -> RestRecurrenceTrigger: # v2023_04_01_preview.model ) def _to_rest_compute_recurrence_object(self) -> RestRecurrenceTrigger: - # v2023_04_01_preview.models.RecurrenceTrigger + # arm_ml_service.models.RecurrenceTrigger # This function is added because we can't make compute trigger to use same class # with schedule from service side. if self.end_time: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py index 6fd9cb1eca0f..83c6e77a98ca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py @@ -7,7 +7,7 @@ from typing import Any, Dict, Iterable, Optional, cast from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042024PreviewArm -from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient022023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022023Preview from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._experimental import experimental diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 735aadd7e62d..7d6a0fc566b3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -7,7 +7,7 @@ from os import PathLike from typing import Any, Dict, Iterable, Optional, Union, cast -from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion from azure.ai.ml._scope_dependent_operations import ( @@ -43,9 +43,8 @@ class EvaluatorOperations(_ScopeDependentOperations): :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient082023Preview). - :type service_client: typing.Union[ - azure.ai.ml._restclient.v2023_08_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, - azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient] + :type service_client: + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param datastore_operations: Represents a client for performing operations on Datastores. :type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations :param all_operations: All operations classes of an MLClient object. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py index 545a413608f3..03ddbb1c0a06 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py @@ -15,7 +15,7 @@ from azure.ai.ml._artifacts._artifact_utilities import _check_and_upload_path from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient102023 from azure.ai.ml._restclient.arm_ml_service.models import ( FeaturesetVersion, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index e9666d461c30..d8708c89262e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -23,11 +23,11 @@ ) from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.model_dataplane import ModelDataplaneClient as ServiceClientModelDataPlane -from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient082023Preview from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._restclient.arm_ml_service.models import ModelContainer as ArmModelContainer from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion as ArmModelVersion -from azure.ai.ml._restclient.v2023_08_01_preview.models import ModelVersion +from azure.ai.ml._restclient.arm_ml_service.models import ModelVersion from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -48,6 +48,7 @@ begin_create_or_update_registry_versioned_asset, begin_import_registry_asset, begin_package_registry_model, + begin_package_workspace_model, get_asset_body_for_registry_storage, get_registry_client, get_registry_container_asset, @@ -92,10 +93,9 @@ class ModelOperations(_ScopeDependentOperations): :param operation_config: Common configuration for operations classes of an MLClient object. :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace - resources (ServiceClient082023Preview). - :type service_client: typing.Union[ - azure.ai.ml._restclient.v2023_08_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, - azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient] + resources. + :type service_client: + ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param datastore_operations: Represents a client for performing operations on Datastores. :type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations :param all_operations: All operations classes of an MLClient object. @@ -843,26 +843,31 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar package_request = package_request._to_rest_object() if self._registry_reference: - package_request.target_environment_id = f"azureml://locations/{self._operation_scope._workspace_location}/workspaces/{self._operation_scope._workspace_id}/environments/{package_request.target_environment_id}" + package_request["targetEnvironmentId"] = ( + f"azureml://locations/{self._operation_scope._workspace_location}" + f"/workspaces/{self._operation_scope._workspace_id}/environments/" + f"{package_request.get('targetEnvironmentId')}" + ) if self._registry_name or self._registry_reference: # Byte-identical to the legacy v2021_10 registry ``begin_package`` (same MFE endpoint + api-version + wire body). - package_body = package_request.serialize() if hasattr(package_request, "serialize") else package_request package_out = begin_package_registry_model( self._registry_service_client, name, version, self._resource_group_name, self._registry_name if self._registry_name else self._registry_reference, - package_body, + package_request, ) else: - package_out = self._model_versions_operation.begin_package( - name=name, - version=version, - workspace_name=self._workspace_name, - body=package_request, - **self._scope_kwargs, - ).result() + # arm model_versions has no begin_package; issue the byte-identical workspace LRO via send_request. + package_out = begin_package_workspace_model( + self._service_client, + name, + version, + self._resource_group_name, + self._workspace_name, + package_request, + ) if is_deployment_flow: # No need to go through the schema, as this is for deployment notification only return package_out if isinstance(package_out, dict): @@ -884,7 +889,9 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar environment_version = parsed_id.asset_version module_logger.info("\nPackage Created") - if package_out is not None and package_out.__class__.__name__ == "PackageResponse": + if package_out is not None and ( + isinstance(package_out, dict) or package_out.__class__.__name__ == "PackageResponse" + ): if self._registry_name: current_rg = self._scope_kwargs.pop("resource_group_name", None) self._scope_kwargs["resource_group_name"] = self._workspace_rg diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 01e31627764e..a1f18300fe0d 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -277,7 +277,7 @@ def mock_aml_services_2023_02_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2023_04_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2023_04_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture @@ -287,7 +287,7 @@ def mock_aml_services_2023_06_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2023_08_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2023_08_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture From 2db98ed1d6afb5b6f82afb6a34d613cf800edbb2 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 20:23:29 +0530 Subject: [PATCH 096/146] Migrate tests off v2023_04/v2023_08 and delete both client folders (all 6 versioned clients retired) --- sdk/ml/azure-ai-ml/_tmp_inspect.py | 4 + .../v2023_04_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 268 - .../v2023_04_01_preview/_configuration.py | 76 - .../_restclient/v2023_04_01_preview/_patch.py | 31 - .../v2023_04_01_preview/_vendor.py | 27 - .../v2023_04_01_preview/_version.py | 9 - .../v2023_04_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 265 - .../v2023_04_01_preview/aio/_configuration.py | 72 - .../v2023_04_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 103 - .../_batch_deployments_operations.py | 642 - .../operations/_batch_endpoints_operations.py | 675 - .../operations/_code_containers_operations.py | 339 - .../operations/_code_versions_operations.py | 453 - .../_component_containers_operations.py | 344 - .../_component_versions_operations.py | 376 - .../aio/operations/_compute_operations.py | 1209 - .../operations/_data_containers_operations.py | 344 - .../operations/_data_versions_operations.py | 385 - .../aio/operations/_datastores_operations.py | 438 - .../_environment_containers_operations.py | 344 - .../_environment_versions_operations.py | 371 - .../aio/operations/_features_operations.py | 236 - .../_featureset_containers_operations.py | 495 - .../_featureset_versions_operations.py | 789 - ...aturestore_entity_containers_operations.py | 495 - ...featurestore_entity_versions_operations.py | 526 - .../aio/operations/_jobs_operations.py | 619 - .../operations/_labeling_jobs_operations.py | 739 - .../_managed_network_provisions_operations.py | 180 - ...anaged_network_settings_rule_operations.py | 448 - .../_model_containers_operations.py | 349 - .../operations/_model_versions_operations.py | 556 - .../_online_deployments_operations.py | 823 - .../_online_endpoints_operations.py | 897 - .../aio/operations/_operations.py | 117 - ...private_endpoint_connections_operations.py | 325 - .../_private_link_resources_operations.py | 103 - .../aio/operations/_quotas_operations.py | 186 - .../aio/operations/_registries_operations.py | 710 - .../_registry_code_containers_operations.py | 463 - .../_registry_code_versions_operations.py | 570 - ...egistry_component_containers_operations.py | 463 - ..._registry_component_versions_operations.py | 499 - .../_registry_data_containers_operations.py | 468 - .../_registry_data_versions_operations.py | 584 - ...istry_environment_containers_operations.py | 468 - ...egistry_environment_versions_operations.py | 499 - .../_registry_model_containers_operations.py | 468 - .../_registry_model_versions_operations.py | 597 - .../aio/operations/_schedules_operations.py | 467 - .../aio/operations/_usages_operations.py | 124 - .../_virtual_machine_sizes_operations.py | 99 - .../_workspace_connections_operations.py | 333 - .../_workspace_features_operations.py | 129 - .../aio/operations/_workspaces_operations.py | 1297 - .../v2023_04_01_preview/models/__init__.py | 2031 - ...azure_machine_learning_workspaces_enums.py | 1904 - .../v2023_04_01_preview/models/_models.py | 29698 ------------- .../v2023_04_01_preview/models/_models_py3.py | 32252 -------------- .../operations/__init__.py | 103 - .../_batch_deployments_operations.py | 876 - .../operations/_batch_endpoints_operations.py | 934 - .../operations/_code_containers_operations.py | 511 - .../operations/_code_versions_operations.py | 690 - .../_component_containers_operations.py | 519 - .../_component_versions_operations.py | 568 - .../operations/_compute_operations.py | 1718 - .../operations/_data_containers_operations.py | 519 - .../operations/_data_versions_operations.py | 580 - .../operations/_datastores_operations.py | 671 - .../_environment_containers_operations.py | 519 - .../_environment_versions_operations.py | 560 - .../operations/_features_operations.py | 342 - .../_featureset_containers_operations.py | 687 - .../_featureset_versions_operations.py | 1097 - ...aturestore_entity_containers_operations.py | 687 - ...featurestore_entity_versions_operations.py | 732 - .../operations/_jobs_operations.py | 894 - .../operations/_labeling_jobs_operations.py | 1044 - .../_managed_network_provisions_operations.py | 231 - ...anaged_network_settings_rule_operations.py | 619 - .../_model_containers_operations.py | 527 - .../operations/_model_versions_operations.py | 812 - .../_online_deployments_operations.py | 1150 - .../_online_endpoints_operations.py | 1257 - .../operations/_operations.py | 154 - ...private_endpoint_connections_operations.py | 494 - .../_private_link_resources_operations.py | 150 - .../operations/_quotas_operations.py | 269 - .../operations/_registries_operations.py | 988 - .../_registry_code_containers_operations.py | 636 - .../_registry_code_versions_operations.py | 802 - ...egistry_component_containers_operations.py | 637 - ..._registry_component_versions_operations.py | 690 - .../_registry_data_containers_operations.py | 644 - .../_registry_data_versions_operations.py | 823 - ...istry_environment_containers_operations.py | 645 - ...egistry_environment_versions_operations.py | 690 - .../_registry_model_containers_operations.py | 645 - .../_registry_model_versions_operations.py | 844 - .../operations/_schedules_operations.py | 643 - .../operations/_usages_operations.py | 169 - .../_virtual_machine_sizes_operations.py | 144 - .../_workspace_connections_operations.py | 508 - .../_workspace_features_operations.py | 176 - .../operations/_workspaces_operations.py | 1857 - .../_restclient/v2023_04_01_preview/py.typed | 1 - .../v2023_08_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 288 - .../v2023_08_01_preview/_configuration.py | 76 - .../_restclient/v2023_08_01_preview/_patch.py | 31 - .../v2023_08_01_preview/_vendor.py | 27 - .../v2023_08_01_preview/_version.py | 9 - .../v2023_08_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 285 - .../v2023_08_01_preview/aio/_configuration.py | 72 - .../v2023_08_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 113 - .../_batch_deployments_operations.py | 642 - .../operations/_batch_endpoints_operations.py | 675 - ..._capacity_reservation_groups_operations.py | 460 - .../operations/_code_containers_operations.py | 339 - .../operations/_code_versions_operations.py | 453 - .../_component_containers_operations.py | 344 - .../_component_versions_operations.py | 376 - .../aio/operations/_compute_operations.py | 1397 - .../operations/_data_containers_operations.py | 344 - .../operations/_data_versions_operations.py | 385 - .../aio/operations/_datastores_operations.py | 438 - .../_environment_containers_operations.py | 344 - .../_environment_versions_operations.py | 377 - .../aio/operations/_features_operations.py | 247 - .../_featureset_containers_operations.py | 495 - .../_featureset_versions_operations.py | 672 - ...aturestore_entity_containers_operations.py | 495 - ...featurestore_entity_versions_operations.py | 526 - .../_inference_endpoints_operations.py | 654 - .../_inference_groups_operations.py | 829 - .../operations/_inference_pools_operations.py | 794 - .../aio/operations/_jobs_operations.py | 625 - .../operations/_labeling_jobs_operations.py | 746 - .../_managed_network_provisions_operations.py | 183 - ...anaged_network_settings_rule_operations.py | 458 - .../_model_containers_operations.py | 349 - .../operations/_model_versions_operations.py | 556 - .../_online_deployments_operations.py | 823 - .../_online_endpoints_operations.py | 897 - .../aio/operations/_operations.py | 118 - ...private_endpoint_connections_operations.py | 332 - .../_private_link_resources_operations.py | 143 - .../aio/operations/_quotas_operations.py | 186 - .../aio/operations/_registries_operations.py | 710 - .../_registry_code_containers_operations.py | 463 - .../_registry_code_versions_operations.py | 570 - ...egistry_component_containers_operations.py | 463 - ..._registry_component_versions_operations.py | 499 - .../_registry_data_containers_operations.py | 468 - .../_registry_data_versions_operations.py | 584 - ...istry_environment_containers_operations.py | 468 - ...egistry_environment_versions_operations.py | 505 - .../_registry_model_containers_operations.py | 468 - .../_registry_model_versions_operations.py | 743 - .../aio/operations/_schedules_operations.py | 467 - .../_serverless_endpoints_operations.py | 875 - .../aio/operations/_usages_operations.py | 124 - .../_virtual_machine_sizes_operations.py | 99 - .../_workspace_connections_operations.py | 626 - .../_workspace_features_operations.py | 129 - .../aio/operations/_workspaces_operations.py | 1347 - .../v2023_08_01_preview/models/__init__.py | 2211 - ...azure_machine_learning_workspaces_enums.py | 2034 - .../v2023_08_01_preview/models/_models.py | 32464 -------------- .../v2023_08_01_preview/models/_models_py3.py | 35255 ---------------- .../operations/__init__.py | 113 - .../_batch_deployments_operations.py | 876 - .../operations/_batch_endpoints_operations.py | 934 - ..._capacity_reservation_groups_operations.py | 702 - .../operations/_code_containers_operations.py | 511 - .../operations/_code_versions_operations.py | 690 - .../_component_containers_operations.py | 519 - .../_component_versions_operations.py | 568 - .../operations/_compute_operations.py | 1990 - .../operations/_data_containers_operations.py | 519 - .../operations/_data_versions_operations.py | 580 - .../operations/_datastores_operations.py | 671 - .../_environment_containers_operations.py | 519 - .../_environment_versions_operations.py | 569 - .../operations/_features_operations.py | 359 - .../_featureset_containers_operations.py | 687 - .../_featureset_versions_operations.py | 924 - ...aturestore_entity_containers_operations.py | 687 - ...featurestore_entity_versions_operations.py | 732 - .../_inference_endpoints_operations.py | 894 - .../_inference_groups_operations.py | 1159 - .../operations/_inference_pools_operations.py | 1108 - .../operations/_jobs_operations.py | 903 - .../operations/_labeling_jobs_operations.py | 1045 - .../_managed_network_provisions_operations.py | 234 - ...anaged_network_settings_rule_operations.py | 629 - .../_model_containers_operations.py | 527 - .../operations/_model_versions_operations.py | 812 - .../_online_deployments_operations.py | 1150 - .../_online_endpoints_operations.py | 1257 - .../operations/_operations.py | 155 - ...private_endpoint_connections_operations.py | 501 - .../_private_link_resources_operations.py | 190 - .../operations/_quotas_operations.py | 269 - .../operations/_registries_operations.py | 988 - .../_registry_code_containers_operations.py | 636 - .../_registry_code_versions_operations.py | 802 - ...egistry_component_containers_operations.py | 637 - ..._registry_component_versions_operations.py | 690 - .../_registry_data_containers_operations.py | 644 - .../_registry_data_versions_operations.py | 823 - ...istry_environment_containers_operations.py | 645 - ...egistry_environment_versions_operations.py | 699 - .../_registry_model_containers_operations.py | 645 - .../_registry_model_versions_operations.py | 1036 - .../operations/_schedules_operations.py | 643 - .../_serverless_endpoints_operations.py | 1217 - .../operations/_usages_operations.py | 169 - .../_virtual_machine_sizes_operations.py | 144 - .../_workspace_connections_operations.py | 934 - .../_workspace_features_operations.py | 176 - .../operations/_workspaces_operations.py | 1907 - .../_restclient/v2023_08_01_preview/py.typed | 1 - .../ml/entities/_assets/_artifacts/model.py | 12 +- sdk/ml/azure-ai-ml/samples/ml_samples_misc.py | 2 +- .../unittests/test_deployment_entity.py | 2 +- ...test_pipeline_component_bach_deployment.py | 2 +- .../command_job/e2etests/test_command_job.py | 2 +- .../unittests/test_command_job_entity.py | 6 +- .../unittests/test_command_job_schema.py | 4 +- .../compute/unittests/test_compute_entity.py | 6 +- .../unittests/test_datastore_schema.py | 2 +- ...test_datastore_serialization_regression.py | 2 +- .../environment/unittests/test_env_entity.py | 4 +- .../test_list_materialization_job_request.py | 32 - .../test_feature_store_operations.py | 4 +- .../unittests/test_job_operations.py | 12 +- .../model/unittests/test_model_schema.py | 6 +- .../unittests/test_pipeline_job_entity.py | 2 +- .../unittests/test_pipeline_job_schema.py | 10 +- .../unittests/test_spark_job_entity.py | 6 +- .../unittests/test_spark_job_schema.py | 2 +- .../sweep_job/unittests/test_sweep_job.py | 63 +- .../unittests/test_sweep_job_schema.py | 162 +- 250 files changed, 100 insertions(+), 257202 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/_tmp_inspect.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/py.typed delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_capacity_reservation_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_capacity_reservation_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_labeling_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/py.typed delete mode 100644 sdk/ml/azure-ai-ml/tests/feature_set/unittests/test_list_materialization_job_request.py diff --git a/sdk/ml/azure-ai-ml/_tmp_inspect.py b/sdk/ml/azure-ai-ml/_tmp_inspect.py new file mode 100644 index 000000000000..ff2b9067adfa --- /dev/null +++ b/sdk/ml/azure-ai-ml/_tmp_inspect.py @@ -0,0 +1,4 @@ +import inspect +import azure.ai.ml._restclient.v2023_08_01_preview.operations as o + +print(inspect.getsource(o.ModelVersionsOperations._package_initial)) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 962ddf1bb8e1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,268 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -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, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -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 - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.operations.RegistryDataVersionsOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.operations.SchedulesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py deleted file mode 100644 index a079a3deb43e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 2ac25137133e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,265 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -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 .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -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 - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.aio.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataVersionsOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.aio.operations.SchedulesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py deleted file mode 100644 index ee4be37e13e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py deleted file mode 100644 index da26b6af19e9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 12cdb7e2d1ba..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,642 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeployment": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index d2bc553369e4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpoint": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index 7d3322d7dac0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index f033248949c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,453 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 8f5bb449a38b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index b1e49bfdca00..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,376 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - stage: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index e614e85228c6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1209 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List["_models.CustomService"], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.IdleShutdownSetting", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 59990c0ebc3d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index f8f3819f2163..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,385 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - stage: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param stage: data stage. - :type stage: str - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - stage=stage, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - stage=stage, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 9bbaea57a9bb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Datastore": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Datastore", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.Datastore": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index c244e3087b21..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 40f5206cd973..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,371 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index 9bd96985a399..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,236 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesOperations: - """FeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureResourceArmPaginatedResult"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> "_models.Feature": - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index b5853edefbce..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetContainersOperations: - """FeaturesetContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturesetContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index 6c4eaa695d98..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,789 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_materialization_jobs_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetVersionsOperations: - """FeaturesetVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturesetVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> Optional["_models.FeaturesetJob"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetJob', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetJob"]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - @distributed_trace - def list_materialization_jobs( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - skip: Optional[str] = None, - filters: Optional[str] = None, - feature_window_start: Optional[str] = None, - feature_window_end: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetJobArmPaginatedResult"]: - """List materialization Jobs. - - List materialization Jobs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param skip: Continuation token for pagination. - :type skip: str - :param filters: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type filters: str - :param feature_window_start: Start time of the feature window to filter materialization jobs. - :type feature_window_start: str - :param feature_window_end: End time of the feature window to filter materialization jobs. - :type feature_window_end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetJobArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_materialization_jobs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_materialization_jobs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 21826e66f900..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityContainersOperations: - """FeaturestoreEntityContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityContainer or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index f5d397448969..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityVersionsOperations: - """FeaturestoreEntityVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 0d202f357c9e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,619 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - asset_name: Optional[str] = None, - scheduled: Optional[bool] = None, - schedule_id: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBase": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.PartialJobBasePartialResource", - **kwargs: Any - ) -> "_models.JobBase": - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBase", - **kwargs: Any - ) -> "_models.JobBase": - """Creates and executes a Job. - - Creates and executes a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index c3edd50216be..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,739 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - include_job_instructions: Optional[bool] = False, - include_label_categories: Optional[bool] = False, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index f24fcceff300..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,180 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkProvisionsOperations: - """ManagedNetworkProvisionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - parameters: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: Managed Network Provisioning Options for a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 7066bd7516aa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,448 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkSettingsRuleOperations: - """ManagedNetworkSettingsRuleOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.OutboundRuleListResult"]: - """Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.OutboundRuleBasicResource": - """Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - parameters: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - parameters: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param parameters: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OutboundRuleBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 193f428668b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,349 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index f877bd06931c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,556 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - stage: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param stage: Model stage. - :type stage: 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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - stage=stage, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - stage=stage, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - async def _package_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index a6cd6641de74..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeployment": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index 4847cf6bce68..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,897 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpoint": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py deleted file mode 100644 index b48461bf5c2f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.AmlOperationListResult"]: - """Lists all of the available Azure Machine Learning Services REST API operations. - - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 3730a0d1b924..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,325 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """List all the private endpoint connections associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Gets the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - properties: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Update the state of specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. - :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(properties, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Deletes the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - 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/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 52fe9efbc64a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.PrivateLinkResourceListResult": - """Gets the private link resources that need to be created for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index cb70f3fadf49..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,186 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index c3a59cd6dadd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistriesOperations: - """RegistriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.Registry": - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> "_models.Registry": - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 199569921c04..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeContainersOperations: - """RegistryCodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeContainer"]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index 3c09a56ae86c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeVersionsOperations: - """RegistryCodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 5080cdec0083..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentContainersOperations: - """RegistryComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 56c7237ef6b3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentVersionsOperations: - """RegistryComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index 20a5fcf023a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataContainersOperations: - """RegistryDataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index 651b0eb178ad..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataVersionsOperations: - """RegistryDataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataVersionBase"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 6ef88a9053c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentContainersOperations: - """RegistryEnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 667cc5ae4d8d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentVersionsOperations: - """RegistryEnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 8a066465ac90..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelContainersOperations: - """RegistryModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainer"]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index 00da8f659375..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,597 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelVersionsOperations: - """RegistryModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index 5624f5ed5caa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,467 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchedulesOperations: - """SchedulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Schedule": - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> AsyncLROPoller["_models.Schedule"]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Schedule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 943840cc5c12..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index bbc43fbebca5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 851e40ff8fb1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,333 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - parameters: "_models.WorkspaceConnectionPropertiesV2BasicResource", - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """create. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param parameters: The object for creating or updating a new workspace connection. - :type parameters: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """get. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """list. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 91ec315c06f2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,129 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 8bc2340f7af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1297 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for creating or updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - skip: Optional[str] = None, - kind: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - kind=kind, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - kind=kind, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameter of diagnosing workspace health. - :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_by_subscription( - self, - skip: Optional[str] = None, - kind: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - kind=kind, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - kind=kind, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """return notebook access token and refresh token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """List storage account keys of a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """List keys of a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py deleted file mode 100644 index 9f7df901b153..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py +++ /dev/null @@ -1,2031 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AKS - from ._models_py3 import AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AcrDetails - from ._models_py3 import AksComputeSecrets - from ._models_py3 import AksComputeSecretsProperties - from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AllFeatures - from ._models_py3 import AllNodes - from ._models_py3 import AmlCompute - from ._models_py3 import AmlComputeNodeInformation - from ._models_py3 import AmlComputeNodesInformation - from ._models_py3 import AmlComputeProperties - from ._models_py3 import AmlComputeSchema - from ._models_py3 import AmlOperation - from ._models_py3 import AmlOperationDisplay - from ._models_py3 import AmlOperationListResult - from ._models_py3 import AmlToken - from ._models_py3 import AmlUserFeature - from ._models_py3 import ArmResourceId - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AssignedUser - from ._models_py3 import AutoDeleteSetting - from ._models_py3 import AutoForecastHorizon - from ._models_py3 import AutoMLJob - from ._models_py3 import AutoMLVertical - from ._models_py3 import AutoNCrossValidations - from ._models_py3 import AutoPauseProperties - from ._models_py3 import AutoScaleProperties - from ._models_py3 import AutoSeasonality - from ._models_py3 import AutoTargetLags - from ._models_py3 import AutoTargetRollingWindowSize - from ._models_py3 import AutologgerSettings - from ._models_py3 import AzMonMonitoringAlertNotificationSettings - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureDevOpsWebhook - from ._models_py3 import AzureFileDatastore - from ._models_py3 import AzureMLBatchInferencingServer - from ._models_py3 import AzureMLOnlineInferencingServer - from ._models_py3 import BanditPolicy - from ._models_py3 import BaseEnvironmentId - from ._models_py3 import BaseEnvironmentSource - from ._models_py3 import BatchDeployment - from ._models_py3 import BatchDeploymentConfiguration - from ._models_py3 import BatchDeploymentProperties - from ._models_py3 import BatchDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import BatchEndpoint - from ._models_py3 import BatchEndpointDefaults - from ._models_py3 import BatchEndpointProperties - from ._models_py3 import BatchEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import BatchPipelineComponentDeploymentConfiguration - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BlobReferenceForConsumptionDto - from ._models_py3 import BuildContext - from ._models_py3 import CategoricalDataDriftMetricThreshold - from ._models_py3 import CategoricalDataQualityMetricThreshold - from ._models_py3 import CategoricalPredictionDriftMetricThreshold - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import Classification - from ._models_py3 import ClassificationModelPerformanceMetricThreshold - from ._models_py3 import ClassificationTrainingSettings - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import CocoExportSummary - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainer - from ._models_py3 import CodeContainerProperties - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersion - from ._models_py3 import CodeVersionProperties - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import Collection - from ._models_py3 import ColumnTransformer - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentContainer - from ._models_py3 import ComponentContainerProperties - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentVersion - from ._models_py3 import ComponentVersionProperties - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import Compute - from ._models_py3 import ComputeInstance - from ._models_py3 import ComputeInstanceApplication - from ._models_py3 import ComputeInstanceAutologgerSettings - from ._models_py3 import ComputeInstanceConnectivityEndpoints - from ._models_py3 import ComputeInstanceContainer - from ._models_py3 import ComputeInstanceCreatedBy - from ._models_py3 import ComputeInstanceDataDisk - from ._models_py3 import ComputeInstanceDataMount - from ._models_py3 import ComputeInstanceEnvironmentInfo - from ._models_py3 import ComputeInstanceLastOperation - from ._models_py3 import ComputeInstanceProperties - from ._models_py3 import ComputeInstanceSchema - from ._models_py3 import ComputeInstanceSshSettings - from ._models_py3 import ComputeInstanceVersion - from ._models_py3 import ComputeResource - from ._models_py3 import ComputeResourceSchema - from ._models_py3 import ComputeRuntimeDto - from ._models_py3 import ComputeSchedules - from ._models_py3 import ComputeSecrets - from ._models_py3 import ComputeStartStopSchedule - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import ContainerResourceSettings - from ._models_py3 import CosmosDbSettings - from ._models_py3 import CreateMonitorAction - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomInferencingServer - from ._models_py3 import CustomMetricThreshold - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import CustomMonitoringSignal - from ._models_py3 import CustomNCrossValidations - from ._models_py3 import CustomSeasonality - from ._models_py3 import CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataCollector - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataDriftMetricThresholdBase - from ._models_py3 import DataDriftMonitoringSignal - from ._models_py3 import DataFactory - from ._models_py3 import DataImport - from ._models_py3 import DataImportSource - from ._models_py3 import DataLakeAnalytics - from ._models_py3 import DataLakeAnalyticsSchema - from ._models_py3 import DataLakeAnalyticsSchemaProperties - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataQualityMetricThresholdBase - from ._models_py3 import DataQualityMonitoringSignal - from ._models_py3 import DataVersionBase - from ._models_py3 import DataVersionBaseProperties - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import DatabaseSource - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksComputeSecretsProperties - from ._models_py3 import DatabricksProperties - from ._models_py3 import DatabricksSchema - from ._models_py3 import DatasetExportSummary - from ._models_py3 import Datastore - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreProperties - from ._models_py3 import DatastoreResourceArmPaginatedResult - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DefaultScaleSettings - from ._models_py3 import DeploymentLogs - from ._models_py3 import DeploymentLogsRequest - from ._models_py3 import DeploymentResourceConfiguration - from ._models_py3 import DiagnoseRequestProperties - from ._models_py3 import DiagnoseResponseResult - from ._models_py3 import DiagnoseResponseResultValue - from ._models_py3 import DiagnoseResult - from ._models_py3 import DiagnoseWorkspaceParameters - from ._models_py3 import DistributionConfiguration - from ._models_py3 import Docker - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EmailMonitoringAlertNotificationSettings - from ._models_py3 import EncryptionKeyVaultProperties - from ._models_py3 import EncryptionKeyVaultUpdateProperties - from ._models_py3 import EncryptionProperty - from ._models_py3 import EncryptionUpdateProperties - from ._models_py3 import Endpoint - from ._models_py3 import EndpointAuthKeys - from ._models_py3 import EndpointAuthToken - from ._models_py3 import EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - from ._models_py3 import EndpointScheduleAction - from ._models_py3 import EnvironmentContainer - from ._models_py3 import EnvironmentContainerProperties - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVariable - from ._models_py3 import EnvironmentVersion - from ._models_py3 import EnvironmentVersionProperties - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import EstimatedVMPrice - from ._models_py3 import EstimatedVMPrices - from ._models_py3 import ExportSummary - from ._models_py3 import ExternalFQDNResponse - from ._models_py3 import FQDNEndpoint - from ._models_py3 import FQDNEndpointDetail - from ._models_py3 import FQDNEndpoints - from ._models_py3 import FQDNEndpointsProperties - from ._models_py3 import Feature - from ._models_py3 import FeatureAttributionDriftMonitoringSignal - from ._models_py3 import FeatureAttributionMetricThreshold - from ._models_py3 import FeatureProperties - from ._models_py3 import FeatureResourceArmPaginatedResult - from ._models_py3 import FeatureStoreSettings - from ._models_py3 import FeatureSubset - from ._models_py3 import FeatureWindow - from ._models_py3 import FeaturesetContainer - from ._models_py3 import FeaturesetContainerProperties - from ._models_py3 import FeaturesetContainerResourceArmPaginatedResult - from ._models_py3 import FeaturesetJob - from ._models_py3 import FeaturesetJobArmPaginatedResult - from ._models_py3 import FeaturesetSpecification - from ._models_py3 import FeaturesetVersion - from ._models_py3 import FeaturesetVersionBackfillRequest - from ._models_py3 import FeaturesetVersionProperties - from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityContainer - from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityVersion - from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult - from ._models_py3 import FeaturizationSettings - from ._models_py3 import FileSystemSource - from ._models_py3 import FlavorData - from ._models_py3 import ForecastHorizon - from ._models_py3 import Forecasting - from ._models_py3 import ForecastingSettings - from ._models_py3 import ForecastingTrainingSettings - from ._models_py3 import FqdnOutboundRule - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import IdentityForCmk - from ._models_py3 import IdleShutdownSetting - from ._models_py3 import Image - from ._models_py3 import ImageClassification - from ._models_py3 import ImageClassificationBase - from ._models_py3 import ImageClassificationMultilabel - from ._models_py3 import ImageInstanceSegmentation - from ._models_py3 import ImageLimitSettings - from ._models_py3 import ImageMetadata - from ._models_py3 import ImageModelDistributionSettings - from ._models_py3 import ImageModelDistributionSettingsClassification - from ._models_py3 import ImageModelDistributionSettingsObjectDetection - from ._models_py3 import ImageModelSettings - from ._models_py3 import ImageModelSettingsClassification - from ._models_py3 import ImageModelSettingsObjectDetection - from ._models_py3 import ImageObjectDetection - from ._models_py3 import ImageObjectDetectionBase - from ._models_py3 import ImageSweepSettings - from ._models_py3 import ImageVertical - from ._models_py3 import ImportDataAction - from ._models_py3 import IndexColumn - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InferencingServer - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import IntellectualProperty - from ._models_py3 import JobBase - from ._models_py3 import JobBaseProperties - from ._models_py3 import JobBaseResourceArmPaginatedResult - from ._models_py3 import JobInput - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobResourceConfiguration - from ._models_py3 import JobScheduleAction - from ._models_py3 import JobService - from ._models_py3 import KerberosCredentials - from ._models_py3 import KerberosKeytabCredentials - from ._models_py3 import KerberosKeytabSecrets - from ._models_py3 import KerberosPasswordCredentials - from ._models_py3 import KerberosPasswordSecrets - from ._models_py3 import Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - from ._models_py3 import LakeHouseArtifact - from ._models_py3 import ListAmlUserFeatureResult - from ._models_py3 import ListNotebookKeysResult - from ._models_py3 import ListStorageAccountKeysResult - from ._models_py3 import ListUsagesResult - from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import ListWorkspaceQuotas - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableData - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import ManagedServiceIdentityAutoGenerated - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelConfiguration - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelPackageInput - from ._models_py3 import ModelPerformanceMetricThresholdBase - from ._models_py3 import ModelPerformanceSignalBase - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import MonitorDefinition - from ._models_py3 import MonitoringAlertNotificationSettingsBase - from ._models_py3 import MonitoringDataSegment - from ._models_py3 import MonitoringFeatureFilterBase - from ._models_py3 import MonitoringInputData - from ._models_py3 import MonitoringSignalBase - from ._models_py3 import MonitoringThreshold - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - from ._models_py3 import NlpVertical - from ._models_py3 import NlpVerticalFeaturizationSettings - from ._models_py3 import NlpVerticalLimitSettings - from ._models_py3 import NodeStateCounts - from ._models_py3 import Nodes - from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import NotebookAccessTokenResult - from ._models_py3 import NotebookPreparationError - from ._models_py3 import NotebookResourceInfo - from ._models_py3 import NotificationSetting - from ._models_py3 import NumericalDataDriftMetricThreshold - from ._models_py3 import NumericalDataQualityMetricThreshold - from ._models_py3 import NumericalPredictionDriftMetricThreshold - from ._models_py3 import Objective - from ._models_py3 import OneLakeArtifact - from ._models_py3 import OneLakeDatastore - from ._models_py3 import OnlineDeployment - from ._models_py3 import OnlineDeploymentProperties - from ._models_py3 import OnlineDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineEndpoint - from ._models_py3 import OnlineEndpointProperties - from ._models_py3 import OnlineEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineInferenceConfiguration - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OutboundRule - from ._models_py3 import OutboundRuleBasicResource - from ._models_py3 import OutboundRuleListResult - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PackageInputPathBase - from ._models_py3 import PackageInputPathId - from ._models_py3 import PackageInputPathUrl - from ._models_py3 import PackageInputPathVersion - from ._models_py3 import PackageRequest - from ._models_py3 import PackageResponse - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - from ._models_py3 import PartialJobBase - from ._models_py3 import PartialJobBasePartialResource - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialManagedServiceIdentityAutoGenerated - from ._models_py3 import PartialMinimalTrackedResource - from ._models_py3 import PartialMinimalTrackedResourceWithIdentity - from ._models_py3 import PartialMinimalTrackedResourceWithSku - from ._models_py3 import PartialNotificationSetting - from ._models_py3 import PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PendingUploadCredentialDto - from ._models_py3 import PendingUploadRequestDto - from ._models_py3 import PendingUploadResponseDto - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - from ._models_py3 import PredictionDriftMetricThresholdBase - from ._models_py3 import PredictionDriftMonitoringSignal - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointAutoGenerated - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionAutoGenerated - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateEndpointDestination - from ._models_py3 import PrivateEndpointOutboundRule - from ._models_py3 import PrivateEndpointResource - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import PrivateLinkServiceConnectionStateAutoGenerated - from ._models_py3 import ProbeSettings - from ._models_py3 import ProgressMetrics - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import Ray - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionModelPerformanceMetricThreshold - from ._models_py3 import RegressionTrainingSettings - from ._models_py3 import RequestLogging - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import ResourceId - from ._models_py3 import ResourceName - from ._models_py3 import ResourceQuota - from ._models_py3 import Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - from ._models_py3 import SASCredentialDto - from ._models_py3 import SamplingAlgorithm - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ScaleSettings - from ._models_py3 import ScaleSettingsInformation - from ._models_py3 import Schedule - from ._models_py3 import ScheduleActionBase - from ._models_py3 import ScheduleBase - from ._models_py3 import ScheduleProperties - from ._models_py3 import ScheduleResourceArmPaginatedResult - from ._models_py3 import ScriptReference - from ._models_py3 import ScriptsToExecute - from ._models_py3 import Seasonality - from ._models_py3 import SecretConfiguration - from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import ServiceTagDestination - from ._models_py3 import ServiceTagOutboundRule - from ._models_py3 import SetupScripts - from ._models_py3 import SharedPrivateLinkResource - from ._models_py3 import Sku - from ._models_py3 import SkuCapacity - from ._models_py3 import SkuResource - from ._models_py3 import SkuResourceArmPaginatedResult - from ._models_py3 import SkuSetting - from ._models_py3 import SparkJob - from ._models_py3 import SparkJobEntry - from ._models_py3 import SparkJobPythonEntry - from ._models_py3 import SparkJobScalaEntry - from ._models_py3 import SparkResourceConfiguration - from ._models_py3 import SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StatusMessage - from ._models_py3 import StorageAccountDetails - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SynapseSpark - from ._models_py3 import SynapseSparkProperties - from ._models_py3 import SystemCreatedAcrAccount - from ._models_py3 import SystemCreatedStorageAccount - from ._models_py3 import SystemData - from ._models_py3 import SystemService - from ._models_py3 import TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - from ._models_py3 import TableVertical - from ._models_py3 import TableVerticalFeaturizationSettings - from ._models_py3 import TableVerticalLimitSettings - from ._models_py3 import TargetLags - from ._models_py3 import TargetRollingWindowSize - from ._models_py3 import TargetUtilizationScaleSettings - from ._models_py3 import TensorFlow - from ._models_py3 import TextClassification - from ._models_py3 import TextClassificationMultilabel - from ._models_py3 import TextNer - from ._models_py3 import TmpfsOptions - from ._models_py3 import TopNFeaturesByAttribution - from ._models_py3 import TrackedResource - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TritonInferencingServer - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UpdateWorkspaceQuotas - from ._models_py3 import UpdateWorkspaceQuotasResult - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput - from ._models_py3 import Usage - from ._models_py3 import UsageName - from ._models_py3 import UserAccountCredentials - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UserCreatedAcrAccount - from ._models_py3 import UserCreatedStorageAccount - from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties - from ._models_py3 import VirtualMachine - from ._models_py3 import VirtualMachineImage - from ._models_py3 import VirtualMachineSchema - from ._models_py3 import VirtualMachineSchemaProperties - from ._models_py3 import VirtualMachineSecrets - from ._models_py3 import VirtualMachineSecretsSchema - from ._models_py3 import VirtualMachineSize - from ._models_py3 import VirtualMachineSizeListResult - from ._models_py3 import VirtualMachineSshCredentials - from ._models_py3 import VolumeDefinition - from ._models_py3 import VolumeOptions - from ._models_py3 import Webhook - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - from ._models_py3 import WorkspaceConnectionPersonalAccessToken - from ._models_py3 import WorkspaceConnectionPropertiesV2 - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult - from ._models_py3 import WorkspaceConnectionServicePrincipal - from ._models_py3 import WorkspaceConnectionSharedAccessSignature - from ._models_py3 import WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - from ._models import AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AcrDetails # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AllFeatures # type: ignore - from ._models import AllNodes # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlComputeSchema # type: ignore - from ._models import AmlOperation # type: ignore - from ._models import AmlOperationDisplay # type: ignore - from ._models import AmlOperationListResult # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import ArmResourceId # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoDeleteSetting # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AutologgerSettings # type: ignore - from ._models import AzMonMonitoringAlertNotificationSettings # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureDatastore # type: ignore - from ._models import AzureDevOpsWebhook # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentConfiguration # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpoint # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointProperties # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchPipelineComponentDeploymentConfiguration # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CategoricalDataDriftMetricThreshold # type: ignore - from ._models import CategoricalDataQualityMetricThreshold # type: ignore - from ._models import CategoricalPredictionDriftMetricThreshold # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import ClassificationModelPerformanceMetricThreshold # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainer # type: ignore - from ._models import CodeContainerProperties # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersion # type: ignore - from ._models import CodeVersionProperties # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import Collection # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentContainer # type: ignore - from ._models import ComponentContainerProperties # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersion # type: ignore - from ._models import ComponentVersionProperties # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceAutologgerSettings # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceContainer # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceDataDisk # type: ignore - from ._models import ComputeInstanceDataMount # type: ignore - from ._models import ComputeInstanceEnvironmentInfo # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSchema # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeInstanceVersion # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeResourceSchema # type: ignore - from ._models import ComputeRuntimeDto # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomInferencingServer # type: ignore - from ._models import CustomMetricThreshold # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomMonitoringSignal # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataCollector # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataDriftMetricThresholdBase # type: ignore - from ._models import DataDriftMonitoringSignal # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataImport # type: ignore - from ._models import DataImportSource # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsSchema # type: ignore - from ._models import DataLakeAnalyticsSchemaProperties # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataQualityMetricThresholdBase # type: ignore - from ._models import DataQualityMonitoringSignal # type: ignore - from ._models import DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import DatabaseSource # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DatabricksSchema # type: ignore - from ._models import DatasetExportSummary # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreProperties # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DeploymentResourceConfiguration # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import Docker # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EmailMonitoringAlertNotificationSettings # type: ignore - from ._models import EncryptionKeyVaultProperties # type: ignore - from ._models import EncryptionKeyVaultUpdateProperties # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import EncryptionUpdateProperties # type: ignore - from ._models import Endpoint # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EndpointScheduleAction # type: ignore - from ._models import EnvironmentContainer # type: ignore - from ._models import EnvironmentContainerProperties # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVariable # type: ignore - from ._models import EnvironmentVersion # type: ignore - from ._models import EnvironmentVersionProperties # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExportSummary # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsProperties # type: ignore - from ._models import Feature # type: ignore - from ._models import FeatureAttributionDriftMonitoringSignal # type: ignore - from ._models import FeatureAttributionMetricThreshold # type: ignore - from ._models import FeatureProperties # type: ignore - from ._models import FeatureResourceArmPaginatedResult # type: ignore - from ._models import FeatureStoreSettings # type: ignore - from ._models import FeatureSubset # type: ignore - from ._models import FeatureWindow # type: ignore - from ._models import FeaturesetContainer # type: ignore - from ._models import FeaturesetContainerProperties # type: ignore - from ._models import FeaturesetContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturesetJob # type: ignore - from ._models import FeaturesetJobArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # type: ignore - from ._models import FeaturesetVersionProperties # type: ignore - from ._models import FeaturesetVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityContainer # type: ignore - from ._models import FeaturestoreEntityContainerProperties # type: ignore - from ._models import FeaturestoreEntityContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityVersion # type: ignore - from ._models import FeaturestoreEntityVersionProperties # type: ignore - from ._models import FeaturestoreEntityVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FileSystemSource # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import HDInsightSchema # type: ignore - from ._models import HdfsDatastore # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import IdleShutdownSetting # type: ignore - from ._models import Image # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageMetadata # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import ImportDataAction # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferencingServer # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import IntellectualProperty # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobBaseProperties # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobResourceConfiguration # type: ignore - from ._models import JobScheduleAction # type: ignore - from ._models import JobService # type: ignore - from ._models import KerberosCredentials # type: ignore - from ._models import KerberosKeytabCredentials # type: ignore - from ._models import KerberosKeytabSecrets # type: ignore - from ._models import KerberosPasswordCredentials # type: ignore - from ._models import KerberosPasswordSecrets # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # type: ignore - from ._models import LakeHouseArtifact # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import ManagedServiceIdentityAutoGenerated # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelPerformanceMetricThresholdBase # type: ignore - from ._models import ModelPerformanceSignalBase # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import MonitorDefinition # type: ignore - from ._models import MonitoringAlertNotificationSettingsBase # type: ignore - from ._models import MonitoringDataSegment # type: ignore - from ._models import MonitoringFeatureFilterBase # type: ignore - from ._models import MonitoringInputData # type: ignore - from ._models import MonitoringSignalBase # type: ignore - from ._models import MonitoringThreshold # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import Nodes # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import NotificationSetting # type: ignore - from ._models import NumericalDataDriftMetricThreshold # type: ignore - from ._models import NumericalDataQualityMetricThreshold # type: ignore - from ._models import NumericalPredictionDriftMetricThreshold # type: ignore - from ._models import Objective # type: ignore - from ._models import OneLakeArtifact # type: ignore - from ._models import OneLakeDatastore # type: ignore - from ._models import OnlineDeployment # type: ignore - from ._models import OnlineDeploymentProperties # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpoint # type: ignore - from ._models import OnlineEndpointProperties # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineInferenceConfiguration # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OutboundRule # type: ignore - from ._models import OutboundRuleBasicResource # type: ignore - from ._models import OutboundRuleListResult # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialJobBase # type: ignore - from ._models import PartialJobBasePartialResource # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialManagedServiceIdentityAutoGenerated # type: ignore - from ._models import PartialMinimalTrackedResource # type: ignore - from ._models import PartialMinimalTrackedResourceWithIdentity # type: ignore - from ._models import PartialMinimalTrackedResourceWithSku # type: ignore - from ._models import PartialNotificationSetting # type: ignore - from ._models import PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PendingUploadCredentialDto # type: ignore - from ._models import PendingUploadRequestDto # type: ignore - from ._models import PendingUploadResponseDto # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PredictionDriftMetricThresholdBase # type: ignore - from ._models import PredictionDriftMonitoringSignal # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointAutoGenerated # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionAutoGenerated # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointDestination # type: ignore - from ._models import PrivateEndpointOutboundRule # type: ignore - from ._models import PrivateEndpointResource # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import PrivateLinkServiceConnectionStateAutoGenerated # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import ProgressMetrics # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QueueSettings # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import Ray # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryRegionArmDetails # type: ignore - from ._models import RegistryTrackedResourceArmPaginatedResult # type: ignore - from ._models import Regression # type: ignore - from ._models import RegressionModelPerformanceMetricThreshold # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestLogging # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import Schedule # type: ignore - from ._models import ScheduleActionBase # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import ScheduleProperties # type: ignore - from ._models import ScheduleResourceArmPaginatedResult # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import Seasonality # type: ignore - from ._models import SecretConfiguration # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import ServiceTagDestination # type: ignore - from ._models import ServiceTagOutboundRule # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import SparkJob # type: ignore - from ._models import SparkJobEntry # type: ignore - from ._models import SparkJobPythonEntry # type: ignore - from ._models import SparkJobScalaEntry # type: ignore - from ._models import SparkResourceConfiguration # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StatusMessage # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemCreatedAcrAccount # type: ignore - from ._models import SystemCreatedStorageAccount # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import TmpfsOptions # type: ignore - from ._models import TopNFeaturesByAttribution # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TritonInferencingServer # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserCreatedAcrAccount # type: ignore - from ._models import UserCreatedStorageAccount # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineSchema # type: ignore - from ._models import VirtualMachineSchemaProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSecretsSchema # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import VolumeDefinition # type: ignore - from ._models import VolumeOptions # type: ignore - from ._models import Webhook # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # type: ignore - from ._models import WorkspaceConnectionPersonalAccessToken # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceConnectionServicePrincipal # type: ignore - from ._models import WorkspaceConnectionSharedAccessSignature # type: ignore - from ._models import WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - AutoDeleteCondition, - AutoRebuildSetting, - Autosave, - BaseEnvironmentSourceType, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModelPerformanceMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeType, - ConnectionAuthType, - ConnectionCategory, - ContainerType, - CreatedByType, - CredentialsType, - DataCollectionMode, - DataImportSourceType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureAttributionMetric, - FeatureDataType, - FeatureLags, - FeaturestoreJobType, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InferencingServerType, - InputDeliveryMode, - InputPathType, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogTrainingMetrics, - LogValidationLoss, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedNetworkStatus, - ManagedServiceIdentityType, - MaterializationStoreType, - MediaType, - MlflowAutologger, - ModelSize, - MonitoringAlertNotificationType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataContext, - MonitoringModelType, - MonitoringNotificationMode, - MonitoringSignalType, - MountAction, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - OsType, - OutputDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - PendingUploadCredentialType, - PendingUploadType, - PrivateEndpointConnectionProvisioningState, - PrivateEndpointServiceConnectionStatus, - ProtectionLevel, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccess, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModelPerformanceMetric, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - ValueFormat, - VmPriority, - VolumeDefinitionType, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzMonMonitoringAlertNotificationSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomMetricThreshold', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EmailMonitoringAlertNotificationSettings', - 'EncryptionKeyVaultProperties', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetJob', - 'FeaturesetJobArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'ManagedServiceIdentityAutoGenerated', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignalBase', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorDefinition', - 'MonitoringAlertNotificationSettingsBase', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputData', - 'MonitoringSignalBase', - 'MonitoringThreshold', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialManagedServiceIdentityAutoGenerated', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointAutoGenerated', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionAutoGenerated', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'PrivateLinkServiceConnectionStateAutoGenerated', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestLogging', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonInferencingServer', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureLags', - 'FeaturestoreJobType', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'MonitoringAlertNotificationType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataContext', - 'MonitoringModelType', - 'MonitoringNotificationMode', - 'MonitoringSignalType', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index c59c16e2e62f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,1904 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AutoDeleteCondition(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATED_GREATER_THAN = "CreatedGreaterThan" - LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" - -class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -class BaseEnvironmentSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Base environment type. - """ - - ENVIRONMENT_ASSET = "EnvironmentAsset" - -class BatchDeploymentConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated property types for batch deployments. - """ - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - -class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ - - #: Target encoding for text data. - TEXT_TARGET_ENCODER = "TextTargetEncoder" - #: Ohe hot encoding creates a binary feature transformation. - ONE_HOT_ENCODER = "OneHotEncoder" - #: Target encoding for categorical data. - CAT_TARGET_ENCODER = "CatTargetEncoder" - #: Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - #: weighting scheme for identifying information from documents. - TF_IDF = "TfIdf" - #: Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - #: natural log of the P(1)/P(0) to create weights. - WO_E_TARGET_ENCODER = "WoETargetEncoder" - #: Label encoder converts labels/categorical variables in a numerical form. - LABEL_ENCODER = "LabelEncoder" - #: Word embedding helps represents words or phrases as a vector, or a series of numbers. - WORD_EMBEDDING = "WordEmbedding" - #: Naive Bayes is a classified that is used for classification of discrete features that are - #: categorically distributed. - NAIVE_BAYES = "NaiveBayes" - #: Count Vectorizer converts a collection of text documents to a matrix of token counts. - COUNT_VECTORIZER = "CountVectorizer" - #: Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - #: This is often used for high-cardinality categorical features. - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - -class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class CategoricalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class CategoricalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class CategoricalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class ClassificationModelPerformanceMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Calculates the accuracy of the model predictions. - ACCURACY = "Accuracy" - #: Calculates the precision of the model predictions. - PRECISION = "Precision" - #: Calculates the recall of the model predictions. - RECALL = "Recall" - #: Calculates the F1 score of the model predictions. - F1_SCORE = "F1Score" - -class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - -class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - FEATURE_STORE = "FeatureStore" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - REDIS = "Redis" - -class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of container to retrieve logs from. - """ - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_KEYTAB = "KerberosKeytab" - KERBEROS_PASSWORD = "KerberosPassword" - -class DataCollectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataImportSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ - - DATABASE = "database" - FILE_SYSTEM = "file_system" - -class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - HDFS = "Hdfs" - ONE_LAKE = "OneLake" - -class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - RAY = "Ray" - -class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EmailNotificationEnableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the email notification type. - """ - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - -class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Connection status of the service consumer with the service provider - """ - - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - -class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -class FeatureAttributionMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - -class FeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - -class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturestoreJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - RECURRENT_MATERIALIZATION = "RecurrentMaterialization" - BACKFILL_MATERIALIZATION = "BackfillMaterialization" - -class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster is a deep neural network model - #: capable of modeling correlations over long time periods. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - images - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class IncrementalDataRefresh(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether IncrementalDataRefresh is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class InferencingServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Inferencing server type for various targets. - """ - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - -class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InputPathType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Input path type for package inputs. - """ - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class IsolationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ - - LITERAL = "literal" - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - #: The job is in a scheduled state. Job is not in any active state. - SCHEDULED = "Scheduled" - -class JobTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job tier. - """ - - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - -class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class LogTrainingMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Enable compute and log training metrics. - ENABLE = "Enable" - #: Disable compute and log training metrics. - DISABLE = "Disable" - -class LogValidationLoss(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Enable compute and log validation metrics. - ENABLE = "Enable" - #: Disable compute and log validation metrics. - DISABLE = "Disable" - -class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedNetworkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class MaterializationStoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class MonitoringAlertNotificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Settings for Azure Monitor based alerting. - AZURE_MONITOR = "AzureMonitor" - #: Settings for AML email notifications. - EMAIL = "Email" - -class MonitoringFeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Used for features of numerical data type. - NUMERICAL = "Numerical" - #: Used for features of categorical data type. - CATEGORICAL = "Categorical" - -class MonitoringFeatureFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Includes all features. - ALL_FEATURES = "AllFeatures" - #: Only includes the top contributing features, measured by feature attribution. - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - #: Includes a user-defined subset of features. - FEATURE_SUBSET = "FeatureSubset" - -class MonitoringInputDataContext(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: A dataset containing the feature input to the model. - MODEL_INPUTS = "ModelInputs" - #: A dataset containing the inferred results of the model. - MODEL_OUTPUTS = "ModelOutputs" - #: A dataset containing the data used for training the model. - TRAINING = "Training" - #: A dataset leveraged to test the model. - TEST = "Test" - #: A dataset leveraged for model validation. - VALIDATION = "Validation" - #: A dataset containing the ground truth data. - GROUND_TRUTH = "GroundTruth" - -class MonitoringModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: A model trained for classification tasks. - CLASSIFICATION = "Classification" - #: A model trained for regressions tasks. - REGRESSION = "Regression" - -class MonitoringNotificationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Disabled notifications will not produce emails/metrics leveraged for alerting. - DISABLED = "Disabled" - #: Enabled notification will produce emails/metrics leveraged for alerting. - ENABLED = "Enabled" - -class MonitoringSignalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Tracks model input data distribution change, comparing against training data or past production - #: data. - DATA_DRIFT = "DataDrift" - #: Tracks prediction result data distribution change, comparing against validation/test label data - #: or past production data. - PREDICTION_DRIFT = "PredictionDrift" - #: Tracks model input data integrity. - DATA_QUALITY = "DataQuality" - #: Tracks feature importance change in production, comparing against feature importance at - #: training time. - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - #: Tracks a custom signal provided by users. - CUSTOM = "Custom" - #: Tracks model performance based on ground truth data. - MODEL_PERFORMANCE = "ModelPerformance" - -class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class MultiSelect(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether multiSelect is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ - - ALL = "All" - CUSTOM = "Custom" - -class NumericalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class NumericalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class NumericalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OneLakeArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine OneLake artifact type. - """ - - LAKE_HOUSE = "LakeHouse" - -class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -class PackageBuildState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Package build state returned in package response. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class PackageInputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mounting type of the model or the inputs - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - DOWNLOAD = "Download" - -class PackageInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the inputs. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - -class PendingUploadCredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the PendingUpload credentials type. - """ - - SAS = "SAS" - -class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of storage to use for the pending upload location - """ - - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ - - PENDING = "Pending" - APPROVED = "Approved" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class ProtectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protection level associated with the Intellectual Property. - """ - - #: All means Intellectual Property is fully protected. - ALL = "All" - #: None means it is not an Intellectual Property. - NONE = "None" - -class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of workspace resource. The provisioningState is to indicate states - for resource provisioning. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - SOFT_DELETED = "SoftDeleted" - -class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModelPerformanceMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: The Mean Absolute Error (MAE) metric. - MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" - #: The Root Mean Squared Error (RMSE) metric. - ROOT_MEAN_SQUARED_ERROR = "RootMeanSquaredError" - #: The Mean Squared Error (MSE) metric. - MEAN_SQUARED_ERROR = "MeanSquaredError" - -class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class RollingRateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - YEAR = "Year" - MONTH = "Month" - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - -class RuleCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - -class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - IMPORT_DATA = "ImportData" - CREATE_MONITOR = "CreateMonitor" - -class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_PASSWORD = "KerberosPassword" - KERBEROS_KEYTAB = "KerberosKeytab" - -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Training mode dictates whether to use distributed training or not - """ - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - -class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ - - JSON = "JSON" - -class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" - -class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WebhookType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the webhook callback service type. - """ - - AZURE_DEV_OPS = "AzureDevOps" - -class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py deleted file mode 100644 index 1165d3eb8142..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py +++ /dev/null @@ -1,29698 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccessKeyAuthTypeWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.expiry_time = kwargs.get('expiry_time', None) - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - 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 - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) - - -class AmlOperation(msrest.serialization.Model): - """Azure Machine Learning REST API operation. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: Display name of operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) - - -class AmlOperationDisplay(msrest.serialization.Model): - """Display name of operation. - - :ivar provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that users can perform. - :vartype operation: str - :ivar description: The description for the operation. - :vartype description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :paramtype provider: str - :keyword resource: The resource on which the operation is performed. - :paramtype resource: str - :keyword operation: The operation that users can perform. - :paramtype operation: str - :keyword description: The description for the operation. - :paramtype description: str - """ - super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = kwargs.get('condition', None) - self.value = kwargs.get('value', None) - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.secrets_configuration = kwargs.get('secrets_configuration', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): - """MonitoringAlertNotificationSettingsBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzMonMonitoringAlertNotificationSettings, EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - _subtype_map = { - 'alert_notification_type': {'AzureMonitor': 'AzMonMonitoringAlertNotificationSettings', 'Email': 'EmailMonitoringAlertNotificationSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringAlertNotificationSettingsBase, self).__init__(**kwargs) - self.alert_notification_type = None # type: Optional[str] - - -class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """AzMonMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AzMonMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'AzureMonitor' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall", "F1Score". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall", "F1Score". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Classification' # type: str - self.metric = kwargs['metric'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - self.training_mode = kwargs.get('training_mode', None) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class CodeContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", - "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "JobRunning", "SettingUp", "SetupFailed", - "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', 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) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: The throughput of the collections in cosmosdb database. - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: The throughput of the collections in cosmosdb database. - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, ModelPerformanceSignalBase, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'ModelPerformanceSignalBase': 'ModelPerformanceSignalBase', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.lookback_period = kwargs.get('lookback_period', None) - self.mode = kwargs.get('mode', None) - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputData] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputData}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputData] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.metric_thresholds = kwargs['metric_thresholds'] - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = kwargs.get('connection', None) - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(**kwargs) - self.source_type = 'database' # type: str - self.query = kwargs.get('query', None) - self.stored_procedure = kwargs.get('stored_procedure', None) - self.stored_procedure_params = kwargs.get('stored_procedure_params', None) - self.table_name = kwargs.get('table_name', None) - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) - - -class DataContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar target_data: Required. [Required] The data which drift will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword target_data: Required. [Required] The data which drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.baseline_data = kwargs['baseline_data'] - self.data_segment = kwargs.get('data_segment', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.target_data = kwargs['target_data'] - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.stage = kwargs.get('stage', None) - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = kwargs.get('asset_name', None) - self.source = kwargs.get('source', None) - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar target_data: Required. [Required] The data produced by the production service which drift - will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword target_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.baseline_data = kwargs['baseline_data'] - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.target_data = kwargs['target_data'] - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBase(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.locations = kwargs.get('locations', None) - self.max_instance_count = kwargs.get('max_instance_count', None) - self.properties = kwargs.get('properties', None) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - """ - - _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: Value of Parameters. - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Value of Parameters. - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) - - -class EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - :ivar email_notification_setting: Configuration for notification. - :vartype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - 'email_notification_setting': {'key': 'emailNotificationSetting', 'type': 'NotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_setting: Configuration for notification. - :paramtype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - super(EmailMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'Email' # type: str - self.email_notification_setting = kwargs.get('email_notification_setting', None) - - -class EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption - key is present. - :vartype key_vault_arm_id: str - :ivar key_identifier: Required. Key vault uri to access the encryption key. - :vartype key_identifier: str - :ivar identity_client_id: For future use - The client id of the identity which will be used to - access key vault. - :vartype identity_client_id: str - """ - - _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned - encryption key is present. - :paramtype key_vault_arm_id: str - :keyword key_identifier: Required. Key vault uri to access the encryption key. - :paramtype key_identifier: str - :keyword identity_client_id: For future use - The client id of the identity which will be used - to access key vault. - :paramtype identity_client_id: str - """ - super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar identity: The identity that will be used to access the key vault for encryption at rest. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. Customer Key vault properties. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties - """ - - _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword identity: The identity that will be used to access the key vault for encryption at - rest. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. Customer Key vault properties. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_properties: Required. Customer Key vault properties. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] - - -class EnvironmentContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) - - -class EnvironmentVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Feature(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar model_type: Required. [Required] The type of task the model performs. Possible values - include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar target_data: Required. [Required] The data which drift will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword model_type: Required. [Required] The type of task the model performs. Possible values - include: "Classification", "Regression". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :keyword target_data: Required. [Required] The data which drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.baseline_data = kwargs['baseline_data'] - self.metric_threshold = kwargs['metric_threshold'] - self.model_type = kwargs['model_type'] - self.target_data = kwargs['target_data'] - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetJob(msrest.serialization.Model): - """Dto object representing the feature set job. - - :ivar created_date: Specifies the created date. - :vartype created_date: ~datetime.datetime - :ivar display_name: Specifies the display name. - :vartype display_name: str - :ivar duration: Specifies the duration. - :vartype duration: ~datetime.timedelta - :ivar experiment_id: Specifies the experiment id. - :vartype experiment_id: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specifies the job id. - :vartype job_id: str - :ivar status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar tags: A set of tags. Specifies the tags if any. - :vartype tags: dict[str, str] - :ivar type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - - _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'duration'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_date: Specifies the created date. - :paramtype created_date: ~datetime.datetime - :keyword display_name: Specifies the display name. - :paramtype display_name: str - :keyword duration: Specifies the duration. - :paramtype duration: ~datetime.timedelta - :keyword experiment_id: Specifies the experiment id. - :paramtype experiment_id: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specifies the job id. - :paramtype job_id: str - :keyword status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :keyword tags: A set of tags. Specifies the tags if any. - :paramtype tags: dict[str, str] - :keyword type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = kwargs.get('created_date', None) - self.display_name = kwargs.get('display_name', None) - self.duration = kwargs.get('duration', None) - self.experiment_id = kwargs.get('experiment_id', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.status = kwargs.get('status', None) - self.tags = kwargs.get('tags', None) - self.type = kwargs.get('type', None) - - -class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetJob entities. - - :ivar next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - super(FeaturesetJobArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - - -class FeaturesetVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) - self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(**kwargs) - self.source_type = 'file_system' # type: str - self.path = kwargs.get('path', None) - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.features_unknown_at_forecast_time = kwargs.get('features_unknown_at_forecast_time', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class FQDNEndpointsProperties(msrest.serialization.Model): - """FQDNEndpointsProperties. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - super(OutboundRule, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.status = kwargs.get('status', None) - self.category = kwargs.get('category', None) - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class IdentityForCmk(msrest.serialization.Model): - """Identity that will be used to access key vault for encryption at rest. - - :ivar user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - """ - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.log_training_metrics = kwargs.get('log_training_metrics', None) - self.log_validation_loss = kwargs.get('log_validation_loss', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = kwargs['data_import_definition'] - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] - - -class JobBase(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) - - -class LabelingJob(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: - :vartype primary_access_key: str - :ivar secondary_access_key: - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - :ivar user_storage_resource_id: - :vartype user_storage_resource_id: str - :ivar app_insights_instrumentation_key: - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - self.user_storage_resource_id = None - self.app_insights_instrumentation_key = None - self.container_registry_credentials = None - self.notebook_access_keys = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - :ivar spark_ready: - :vartype spark_ready: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - :keyword spark_ready: - :paramtype spark_ready: bool - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.spark_ready = kwargs.get('spark_ready', None) - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - - _validation = { - 'network_id': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) - self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - - -class ModelContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] - - -class ModelPerformanceSignalBase(MonitoringSignalBase): - """ModelPerformanceSignalBase. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar target_data: Required. [Required] The data produced by the production service which drift - will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword target_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(ModelPerformanceSignalBase, self).__init__(**kwargs) - self.signal_type = 'ModelPerformanceSignalBase' # type: str - self.baseline_data = kwargs['baseline_data'] - self.data_segment = kwargs.get('data_segment', None) - self.metric_threshold = kwargs['metric_threshold'] - self.target_data = kwargs['target_data'] - - -class ModelVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_setting: The monitor's notification settings. - :vartype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :ivar compute_id: Required. [Required] The ARM resource ID of the compute resource to run the - monitoring job on. - :vartype compute_id: str - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: str - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_setting': {'key': 'alertNotificationSetting', 'type': 'MonitoringAlertNotificationSettingsBase'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'str'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_setting: The monitor's notification settings. - :paramtype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :keyword compute_id: Required. [Required] The ARM resource ID of the compute resource to run - the monitoring job on. - :paramtype compute_id: str - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: str - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_setting = kwargs.get('alert_notification_setting', None) - self.compute_id = kwargs['compute_id'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = kwargs.get('feature', None) - self.values = kwargs.get('values', None) - - -class MonitoringInputData(msrest.serialization.Model): - """MonitoringInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar asset: The data asset input to be leveraged by the monitoring job.. - :vartype asset: any - :ivar data_context: Required. [Required] The context of the data source. Possible values - include: "ModelInputs", "ModelOutputs", "Training", "Test", "Validation", "GroundTruth". - :vartype data_context: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataContext - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar target_column_name: The target column in the given data asset to leverage. - :vartype target_column_name: str - """ - - _validation = { - 'data_context': {'required': True}, - } - - _attribute_map = { - 'asset': {'key': 'asset', 'type': 'object'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset: The data asset input to be leveraged by the monitoring job.. - :paramtype asset: any - :keyword data_context: Required. [Required] The context of the data source. Possible values - include: "ModelInputs", "ModelOutputs", "Training", "Test", "Validation", "GroundTruth". - :paramtype data_context: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataContext - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword target_column_name: The target column in the given data asset to leverage. - :paramtype target_column_name: str - """ - super(MonitoringInputData, self).__init__(**kwargs) - self.asset = kwargs.get('asset', None) - self.data_context = kwargs['data_context'] - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.target_column_name = kwargs.get('target_column_name', None) - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar host_name: - :vartype host_name: str - :ivar public_dns: - :vartype public_dns: str - :ivar access_token: - :vartype access_token: str - :ivar token_type: - :vartype token_type: str - :ivar expires_in: - :vartype expires_in: int - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - """ - - _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - } - - _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.notebook_resource_id = None - self.host_name = None - self.public_dns = None - self.access_token = None - self.token_type = None - self.expires_in = None - self.refresh_token = None - self.scope = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class OutboundRuleBasicResource(Resource): - """Outbound Rule Basic Resource for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_name: Required. [Required] Target environment name to be generated by - package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_name: Required. [Required] Target environment name to be generated - by package. - :paramtype target_environment_name: str - :keyword target_environment_version: Target environment version to be generated by package. - :paramtype target_environment_version: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.tags = kwargs.get('tags', None) - self.target_environment_name = kwargs['target_environment_name'] - self.target_environment_version = kwargs.get('target_environment_version', None) - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - :ivar target_environment_name: Target environment name to be generated by package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - 'target_environment_name': {'readonly': True}, - 'target_environment_version': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.tags = None - self.target_environment_id = None - self.target_environment_name = None - self.target_environment_version = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = kwargs.get('notification_setting', None) - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - - -class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentityAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = kwargs.get('webhooks', None) - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar target_data: Required. [Required] The data which drift will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :keyword target_data: Required. [Required] The data which drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.baseline_data = kwargs['baseline_data'] - self.metric_thresholds = kwargs['metric_thresholds'] - self.model_type = kwargs['model_type'] - self.target_data = kwargs['target_data'] - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The ARM identifier for Subnet resource that private endpoint links to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class PrivateEndpointAutoGenerated(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpointAutoGenerated, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Possible values include: "Succeeded", "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = None - - -class PrivateEndpointConnectionAutoGenerated(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionStateAutoGenerated - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateAutoGenerated'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionStateAutoGenerated - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(PrivateEndpointConnectionAutoGenerated, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar subresource_target: - :vartype subresource_target: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword subresource_target: - :paramtype subresource_target: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Status of a managed network Outbound Rule of a machine learning - workspace. Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.subresource_target = kwargs.get('subresource_target', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) - - -class PrivateEndpointResource(PrivateEndpointAutoGenerated): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.group_id = None - self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :keyword description: The reason for approval/rejection of the connection. - :paramtype description: str - :keyword actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :paramtype actions_required: str - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) - - -class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - self.priority = kwargs.get('priority', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = kwargs.get('address', None) - self.dashboard_port = kwargs.get('dashboard_port', None) - self.head_node_additional_args = kwargs.get('head_node_additional_args', None) - self.include_dashboard = kwargs.get('include_dashboard', None) - self.port = kwargs.get('port', None) - self.worker_node_additional_args = kwargs.get('worker_node_additional_args', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionAutoGenerated] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionAutoGenerated]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :paramtype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionAutoGenerated] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: - :vartype location: str - :ivar username: - :vartype username: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.username = None - self.passwords = kwargs.get('passwords', None) - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Regression' # type: str - self.metric = kwargs['metric'] - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class Schedule(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) - self.provisioning_state = None - self.trigger = kwargs['trigger'] - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.workspace_secret_name = kwargs.get('workspace_secret_name', None) - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: The settings for the service managed cosmosdb account. - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: The settings for the service managed cosmosdb account. - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_tag: - :vartype service_tag: str - :ivar protocol: - :vartype protocol: str - :ivar port_ranges: - :vartype port_ranges: str - """ - - _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_tag: - :paramtype service_tag: str - :keyword protocol: - :paramtype protocol: str - :keyword port_ranges: - :paramtype port_ranges: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.service_tag = kwargs.get('service_tag', None) - self.protocol = kwargs.get('protocol', None) - self.port_ranges = kwargs.get('port_ranges', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar private_link_resource_id: The resource id that private link links to. - :vartype private_link_resource_id: str - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword private_link_resource_id: The resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar kind: - :vartype kind: str - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled", - "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar encryption: The encryption settings of Azure ML workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: str - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar enable_data_isolation: A flag to determine if workspace has data isolation enabled. The - flag can only be set at the creation phase, it can't be updated. - :vartype enable_data_isolation: bool - :ivar storage_accounts: : A list of storage accounts used by Hub. - :vartype storage_accounts: list[str] - :ivar key_vaults: A list of key vaults used by Hub. - :vartype key_vaults: list[str] - :ivar container_registries: A list of container registries used by Hub. - :vartype container_registries: list[str] - :ivar existing_workspaces: A list of existing workspaces used by Hub to perform convert. - :vartype existing_workspaces: list[str] - :ivar hub_resource_id: Resource Id of Hub used for lean workspace. - :vartype hub_resource_id: str - :ivar associated_workspaces: A list of lean workspaces associated with Hub. - :vartype associated_workspaces: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - 'associated_workspaces': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword kind: - :paramtype kind: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword encryption: The encryption settings of Azure ML workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword enable_data_isolation: A flag to determine if workspace has data isolation enabled. - The flag can only be set at the creation phase, it can't be updated. - :paramtype enable_data_isolation: bool - :keyword storage_accounts: : A list of storage accounts used by Hub. - :paramtype storage_accounts: list[str] - :keyword key_vaults: A list of key vaults used by Hub. - :paramtype key_vaults: list[str] - :keyword container_registries: A list of container registries used by Hub. - :paramtype container_registries: list[str] - :keyword existing_workspaces: A list of existing workspaces used by Hub to perform convert. - :paramtype existing_workspaces: list[str] - :keyword hub_resource_id: Resource Id of Hub used for lean workspace. - :paramtype hub_resource_id: str - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) - self.service_provisioned_resource_group = None - self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) - self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.tenant_id = None - self.storage_hns_enabled = None - self.ml_flow_tracking_uri = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) - self.soft_deleted_at = None - self.scheduled_purge_date = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', False) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.container_registries = kwargs.get('container_registries', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) - self.associated_workspaces = None - self.managed_network = kwargs.get('managed_network', None) - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar resource_id: - :vartype resource_id: str - :ivar client_id: - :vartype client_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: - :paramtype resource_id: str - :keyword client_id: - :paramtype client_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - :ivar next_link: - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar username: - :vartype username: str - :ivar password: - :vartype password: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: - :paramtype username: str - :keyword password: - :paramtype password: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :ivar next_link: The URI that can be used to request the next list of machine learning - workspaces. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :keyword next_link: The URI that can be used to request the next list of machine learning - workspaces. - :paramtype next_link: str - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar encryption: The encryption settings of the workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword encryption: The encryption settings of the workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.managed_network = kwargs.get('managed_network', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py deleted file mode 100644 index b8e2b7bcd701..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py +++ /dev/null @@ -1,32252 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccessKeyAuthTypeWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.expiry_time = expiry_time - self.category = category - self.target = target - self.value = value - self.value_format = value_format - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = credentials - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - *, - system_created_acr_account: Optional["SystemCreatedAcrAccount"] = None, - user_created_acr_account: Optional["UserCreatedAcrAccount"] = None, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = system_created_acr_account - self.user_created_acr_account = user_created_acr_account - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = properties - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = properties - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - property_bag: Optional[Any] = None, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - self.property_bag = property_bag - - -class AmlOperation(msrest.serialization.Model): - """Azure Machine Learning REST API operation. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: Display name of operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["AmlOperationDisplay"] = None, - is_data_action: Optional[bool] = None, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = name - self.display = display - self.is_data_action = is_data_action - - -class AmlOperationDisplay(msrest.serialization.Model): - """Display name of operation. - - :ivar provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that users can perform. - :vartype operation: str - :ivar description: The description for the operation. - :vartype description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :paramtype provider: str - :keyword resource: The resource on which the operation is performed. - :paramtype resource: str - :keyword operation: The operation that users can perform. - :paramtype operation: str - :keyword description: The description for the operation. - :paramtype description: str - """ - super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs - ): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = value - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = resource_id - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.auto_delete_setting = auto_delete_setting - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - condition: Optional[Union[str, "AutoDeleteCondition"]] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = condition - self.value = value - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = notification_setting - self.secrets_configuration = secrets_configuration - self.services = services - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.task_type = None # type: Optional[str] - self.training_data = training_data - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): - """MonitoringAlertNotificationSettingsBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzMonMonitoringAlertNotificationSettings, EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - _subtype_map = { - 'alert_notification_type': {'AzureMonitor': 'AzMonMonitoringAlertNotificationSettings', 'Email': 'EmailMonitoringAlertNotificationSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringAlertNotificationSettingsBase, self).__init__(**kwargs) - self.alert_notification_type = None # type: Optional[str] - - -class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """AzMonMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AzMonMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'AzureMonitor' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = event_type - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = code_configuration - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = resource_id - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["DeploymentResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.deployment_configuration = deployment_configuration - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - component_id: Optional["IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = component_id - self.description = description - self.settings = settings - self.tags = tags - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = propagation - self.create_host_path = create_host_path - self.selinux = selinux - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["ClassificationTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = threshold - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall", "F1Score". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "ClassificationModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall", "F1Score". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Classification' # type: str - self.metric = metric - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - self.training_mode = training_mode - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class CodeContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = 1, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = client_id - self.data_collection_mode = data_collection_mode - self.data_id = data_id - self.sampling_rate = sampling_rate - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.queue_settings = queue_settings - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - self.stage = stage - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "Network"]] = None, - environment: Optional["ComputeInstanceEnvironmentInfo"] = None, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = name - self.autosave = autosave - self.gpu = gpu - self.network = network - self.environment = environment - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - caching: Optional[Union[str, "Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = caching - self.disk_size_gb = disk_size_gb - self.lun = lun - self.storage_account_type = storage_account_type - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "MountAction"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = source - self.source_type = source_type - self.mount_name = mount_name - self.mount_action = mount_action - self.created_by = created_by - self.mount_path = mount_path - self.mount_state = mount_state - self.mounted_on = mounted_on - self.error = error - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = name - self.version = version - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "OperationTrigger"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", - "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - self.operation_trigger = operation_trigger - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "JobRunning", "SettingUp", "SetupFailed", - "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.autologger_settings = autologger_settings - self.ssh_settings = ssh_settings - self.custom_services = custom_services - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - self.idle_time_before_shutdown = idle_time_before_shutdown - self.enable_node_public_ip = enable_node_public_ip - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = runtime - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = spark_runtime_version - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "TriggerType"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - schedule: Optional["ScheduleBase"] = None, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.action = action - self.trigger_type = trigger_type - self.recurrence = recurrence - self.cron = cron - self.schedule = schedule - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: The throughput of the collections in cosmosdb database. - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: The throughput of the collections in cosmosdb database. - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = monitor_definition - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - *, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = end_time - self.start_time = start_time - self.time_zone = time_zone - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = expression - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = inference_configuration - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: str, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'custom_model' # type: str - self.description = description - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, ModelPerformanceSignalBase, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'ModelPerformanceSignalBase': 'ModelPerformanceSignalBase', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.lookback_period = lookback_period - self.mode = mode - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputData] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputData}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - input_assets: Optional[Dict[str, "MonitoringInputData"]] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputData] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - super(CustomMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = component_id - self.input_assets = input_assets - self.metric_thresholds = metric_thresholds - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - name: Optional[str] = None, - image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, - docker: Optional["Docker"] = None, - endpoints: Optional[List["Endpoint"]] = None, - volumes: Optional[List["VolumeDefinition"]] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.image = image - self.environment_variables = environment_variables - self.docker = docker - self.endpoints = endpoints - self.volumes = volumes - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - *, - connection: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = connection - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - query: Optional[str] = None, - stored_procedure: Optional[str] = None, - stored_procedure_params: Optional[List[Dict[str, str]]] = None, - table_name: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'database' # type: str - self.query = query - self.stored_procedure = stored_procedure - self.stored_procedure_params = stored_procedure_params - self.table_name = table_name - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = properties - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - *, - collections: Dict[str, "Collection"], - request_logging: Optional["RequestLogging"] = None, - rolling_rate: Optional[Union[str, "RollingRateType"]] = None, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = collections - self.request_logging = request_logging - self.rolling_rate = rolling_rate - - -class DataContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar target_data: Required. [Required] The data which drift will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - *, - baseline_data: "MonitoringInputData", - metric_thresholds: List["DataDriftMetricThresholdBase"], - target_data: "MonitoringInputData", - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword target_data: Required. [Required] The data which drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(DataDriftMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.baseline_data = baseline_data - self.data_segment = data_segment - self.features = features - self.metric_thresholds = metric_thresholds - self.target_data = target_data - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - self.intellectual_property = intellectual_property - self.stage = stage - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - asset_name: Optional[str] = None, - source: Optional["DataImportSource"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = asset_name - self.source = source - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = properties - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar target_data: Required. [Required] The data produced by the production service which drift - will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - *, - baseline_data: "MonitoringInputData", - metric_thresholds: List["DataQualityMetricThresholdBase"], - target_data: "MonitoringInputData", - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword target_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(DataQualityMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.baseline_data = baseline_data - self.features = features - self.metric_thresholds = metric_thresholds - self.target_data = target_data - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Datastore"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBase(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.locations = locations - self.max_instance_count = max_instance_count - self.properties = properties - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - """ - - _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - } - - def __init__( - self, - *, - udr: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - application_insights: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = udr - self.nsg = nsg - self.resource_lock = resource_lock - self.dns_resolution = dns_resolution - self.storage_account = storage_account - self.key_vault = key_vault - self.container_registry = container_registry - self.application_insights = application_insights - self.others = others - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: Value of Parameters. - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: Value of Parameters. - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - privileged: Optional[bool] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.privileged = privileged - - -class EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - :ivar email_notification_setting: Configuration for notification. - :vartype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - 'email_notification_setting': {'key': 'emailNotificationSetting', 'type': 'NotificationSetting'}, - } - - def __init__( - self, - *, - email_notification_setting: Optional["NotificationSetting"] = None, - **kwargs - ): - """ - :keyword email_notification_setting: Configuration for notification. - :paramtype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - super(EmailMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'Email' # type: str - self.email_notification_setting = email_notification_setting - - -class EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption - key is present. - :vartype key_vault_arm_id: str - :ivar key_identifier: Required. Key vault uri to access the encryption key. - :vartype key_identifier: str - :ivar identity_client_id: For future use - The client id of the identity which will be used to - access key vault. - :vartype identity_client_id: str - """ - - _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_arm_id: str, - key_identifier: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned - encryption key is present. - :paramtype key_vault_arm_id: str - :keyword key_identifier: Required. Key vault uri to access the encryption key. - :paramtype key_identifier: str - :keyword identity_client_id: For future use - The client id of the identity which will be used - to access key vault. - :paramtype identity_client_id: str - """ - super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = key_vault_arm_id - self.key_identifier = key_identifier - self.identity_client_id = identity_client_id - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar identity: The identity that will be used to access the key vault for encryption at rest. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. Customer Key vault properties. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties - """ - - _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, - } - - def __init__( - self, - *, - status: Union[str, "EncryptionStatus"], - key_vault_properties: "EncryptionKeyVaultProperties", - identity: Optional["IdentityForCmk"] = None, - **kwargs - ): - """ - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword identity: The identity that will be used to access the key vault for encryption at - rest. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. Customer Key vault properties. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = status - self.identity = identity - self.key_vault_properties = key_vault_properties - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - *, - key_vault_properties: "EncryptionKeyVaultUpdateProperties", - **kwargs - ): - """ - :keyword key_vault_properties: Required. Customer Key vault properties. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = key_vault_properties - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "Protocol"]] = "tcp", - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = protocol - self.name = name - self.target = target - self.published = published - self.host_ip = host_ip - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = endpoint_invocation_definition - - -class EnvironmentContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "EnvironmentVariableType"]] = "local", - value: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.value = value - - -class EnvironmentVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - auto_rebuild: Optional[Union[str, "AutoRebuildSetting"]] = None, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.auto_rebuild = auto_rebuild - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.intellectual_property = intellectual_property - self.os_type = os_type - self.provisioning_state = None - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class Feature(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = properties - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar model_type: Required. [Required] The type of task the model performs. Possible values - include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar target_data: Required. [Required] The data which drift will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - *, - baseline_data: "MonitoringInputData", - metric_threshold: "FeatureAttributionMetricThreshold", - model_type: Union[str, "MonitoringModelType"], - target_data: "MonitoringInputData", - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword model_type: Required. [Required] The type of task the model performs. Possible values - include: "Classification", "Regression". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :keyword target_data: Required. [Required] The data which drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.baseline_data = baseline_data - self.metric_threshold = metric_threshold - self.model_type = model_type - self.target_data = target_data - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "FeatureAttributionMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - feature_name: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.data_type = data_type - self.feature_name = feature_name - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Feature"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetJob(msrest.serialization.Model): - """Dto object representing the feature set job. - - :ivar created_date: Specifies the created date. - :vartype created_date: ~datetime.datetime - :ivar display_name: Specifies the display name. - :vartype display_name: str - :ivar duration: Specifies the duration. - :vartype duration: ~datetime.timedelta - :ivar experiment_id: Specifies the experiment id. - :vartype experiment_id: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specifies the job id. - :vartype job_id: str - :ivar status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar tags: A set of tags. Specifies the tags if any. - :vartype tags: dict[str, str] - :ivar type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - - _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'duration'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - created_date: Optional[datetime.datetime] = None, - display_name: Optional[str] = None, - duration: Optional[datetime.timedelta] = None, - experiment_id: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - status: Optional[Union[str, "JobStatus"]] = None, - tags: Optional[Dict[str, str]] = None, - type: Optional[Union[str, "FeaturestoreJobType"]] = None, - **kwargs - ): - """ - :keyword created_date: Specifies the created date. - :paramtype created_date: ~datetime.datetime - :keyword display_name: Specifies the display name. - :paramtype display_name: str - :keyword duration: Specifies the duration. - :paramtype duration: ~datetime.timedelta - :keyword experiment_id: Specifies the experiment id. - :paramtype experiment_id: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specifies the job id. - :paramtype job_id: str - :keyword status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :keyword tags: A set of tags. Specifies the tags if any. - :paramtype tags: dict[str, str] - :keyword type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = created_date - self.display_name = display_name - self.duration = duration - self.experiment_id = experiment_id - self.feature_window = feature_window - self.job_id = job_id - self.status = status - self.tags = tags - self.type = type - - -class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetJob entities. - - :ivar next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - super(FeaturesetJobArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = path - - -class FeaturesetVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.description = description - self.display_name = display_name - self.feature_window = feature_window - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - entities: Optional[List[str]] = None, - materialization_settings: Optional["MaterializationSettings"] = None, - specification: Optional["FeaturesetSpecification"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.entities = entities - self.materialization_settings = materialization_settings - self.provisioning_state = None - self.specification = specification - self.stage = stage - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - index_columns: Optional[List["IndexColumn"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.index_columns = index_columns - self.provisioning_state = None - self.stage = stage - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = compute_runtime - self.offline_store_connection_name = offline_store_connection_name - self.online_store_connection_name = online_store_connection_name - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - *, - features: List[str], - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = features - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = feature_window_end - self.feature_window_start = feature_window_start - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'file_system' # type: str - self.path = path - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["ForecastingTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - features_unknown_at_forecast_time: Optional[List[str]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.features_unknown_at_forecast_time = features_unknown_at_forecast_time - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpointsProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = properties - - -class FQDNEndpointsProperties(msrest.serialization.Model): - """FQDNEndpointsProperties. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - super(OutboundRule, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.status = status - self.category = category - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - name_node_address: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - hdfs_server_certificate: Optional[str] = None, - protocol: Optional[str] = "http", - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = hdfs_server_certificate - self.name_node_address = name_node_address - self.protocol = protocol - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = properties - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class IdentityForCmk(msrest.serialization.Model): - """Identity that will be used to access key vault for encryption at rest. - - :ivar user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = idle_time_before_shutdown - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - """ - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - } - - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = current_image_version - self.latest_image_version = latest_image_version - self.is_latest_os_image_version = is_latest_os_image_version - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_model = checkpoint_model - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - log_training_metrics: Optional[Union[str, "LogTrainingMetrics"]] = None, - log_validation_loss: Optional[Union[str, "LogValidationLoss"]] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.log_training_metrics = log_training_metrics - self.log_validation_loss = log_validation_loss - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - *, - data_import_definition: "DataImport", - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = data_import_definition - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = column_name - self.data_type = data_type - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - publisher: str, - protection_level: Optional[Union[str, "ProtectionLevel"]] = None, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = protection_level - self.publisher = publisher - - -class JobBase(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - docker_args: Optional[str] = None, - shm_size: Optional[str] = "2g", - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - self.docker_args = docker_args - self.shm_size = shm_size - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = job_definition - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["Nodes"] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.nodes = nodes - self.port = port - self.properties = properties - self.status = None - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosKeytabSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kerberos_keytab - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosPasswordSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kerberos_password - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.data_collector = data_collector - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: - :vartype primary_access_key: str - :ivar secondary_access_key: - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - :ivar user_storage_resource_id: - :vartype user_storage_resource_id: str - :ivar app_insights_instrumentation_key: - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - self.user_storage_resource_id = None - self.app_insights_instrumentation_key = None - self.container_registry_credentials = None - self.notebook_access_keys = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str - self.value = value - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = include_spark - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - :ivar spark_ready: - :vartype spark_ready: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - spark_ready: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - :keyword spark_ready: - :paramtype spark_ready: bool - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.status = status - self.spark_ready = spark_ready - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - - _validation = { - 'network_id': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - } - - def __init__( - self, - *, - isolation_mode: Optional[Union[str, "IsolationMode"]] = None, - outbound_rules: Optional[Dict[str, "OutboundRule"]] = None, - status: Optional["ManagedNetworkProvisionStatus"] = None, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = isolation_mode - self.network_id = None - self.outbound_rules = outbound_rules - self.status = status - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = instance_type - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - *, - notification: Optional["NotificationSetting"] = None, - resource: Optional["MaterializationComputeResource"] = None, - schedule: Optional["RecurrenceTrigger"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "MaterializationStoreType"]] = None, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = notification - self.resource = resource - self.schedule = schedule - self.spark_configuration = spark_configuration - self.store_type = store_type - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mlflow_model' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'mlflow_model' # type: str - self.description = description - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mltable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainer(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelPerformanceSignalBase(MonitoringSignalBase): - """ModelPerformanceSignalBase. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar target_data: Required. [Required] The data produced by the production service which drift - will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - *, - baseline_data: "MonitoringInputData", - metric_threshold: "ModelPerformanceMetricThresholdBase", - target_data: "MonitoringInputData", - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword target_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(ModelPerformanceSignalBase, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'ModelPerformanceSignalBase' # type: str - self.baseline_data = baseline_data - self.data_segment = data_segment - self.metric_threshold = metric_threshold - self.target_data = target_data - - -class ModelVersion(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.intellectual_property = intellectual_property - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.provisioning_state = None - self.stage = stage - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_setting: The monitor's notification settings. - :vartype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :ivar compute_id: Required. [Required] The ARM resource ID of the compute resource to run the - monitoring job on. - :vartype compute_id: str - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: str - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_setting': {'key': 'alertNotificationSetting', 'type': 'MonitoringAlertNotificationSettingsBase'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'str'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - *, - compute_id: str, - signals: Dict[str, "MonitoringSignalBase"], - alert_notification_setting: Optional["MonitoringAlertNotificationSettingsBase"] = None, - monitoring_target: Optional[str] = None, - **kwargs - ): - """ - :keyword alert_notification_setting: The monitor's notification settings. - :paramtype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :keyword compute_id: Required. [Required] The ARM resource ID of the compute resource to run - the monitoring job on. - :paramtype compute_id: str - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: str - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_setting = alert_notification_setting - self.compute_id = compute_id - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - *, - feature: Optional[str] = None, - values: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = feature - self.values = values - - -class MonitoringInputData(msrest.serialization.Model): - """MonitoringInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar asset: The data asset input to be leveraged by the monitoring job.. - :vartype asset: any - :ivar data_context: Required. [Required] The context of the data source. Possible values - include: "ModelInputs", "ModelOutputs", "Training", "Test", "Validation", "GroundTruth". - :vartype data_context: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataContext - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar target_column_name: The target column in the given data asset to leverage. - :vartype target_column_name: str - """ - - _validation = { - 'data_context': {'required': True}, - } - - _attribute_map = { - 'asset': {'key': 'asset', 'type': 'object'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_context: Union[str, "MonitoringInputDataContext"], - asset: Optional[Any] = None, - preprocessing_component_id: Optional[str] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword asset: The data asset input to be leveraged by the monitoring job.. - :paramtype asset: any - :keyword data_context: Required. [Required] The context of the data source. Possible values - include: "ModelInputs", "ModelOutputs", "Training", "Test", "Validation", "GroundTruth". - :paramtype data_context: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataContext - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword target_column_name: The target column in the given data asset to leverage. - :paramtype target_column_name: str - """ - super(MonitoringInputData, self).__init__(**kwargs) - self.asset = asset - self.data_context = data_context - self.preprocessing_component_id = preprocessing_component_id - self.target_column_name = target_column_name - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = value - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar host_name: - :vartype host_name: str - :ivar public_dns: - :vartype public_dns: str - :ivar access_token: - :vartype access_token: str - :ivar token_type: - :vartype token_type: str - :ivar expires_in: - :vartype expires_in: int - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - """ - - _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - } - - _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.notebook_resource_id = None - self.host_name = None - self.public_dns = None - self.access_token = None - self.token_type = None - self.expires_in = None - self.refresh_token = None - self.scope = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.resource_id = resource_id - self.notebook_preparation_error = notebook_preparation_error - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - self.webhooks = webhooks - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - artifact: "OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = artifact - self.endpoint = endpoint - self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class OutboundRuleBasicResource(Resource): - """Outbound Rule Basic Resource for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["OutboundRuleBasicResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_name: Optional[str] = None, - resource_version: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_name: Required. [Required] Target environment name to be generated by - package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_name: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - tags: Optional[Dict[str, str]] = None, - target_environment_version: Optional[str] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_name: Required. [Required] Target environment name to be generated - by package. - :paramtype target_environment_name: str - :keyword target_environment_version: Target environment version to be generated by package. - :paramtype target_environment_version: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.tags = tags - self.target_environment_name = target_environment_name - self.target_environment_version = target_environment_version - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - :ivar target_environment_name: Target environment name to be generated by package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - 'target_environment_name': {'readonly': True}, - 'target_environment_version': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.tags = None - self.target_environment_id = None - self.target_environment_name = None - self.target_environment_version = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = description - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Optional["PartialBatchDeployment"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - *, - notification_setting: Optional["PartialNotificationSetting"] = None, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = notification_setting - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - *, - properties: Optional["PartialJobBase"] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = properties - - -class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(PartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = tags - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentityAutoGenerated'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentityAutoGenerated"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) - self.sku = sku - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = webhooks - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - self.source_job_id = source_job_id - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :vartype lookback_period: ~datetime.timedelta - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar baseline_data: Required. [Required] The data to calculate drift against. - :vartype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar target_data: Required. [Required] The data which drift will be calculated for. - :vartype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - - _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, - } - - _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, - } - - def __init__( - self, - *, - baseline_data: "MonitoringInputData", - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - model_type: Union[str, "MonitoringModelType"], - target_data: "MonitoringInputData", - lookback_period: Optional[datetime.timedelta] = None, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - **kwargs - ): - """ - :keyword lookback_period: The amount of time a single monitor should look back over the target - data on a given run. - :paramtype lookback_period: ~datetime.timedelta - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword baseline_data: Required. [Required] The data to calculate drift against. - :paramtype baseline_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :keyword target_data: Required. [Required] The data which drift will be calculated for. - :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData - """ - super(PredictionDriftMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.baseline_data = baseline_data - self.metric_thresholds = metric_thresholds - self.model_type = model_type - self.target_data = target_data - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The ARM identifier for Subnet resource that private endpoint links to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class PrivateEndpointAutoGenerated(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpointAutoGenerated, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Possible values include: "Succeeded", "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = None - - -class PrivateEndpointConnectionAutoGenerated(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionStateAutoGenerated - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateAutoGenerated'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - group_ids: Optional[List[str]] = None, - private_endpoint: Optional["PrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionStateAutoGenerated"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionStateAutoGenerated - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(PrivateEndpointConnectionAutoGenerated, self).__init__(**kwargs) - self.id = id - self.location = location - self.group_ids = group_ids - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar subresource_target: - :vartype subresource_target: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - subresource_target: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword subresource_target: - :paramtype subresource_target: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Status of a managed network Outbound Rule of a machine learning - workspace. Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.subresource_target = subresource_target - self.spark_enabled = spark_enabled - self.spark_status = spark_status - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - - -class PrivateEndpointResource(PrivateEndpointAutoGenerated): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = subnet_arm_id - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.group_id = None - self.required_members = None - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, - description: Optional[str] = None, - actions_required: Optional[str] = None, - **kwargs - ): - """ - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :keyword description: The reason for approval/rejection of the connection. - :paramtype description: str - :keyword actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :paramtype actions_required: str - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = actions_required - - -class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - priority: Optional[int] = None, - **kwargs - ): - """ - :keyword job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - self.priority = priority - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = logbase - self.rule = rule - self.seed = seed - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - *, - address: Optional[str] = None, - dashboard_port: Optional[int] = None, - head_node_additional_args: Optional[str] = None, - include_dashboard: Optional[bool] = None, - port: Optional[int] = None, - worker_node_additional_args: Optional[str] = None, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = address - self.dashboard_port = dashboard_port - self.head_node_additional_args = head_node_additional_args - self.include_dashboard = include_dashboard - self.port = port - self.worker_node_additional_args = worker_node_additional_args - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "RecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "WeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.schedule = schedule - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionAutoGenerated] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionAutoGenerated]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - ml_flow_registry_uri: Optional[str] = None, - private_endpoint_connections: Optional[List["PrivateEndpointConnectionAutoGenerated"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :paramtype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionAutoGenerated] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.sku = sku - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.ml_flow_registry_uri = ml_flow_registry_uri - self.private_endpoint_connections = private_endpoint_connections - self.public_network_access = public_network_access - self.region_details = region_details - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: - :vartype location: str - :ivar username: - :vartype username: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.username = None - self.passwords = passwords - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - *, - acr_details: Optional[List["AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = acr_details - self.location = location - self.storage_account_details = storage_account_details - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Registry"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - training_settings: Optional["RegressionTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "RegressionModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Regression' # type: str - self.metric = metric - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = capture_headers - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class Schedule(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = properties - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "ScheduleStatus"]] = None, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = id - self.provisioning_status = provisioning_status - self.status = status - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - *, - action: "ScheduleActionBase", - trigger: "TriggerBase", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = True, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.action = action - self.display_name = display_name - self.is_enabled = is_enabled - self.provisioning_state = None - self.trigger = trigger - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Schedule"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - workspace_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = uri - self.workspace_secret_name = workspace_secret_name - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: The settings for the service managed cosmosdb account. - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: The settings for the service managed cosmosdb account. - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_tag: - :vartype service_tag: str - :ivar protocol: - :vartype protocol: str - :ivar port_ranges: - :vartype port_ranges: str - """ - - _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - } - - def __init__( - self, - *, - service_tag: Optional[str] = None, - protocol: Optional[str] = None, - port_ranges: Optional[str] = None, - **kwargs - ): - """ - :keyword service_tag: - :paramtype service_tag: str - :keyword protocol: - :paramtype protocol: str - :keyword port_ranges: - :paramtype port_ranges: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.service_tag = service_tag - self.protocol = protocol - self.port_ranges = port_ranges - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'ServiceTag' # type: str - self.destination = destination - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar private_link_resource_id: The resource id that private link links to. - :vartype private_link_resource_id: str - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - group_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword private_link_resource_id: The resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.private_link_resource_id = private_link_resource_id - self.group_id = group_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - *, - code_id: str, - entry: "SparkJobEntry", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - archives: Optional[List[str]] = None, - args: Optional[str] = None, - conf: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - files: Optional[List[str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jars: Optional[List[str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - py_files: Optional[List[str]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["SparkResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Spark' # type: str - self.archives = archives - self.args = args - self.code_id = code_id - self.conf = conf - self.entry = entry - self.environment_id = environment_id - self.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - self.queue_settings = queue_settings - self.resources = resources - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - *, - file: str, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = file - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - *, - class_name: str, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = class_name - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = "3.1", - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = system_created_storage_account - self.user_created_storage_account = user_created_storage_account - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.queue_settings = queue_settings - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = acr_account_name - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = allow_blob_public_access - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_name = storage_account_name - self.storage_account_type = storage_account_type - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = size - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = top - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = inference_configuration - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'triton_model' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'triton_model' # type: str - self.description = description - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_file' # type: str - self.description = description - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_file' # type: str - self.description = description - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_folder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_folder' # type: str - self.description = description - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar expiry_time: - :vartype expiry_time: str - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - expiry_time: Optional[str] = None, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword expiry_time: - :paramtype expiry_time: str - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = properties - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled", "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.notebook_server_port = notebook_server_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = administrator_account - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) - self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "VolumeDefinitionType"]] = "bind", - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["BindOptions"] = None, - volume: Optional["VolumeOptions"] = None, - tmpfs: Optional["TmpfsOptions"] = None, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = type - self.read_only = read_only - self.source = source - self.target = target - self.consistency = consistency - self.bind = bind - self.volume = volume - self.tmpfs = tmpfs - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = nocopy - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar kind: - :vartype kind: str - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled", - "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar encryption: The encryption settings of Azure ML workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: str - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar enable_data_isolation: A flag to determine if workspace has data isolation enabled. The - flag can only be set at the creation phase, it can't be updated. - :vartype enable_data_isolation: bool - :ivar storage_accounts: : A list of storage accounts used by Hub. - :vartype storage_accounts: list[str] - :ivar key_vaults: A list of key vaults used by Hub. - :vartype key_vaults: list[str] - :ivar container_registries: A list of container registries used by Hub. - :vartype container_registries: list[str] - :ivar existing_workspaces: A list of existing workspaces used by Hub to perform convert. - :vartype existing_workspaces: list[str] - :ivar hub_resource_id: Resource Id of Hub used for lean workspace. - :vartype hub_resource_id: str - :ivar associated_workspaces: A list of lean workspaces associated with Hub. - :vartype associated_workspaces: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - 'associated_workspaces': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - kind: Optional[str] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - key_vault: Optional[str] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - storage_account: Optional[str] = None, - discovery_url: Optional[str] = None, - encryption: Optional["EncryptionProperty"] = None, - hbi_workspace: Optional[bool] = False, - image_build_compute: Optional[str] = None, - allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - v1_legacy_mode: Optional[bool] = False, - system_datastores_auth_mode: Optional[str] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - enable_data_isolation: Optional[bool] = False, - storage_accounts: Optional[List[str]] = None, - key_vaults: Optional[List[str]] = None, - container_registries: Optional[List[str]] = None, - existing_workspaces: Optional[List[str]] = None, - hub_resource_id: Optional[str] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword kind: - :paramtype kind: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword encryption: The encryption settings of Azure ML workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword enable_data_isolation: A flag to determine if workspace has data isolation enabled. - The flag can only be set at the creation phase, it can't be updated. - :paramtype enable_data_isolation: bool - :keyword storage_accounts: : A list of storage accounts used by Hub. - :paramtype storage_accounts: list[str] - :keyword key_vaults: A list of key vaults used by Hub. - :paramtype key_vaults: list[str] - :keyword container_registries: A list of container registries used by Hub. - :paramtype container_registries: list[str] - :keyword existing_workspaces: A list of existing workspaces used by Hub to perform convert. - :paramtype existing_workspaces: list[str] - :keyword hub_resource_id: Resource Id of Hub used for lean workspace. - :paramtype hub_resource_id: str - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.kind = kind - self.workspace_id = None - self.description = description - self.friendly_name = friendly_name - self.key_vault = key_vault - self.application_insights = application_insights - self.container_registry = container_registry - self.storage_account = storage_account - self.discovery_url = discovery_url - self.provisioning_state = None - self.encryption = encryption - self.hbi_workspace = hbi_workspace - self.service_provisioned_resource_group = None - self.private_link_count = None - self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.public_network_access = public_network_access - self.private_endpoint_connections = None - self.shared_private_link_resources = shared_private_link_resources - self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings - self.primary_user_assigned_identity = primary_user_assigned_identity - self.tenant_id = None - self.storage_hns_enabled = None - self.ml_flow_tracking_uri = None - self.v1_legacy_mode = v1_legacy_mode - self.soft_deleted_at = None - self.scheduled_purge_date = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.feature_store_settings = feature_store_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.enable_data_isolation = enable_data_isolation - self.storage_accounts = storage_accounts - self.key_vaults = key_vaults - self.container_registries = container_registries - self.existing_workspaces = existing_workspaces - self.hub_resource_id = hub_resource_id - self.associated_workspaces = None - self.managed_network = managed_network - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = access_key_id - self.secret_access_key = secret_access_key - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar resource_id: - :vartype resource_id: str - :ivar client_id: - :vartype client_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: - :paramtype resource_id: str - :keyword client_id: - :paramtype client_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = resource_id - self.client_id = client_id - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - :ivar next_link: - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar username: - :vartype username: str - :ivar password: - :vartype password: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - **kwargs - ): - """ - :keyword username: - :paramtype username: str - :keyword password: - :paramtype password: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = username - self.password = password - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :ivar next_link: The URI that can be used to request the next list of machine learning - workspaces. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Workspace"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :keyword next_link: The URI that can be used to request the next list of machine learning - workspaces. - :paramtype next_link: str - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar encryption: The encryption settings of the workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword encryption: The encryption settings of the workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.sku = sku - self.identity = identity - self.description = description - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.application_insights = application_insights - self.container_registry = container_registry - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.managed_network = managed_network diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py deleted file mode 100644 index da26b6af19e9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 61809ba1df5b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,876 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index 690cef4edfcc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index c9be77b371a3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index dac3b837a4ac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - hash = kwargs.pop('hash', None) # type: Optional[str] - hash_version = kwargs.pop('hash_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if hash is not None: - _query_parameters['hash'] = _SERIALIZER.query("hash", hash, 'str') - if hash_version is not None: - _query_parameters['hashVersion'] = _SERIALIZER.query("hash_version", hash_version, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - hash=None, # type: Optional[str] - hash_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 6d03db42ab21..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 9010e1a9b7ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,568 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - if list_view_type is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - stage=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py deleted file mode 100644 index 83e86f5f2f16..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1718 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_custom_services_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_idle_shutdown_setting_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - custom_services, # type: List["_models.CustomService"] - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace - def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace - def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace - def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.IdleShutdownSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 3be472641815..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index d10d6de821a0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,580 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - if list_view_type is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - stage=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param stage: data stage. - :type stage: str - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - stage=stage, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - stage=stage, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py deleted file mode 100644 index f86652b9db0b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - _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') - if order_by is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Datastore" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index c65ab9b7488f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 3ece2a07625d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,560 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py deleted file mode 100644 index cb76b26216a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,342 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - feature_name = kwargs.pop('feature_name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if feature_name is not None: - _query_parameters['featureName'] = _SERIALIZER.query("feature_name", feature_name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - "featureName": _SERIALIZER.url("feature_name", feature_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - feature_name=None, # type: Optional[str] - description=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureResourceArmPaginatedResult"] - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Feature" - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index ea24d924bdb0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetContainersOperations(object): - """FeaturesetContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 06f3a36ed905..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,1097 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_backfill_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_materialization_jobs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - filters = kwargs.pop('filters', None) # type: Optional[str] - feature_window_start = kwargs.pop('feature_window_start', None) # type: Optional[str] - feature_window_end = kwargs.pop('feature_window_end', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if filters is not None: - _query_parameters['filters'] = _SERIALIZER.query("filters", filters, 'str') - if feature_window_start is not None: - _query_parameters['featureWindowStart'] = _SERIALIZER.query("feature_window_start", feature_window_start, 'str') - if feature_window_end is not None: - _query_parameters['featureWindowEnd'] = _SERIALIZER.query("feature_window_end", feature_window_end, 'str') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class FeaturesetVersionsOperations(object): - """FeaturesetVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - def _backfill_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.FeaturesetJob"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetJob', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace - def begin_backfill( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetJob"] - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - @distributed_trace - def list_materialization_jobs( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - skip=None, # type: Optional[str] - filters=None, # type: Optional[str] - feature_window_start=None, # type: Optional[str] - feature_window_end=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetJobArmPaginatedResult"] - """List materialization Jobs. - - List materialization Jobs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param skip: Continuation token for pagination. - :type skip: str - :param filters: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type filters: str - :param feature_window_start: Start time of the feature window to filter materialization jobs. - :type feature_window_start: str - :param feature_window_end: End time of the feature window to filter materialization jobs. - :type feature_window_end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetJobArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_materialization_jobs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_materialization_jobs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - # ---------------------- PATCH ---------------------- - # NOTE: List materialization jobs api does not support GET method, so we need to change it to POST - # It is temporary update, WIP: Update autorest client version and patch this method in patch.py file - request.method = "POST" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 43a5169aa1e6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityContainersOperations(object): - """FeaturestoreEntityContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 9cce577474ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityVersionsOperations(object): - """FeaturestoreEntityVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py deleted file mode 100644 index cd8858df2038..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,894 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - asset_name = kwargs.pop('asset_name', None) # type: Optional[str] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - _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') - if asset_name is not None: - _query_parameters['assetName'] = _SERIALIZER.query("asset_name", asset_name, 'str') - if scheduled is not None: - _query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') - if schedule_id is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_cancel_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - asset_name=None, # type: Optional[str] - scheduled=None, # type: Optional[bool] - schedule_id=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.PartialJobBasePartialResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Creates and executes a Job. - - Creates and executes a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index 006fffb6840d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1044 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - include_job_instructions = kwargs.pop('include_job_instructions', False) # type: Optional[bool] - include_label_categories = kwargs.pop('include_label_categories', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - if include_job_instructions is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_export_labels_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_pause_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resume_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - include_job_instructions=False, # type: Optional[bool] - include_label_categories=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index dbc35f4526fa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,231 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_provision_managed_network_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkProvisionsOperations(object): - """ManagedNetworkProvisionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _provision_managed_network_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: Managed Network Provisioning Options for a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 5e2d99cd841d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,619 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkSettingsRuleOperations(object): - """ManagedNetworkSettingsRuleOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundRuleListResult"] - """Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OutboundRuleBasicResource" - """Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - parameters, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - parameters, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OutboundRuleBasicResource"] - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param parameters: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OutboundRuleBasicResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 3583fc0e62fe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index 47b137841c9e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,812 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - _query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - if list_view_type is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - stage=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param stage: Model stage. - :type stage: 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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - stage=stage, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - stage=stage, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - def _package_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 84a163032709..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index f3458a04fabd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py deleted file mode 100644 index ef0b65c585cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py +++ /dev/null @@ -1,154 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlOperationListResult"] - """Lists all of the available Azure Machine Learning Services REST API operations. - - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index e4ce46ecb19f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,494 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - resource_group_name, # type: str - workspace_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """List all the private endpoint connections associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Gets the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - properties, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Update the state of specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. - :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(properties, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - 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/v2023_04_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index c13425cdef8d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourceListResult" - """Gets the private link resources that need to be created for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py deleted file mode 100644 index ac8bb99ca560..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py deleted file mode 100644 index 33398eca3844..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_remove_regions_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") # 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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistriesOperations(object): - """RegistriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _remove_regions_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 0caee1df1a46..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,636 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeContainersOperations(object): - """RegistryCodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeContainer"] - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 53144ca64e30..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,802 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeVersionsOperations(object): - """RegistryCodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index d8975ff219a0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentContainersOperations(object): - """RegistryComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 8f84ea82e58f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentVersionsOperations(object): - """RegistryComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index 0237381925bd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataContainersOperations(object): - """RegistryDataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index 536d6f88e4b4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataVersionsOperations(object): - """RegistryDataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataVersionBase"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 23e6dba4017d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentContainersOperations(object): - """RegistryEnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 3ea0d1f3b707..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentVersionsOperations(object): - """RegistryEnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index eb9811f792f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelContainersOperations(object): - """RegistryModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainer"] - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index 6aba5938e165..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,844 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelVersionsOperations(object): - """RegistryModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 7dace1082eff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,643 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ScheduleListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SchedulesOperations(object): - """SchedulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ScheduleListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ScheduleResourceArmPaginatedResult"] - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Schedule"] - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Schedule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py deleted file mode 100644 index 37c8eefe0683..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index efddf3efc71b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 0546d4e3efe1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,508 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - parameters, # type: "_models.WorkspaceConnectionPropertiesV2BasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """create. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param parameters: The object for creating or updating a new workspace connection. - :type parameters: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """get. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """list. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 20ea19c98489..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index c43747df09c5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1857 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - force_to_purge = kwargs.pop('force_to_purge', None) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if force_to_purge is not None: - _query_parameters['forceToPurge'] = _SERIALIZER.query("force_to_purge", force_to_purge, 'bool') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - kind = kwargs.pop('kind', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - kind = kwargs.pop('kind', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for creating or updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - skip=None, # type: Optional[str] - kind=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - kind=kind, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - kind=kind, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameter of diagnosing workspace health. - :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace - def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_by_subscription( - self, - skip=None, # type: Optional[str] - kind=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - kind=kind, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - kind=kind, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """return notebook access token and refresh token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """List storage account keys of a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """List keys of a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_04_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index f5adaab7177f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,288 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapacityReservationGroupsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations - :vartype capacity_reservation_groups: - azure.mgmt.machinelearningservices.operations.CapacityReservationGroupsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.operations.RegistryDataVersionsOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2023-08-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.capacity_reservation_groups = CapacityReservationGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_configuration.py deleted file mode 100644 index c5e20f8e1edd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2023-08-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_patch.py deleted file mode 100644 index f99e77fef986..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 86ec9243790f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,285 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -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 .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapacityReservationGroupsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.aio.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :ivar capacity_reservation_groups: CapacityReservationGroupsOperations operations - :vartype capacity_reservation_groups: - azure.mgmt.machinelearningservices.aio.operations.CapacityReservationGroupsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataVersionsOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.aio.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.aio.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.aio.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.aio.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.aio.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2023-08-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.capacity_reservation_groups = CapacityReservationGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_configuration.py deleted file mode 100644 index 9bb8f30ba250..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -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 - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :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 "2023-08-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_patch.py deleted file mode 100644 index f99e77fef986..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/__init__.py deleted file mode 100644 index bec69c6b6538..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'CapacityReservationGroupsOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 2a2a82cfbe6d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,642 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeployment": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index c8214b7dab81..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpoint": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_capacity_reservation_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_capacity_reservation_groups_operations.py deleted file mode 100644 index 51a7cb65725b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_capacity_reservation_groups_operations.py +++ /dev/null @@ -1,460 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._capacity_reservation_groups_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_subscription_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CapacityReservationGroupsOperations: - """CapacityReservationGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"]: - """list_by_subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"]: - """list. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - group_id: str, - **kwargs: Any - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - group_id: str, - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """get. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - group_id: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :param body: - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - group_id: str, - body: "_models.CapacityReservationGroup", - **kwargs: Any - ) -> "_models.CapacityReservationGroup": - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapacityReservationGroup') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index 50d790f76259..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 04e125b60ec4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,453 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 70e2ded30ad2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 69413b02faad..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,376 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index 7ef45eab5a6d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1397 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_allowed_resize_sizes_request, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_resize_request_initial, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List["_models.CustomService"], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.IdleShutdownSetting", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get_allowed_resize_sizes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - async def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace_async - async def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index e6f2a968207b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index 3835c9addda0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,385 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param stage: data stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 5013f852d334..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Datastore": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Datastore", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.Datastore": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 04798e327552..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index a48745f8d383..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,377 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index 02850fab89ac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,247 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesOperations: - """FeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 1000, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureResourceArmPaginatedResult"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :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 - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> "_models.Feature": - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index a407efebb072..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetContainersOperations: - """FeaturesetContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturesetContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index b882a3bb2303..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,672 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetVersionsOperations: - """FeaturesetVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturesetVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> Optional["_models.FeaturesetVersionBackfillResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersionBackfillResponse"]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersionBackfillResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index c1dd1a35002f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityContainersOperations: - """FeaturestoreEntityContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityContainer or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index ad61a61c06bf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityVersionsOperations: - """FeaturestoreEntityVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_endpoints_operations.py deleted file mode 100644 index 309208c435ce..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,654 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceEndpointsOperations: - """InferenceEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"]: - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.InferenceEndpoint": - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> Optional["_models.InferenceEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> "_models.InferenceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_groups_operations.py deleted file mode 100644 index 0654c3d59f42..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_groups_operations.py +++ /dev/null @@ -1,829 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceGroupsOperations: - """InferenceGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"]: - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.InferenceGroup": - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.InferenceGroup"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> "_models.InferenceGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.GroupStatus": - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_pools_operations.py deleted file mode 100644 index b4166b0e6017..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_inference_pools_operations.py +++ /dev/null @@ -1,794 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferencePoolsOperations: - """InferencePoolsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferencePoolTrackedResourceArmPaginatedResult"]: - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.InferencePool": - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.InferencePool"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> "_models.InferencePool": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.PoolStatus": - """Retrieve inference pool status. - - Retrieve inference pool status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PoolStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PoolStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PoolStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PoolStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Pool Skus. - - List Inference Pool Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Inference Group name. - :type inference_pool_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 9480e9d2172f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,625 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - asset_name: Optional[str] = None, - scheduled: Optional[bool] = None, - schedule_id: Optional[str] = None, - properties: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - properties=properties, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - properties=properties, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBase": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.PartialJobBasePartialResource", - **kwargs: Any - ) -> "_models.JobBase": - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBase", - **kwargs: Any - ) -> "_models.JobBase": - """Creates and executes a Job. - - Creates and executes a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index 3f8f9d4488ab..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,746 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def pause( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.LabelingJobProperties": - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJobProperties, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> Optional["_models.LabelingJobProperties"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LabelingJobProperties"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _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( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJobProperties"]: - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LabelingJobProperties or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJobProperties] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index a36d2f958d51..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkProvisionsOperations: - """ManagedNetworkProvisionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index d24e7567afc6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,458 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkSettingsRuleOperations: - """ManagedNetworkSettingsRuleOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.OutboundRuleListResult"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.OutboundRuleBasicResource": - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OutboundRuleBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 8fef60838663..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,349 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index d314037266ce..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,556 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :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 - :param stage: Model stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - async def _package_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index 877796a6e655..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeployment": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index b95fc31a9339..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,897 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpoint": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_operations.py deleted file mode 100644 index 0e348dc0d0a3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 4bff59b5151c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,332 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.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/v2023_08_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 2774a621fff5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,143 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - 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/v2023_08_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index cbdcb997b5f3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,186 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -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 -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 67f9f3224f7a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistriesOperations: - """RegistriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.Registry": - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> "_models.Registry": - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index a7976b446a01..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeContainersOperations: - """RegistryCodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeContainer"]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index b9b13890f351..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeVersionsOperations: - """RegistryCodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 752789358531..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentContainersOperations: - """RegistryComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 295f0c1d0bcc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentVersionsOperations: - """RegistryComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index f3d04e67a3c4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataContainersOperations: - """RegistryDataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index 8e594e18e8dc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataVersionsOperations: - """RegistryDataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataVersionBase"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 850199c61975..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentContainersOperations: - """RegistryEnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index a7a29c7ad4f4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,505 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentVersionsOperations: - """RegistryEnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index ceadc7c24b8a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelContainersOperations: - """RegistryModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainer"]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index 0b28a2fe9613..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelVersionsOperations: - """RegistryModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - async def _package_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._package_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index 0c5772599e20..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,467 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchedulesOperations: - """SchedulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Schedule": - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> AsyncLROPoller["_models.Schedule"]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Schedule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 2ef38550bd60..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,875 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._serverless_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_status_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ServerlessEndpointsOperations: - """ServerlessEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.ServerlessEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> Optional["_models.EndpointAuthKeys"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointAuthKeys"]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpointStatus": - """Status of the model backing the Serverless Endpoint. - - Status of the model backing the Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpointStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpointStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 7ba60ed7a96f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 9c3958cce441..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 926f5a08d86b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,626 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, build_test_connection_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - aoai_models_to_deploy: Optional[str] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionUpdateParameter"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - aoai_models_to_deploy: Optional[str] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - async def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace_async - async def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index b954b17e68a6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,129 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 3a6d46f02825..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1347 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind: Optional[str] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - kind: Optional[str] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: 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: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _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( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/__init__.py deleted file mode 100644 index 0a8dd043f9c8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/__init__.py +++ /dev/null @@ -1,2211 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AKS - from ._models_py3 import AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AcrDetails - from ._models_py3 import ActualCapacityInfo - from ._models_py3 import AksComputeSecrets - from ._models_py3 import AksComputeSecretsProperties - from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AllFeatures - from ._models_py3 import AllNodes - from ._models_py3 import AmlCompute - from ._models_py3 import AmlComputeNodeInformation - from ._models_py3 import AmlComputeNodesInformation - from ._models_py3 import AmlComputeProperties - from ._models_py3 import AmlComputeSchema - from ._models_py3 import AmlToken - from ._models_py3 import AmlTokenComputeIdentity - from ._models_py3 import AmlUserFeature - from ._models_py3 import ApiKeyAuthWorkspaceConnectionProperties - from ._models_py3 import ArmResourceId - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AssignedUser - from ._models_py3 import AutoDeleteSetting - from ._models_py3 import AutoForecastHorizon - from ._models_py3 import AutoMLJob - from ._models_py3 import AutoMLVertical - from ._models_py3 import AutoNCrossValidations - from ._models_py3 import AutoPauseProperties - from ._models_py3 import AutoScaleProperties - from ._models_py3 import AutoSeasonality - from ._models_py3 import AutoTargetLags - from ._models_py3 import AutoTargetRollingWindowSize - from ._models_py3 import AutologgerSettings - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureDevOpsWebhook - from ._models_py3 import AzureFileDatastore - from ._models_py3 import AzureMLBatchInferencingServer - from ._models_py3 import AzureMLOnlineInferencingServer - from ._models_py3 import BanditPolicy - from ._models_py3 import BaseEnvironmentId - from ._models_py3 import BaseEnvironmentSource - from ._models_py3 import BatchDeployment - from ._models_py3 import BatchDeploymentConfiguration - from ._models_py3 import BatchDeploymentProperties - from ._models_py3 import BatchDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import BatchEndpoint - from ._models_py3 import BatchEndpointDefaults - from ._models_py3 import BatchEndpointProperties - from ._models_py3 import BatchEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import BatchPipelineComponentDeploymentConfiguration - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BlobReferenceForConsumptionDto - from ._models_py3 import BuildContext - from ._models_py3 import CapacityReservationGroup - from ._models_py3 import CapacityReservationGroupProperties - from ._models_py3 import CapacityReservationGroupTrackedResourceArmPaginatedResult - from ._models_py3 import CategoricalDataDriftMetricThreshold - from ._models_py3 import CategoricalDataQualityMetricThreshold - from ._models_py3 import CategoricalPredictionDriftMetricThreshold - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import Classification - from ._models_py3 import ClassificationModelPerformanceMetricThreshold - from ._models_py3 import ClassificationTrainingSettings - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import CocoExportSummary - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainer - from ._models_py3 import CodeContainerProperties - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersion - from ._models_py3 import CodeVersionProperties - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import Collection - from ._models_py3 import ColumnTransformer - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentConfiguration - from ._models_py3 import ComponentContainer - from ._models_py3 import ComponentContainerProperties - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentVersion - from ._models_py3 import ComponentVersionProperties - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import Compute - from ._models_py3 import ComputeInstance - from ._models_py3 import ComputeInstanceApplication - from ._models_py3 import ComputeInstanceAutologgerSettings - from ._models_py3 import ComputeInstanceConnectivityEndpoints - from ._models_py3 import ComputeInstanceContainer - from ._models_py3 import ComputeInstanceCreatedBy - from ._models_py3 import ComputeInstanceDataDisk - from ._models_py3 import ComputeInstanceDataMount - from ._models_py3 import ComputeInstanceEnvironmentInfo - from ._models_py3 import ComputeInstanceLastOperation - from ._models_py3 import ComputeInstanceProperties - from ._models_py3 import ComputeInstanceSchema - from ._models_py3 import ComputeInstanceSshSettings - from ._models_py3 import ComputeInstanceVersion - from ._models_py3 import ComputeRecurrenceSchedule - from ._models_py3 import ComputeResource - from ._models_py3 import ComputeResourceSchema - from ._models_py3 import ComputeRuntimeDto - from ._models_py3 import ComputeSchedules - from ._models_py3 import ComputeSecrets - from ._models_py3 import ComputeStartStopSchedule - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import ContainerResourceSettings - from ._models_py3 import CosmosDbSettings - from ._models_py3 import CreateMonitorAction - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomInferencingServer - from ._models_py3 import CustomKeys - from ._models_py3 import CustomKeysWorkspaceConnectionProperties - from ._models_py3 import CustomMetricThreshold - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import CustomMonitoringSignal - from ._models_py3 import CustomNCrossValidations - from ._models_py3 import CustomSeasonality - from ._models_py3 import CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataCollector - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataDriftMetricThresholdBase - from ._models_py3 import DataDriftMonitoringSignal - from ._models_py3 import DataFactory - from ._models_py3 import DataImport - from ._models_py3 import DataImportSource - from ._models_py3 import DataLakeAnalytics - from ._models_py3 import DataLakeAnalyticsSchema - from ._models_py3 import DataLakeAnalyticsSchemaProperties - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataQualityMetricThresholdBase - from ._models_py3 import DataQualityMonitoringSignal - from ._models_py3 import DataVersionBase - from ._models_py3 import DataVersionBaseProperties - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import DatabaseSource - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksComputeSecretsProperties - from ._models_py3 import DatabricksProperties - from ._models_py3 import DatabricksSchema - from ._models_py3 import DatasetExportSummary - from ._models_py3 import Datastore - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreProperties - from ._models_py3 import DatastoreResourceArmPaginatedResult - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DefaultScaleSettings - from ._models_py3 import DeploymentLogs - from ._models_py3 import DeploymentLogsRequest - from ._models_py3 import DeploymentResourceConfiguration - from ._models_py3 import DiagnoseRequestProperties - from ._models_py3 import DiagnoseResponseResult - from ._models_py3 import DiagnoseResponseResultValue - from ._models_py3 import DiagnoseResult - from ._models_py3 import DiagnoseWorkspaceParameters - from ._models_py3 import DistributionConfiguration - from ._models_py3 import Docker - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultUpdateProperties - from ._models_py3 import EncryptionProperty - from ._models_py3 import EncryptionUpdateProperties - from ._models_py3 import Endpoint - from ._models_py3 import EndpointAuthKeys - from ._models_py3 import EndpointAuthToken - from ._models_py3 import EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - from ._models_py3 import EndpointScheduleAction - from ._models_py3 import EnvironmentContainer - from ._models_py3 import EnvironmentContainerProperties - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVariable - from ._models_py3 import EnvironmentVersion - from ._models_py3 import EnvironmentVersionProperties - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import EstimatedVMPrice - from ._models_py3 import EstimatedVMPrices - from ._models_py3 import ExportSummary - from ._models_py3 import ExternalFQDNResponse - from ._models_py3 import FQDNEndpoint - from ._models_py3 import FQDNEndpointDetail - from ._models_py3 import FQDNEndpoints - from ._models_py3 import FQDNEndpointsPropertyBag - from ._models_py3 import Feature - from ._models_py3 import FeatureAttributionDriftMonitoringSignal - from ._models_py3 import FeatureAttributionMetricThreshold - from ._models_py3 import FeatureImportanceSettings - from ._models_py3 import FeatureProperties - from ._models_py3 import FeatureResourceArmPaginatedResult - from ._models_py3 import FeatureStoreSettings - from ._models_py3 import FeatureSubset - from ._models_py3 import FeatureWindow - from ._models_py3 import FeaturesetContainer - from ._models_py3 import FeaturesetContainerProperties - from ._models_py3 import FeaturesetContainerResourceArmPaginatedResult - from ._models_py3 import FeaturesetSpecification - from ._models_py3 import FeaturesetVersion - from ._models_py3 import FeaturesetVersionBackfillRequest - from ._models_py3 import FeaturesetVersionBackfillResponse - from ._models_py3 import FeaturesetVersionProperties - from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityContainer - from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityVersion - from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult - from ._models_py3 import FeaturizationSettings - from ._models_py3 import FileSystemSource - from ._models_py3 import FixedInputData - from ._models_py3 import FlavorData - from ._models_py3 import ForecastHorizon - from ._models_py3 import Forecasting - from ._models_py3 import ForecastingSettings - from ._models_py3 import ForecastingTrainingSettings - from ._models_py3 import FqdnOutboundRule - from ._models_py3 import GenerationSafetyQualityMetricThreshold - from ._models_py3 import GenerationSafetyQualityMonitoringSignal - from ._models_py3 import GenerationTokenUsageMetricThreshold - from ._models_py3 import GenerationTokenUsageSignal - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import GroupStatus - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import IdentityForCmk - from ._models_py3 import IdleShutdownSetting - from ._models_py3 import Image - from ._models_py3 import ImageClassification - from ._models_py3 import ImageClassificationBase - from ._models_py3 import ImageClassificationMultilabel - from ._models_py3 import ImageInstanceSegmentation - from ._models_py3 import ImageLimitSettings - from ._models_py3 import ImageMetadata - from ._models_py3 import ImageModelDistributionSettings - from ._models_py3 import ImageModelDistributionSettingsClassification - from ._models_py3 import ImageModelDistributionSettingsObjectDetection - from ._models_py3 import ImageModelSettings - from ._models_py3 import ImageModelSettingsClassification - from ._models_py3 import ImageModelSettingsObjectDetection - from ._models_py3 import ImageObjectDetection - from ._models_py3 import ImageObjectDetectionBase - from ._models_py3 import ImageSweepSettings - from ._models_py3 import ImageVertical - from ._models_py3 import ImportDataAction - from ._models_py3 import IndexColumn - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InferenceEndpoint - from ._models_py3 import InferenceEndpointProperties - from ._models_py3 import InferenceEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import InferenceGroup - from ._models_py3 import InferenceGroupProperties - from ._models_py3 import InferenceGroupTrackedResourceArmPaginatedResult - from ._models_py3 import InferencePool - from ._models_py3 import InferencePoolProperties - from ._models_py3 import InferencePoolTrackedResourceArmPaginatedResult - from ._models_py3 import InferencingServer - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import IntellectualProperty - from ._models_py3 import JobBase - from ._models_py3 import JobBaseProperties - from ._models_py3 import JobBaseResourceArmPaginatedResult - from ._models_py3 import JobInput - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobResourceConfiguration - from ._models_py3 import JobScheduleAction - from ._models_py3 import JobService - from ._models_py3 import JupyterKernelConfig - from ._models_py3 import KerberosCredentials - from ._models_py3 import KerberosKeytabCredentials - from ._models_py3 import KerberosKeytabSecrets - from ._models_py3 import KerberosPasswordCredentials - from ._models_py3 import KerberosPasswordSecrets - from ._models_py3 import KeyVaultProperties - from ._models_py3 import Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - from ._models_py3 import LakeHouseArtifact - from ._models_py3 import ListAmlUserFeatureResult - from ._models_py3 import ListNotebookKeysResult - from ._models_py3 import ListStorageAccountKeysResult - from ._models_py3 import ListUsagesResult - from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import ListWorkspaceQuotas - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableData - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import ManagedComputeIdentity - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelConfiguration - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelPackageInput - from ._models_py3 import ModelPerformanceMetricThresholdBase - from ._models_py3 import ModelPerformanceSignal - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import MonitorComputeConfigurationBase - from ._models_py3 import MonitorComputeIdentityBase - from ._models_py3 import MonitorDefinition - from ._models_py3 import MonitorEmailNotificationSettings - from ._models_py3 import MonitorNotificationSettings - from ._models_py3 import MonitorServerlessSparkCompute - from ._models_py3 import MonitoringDataSegment - from ._models_py3 import MonitoringFeatureFilterBase - from ._models_py3 import MonitoringInputDataBase - from ._models_py3 import MonitoringSignalBase - from ._models_py3 import MonitoringTarget - from ._models_py3 import MonitoringThreshold - from ._models_py3 import MonitoringWorkspaceConnection - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - from ._models_py3 import NlpVertical - from ._models_py3 import NlpVerticalFeaturizationSettings - from ._models_py3 import NlpVerticalLimitSettings - from ._models_py3 import NodeStateCounts - from ._models_py3 import Nodes - from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import NotebookAccessTokenResult - from ._models_py3 import NotebookPreparationError - from ._models_py3 import NotebookResourceInfo - from ._models_py3 import NotificationSetting - from ._models_py3 import NumericalDataDriftMetricThreshold - from ._models_py3 import NumericalDataQualityMetricThreshold - from ._models_py3 import NumericalPredictionDriftMetricThreshold - from ._models_py3 import Objective - from ._models_py3 import OneLakeArtifact - from ._models_py3 import OneLakeDatastore - from ._models_py3 import OnlineDeployment - from ._models_py3 import OnlineDeploymentProperties - from ._models_py3 import OnlineDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineEndpoint - from ._models_py3 import OnlineEndpointProperties - from ._models_py3 import OnlineEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineInferenceConfiguration - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OsPatchingStatus - from ._models_py3 import OutboundRule - from ._models_py3 import OutboundRuleBasicResource - from ._models_py3 import OutboundRuleListResult - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PackageInputPathBase - from ._models_py3 import PackageInputPathId - from ._models_py3 import PackageInputPathUrl - from ._models_py3 import PackageInputPathVersion - from ._models_py3 import PackageRequest - from ._models_py3 import PackageResponse - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - from ._models_py3 import PartialJobBase - from ._models_py3 import PartialJobBasePartialResource - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialMinimalTrackedResource - from ._models_py3 import PartialMinimalTrackedResourceWithIdentity - from ._models_py3 import PartialMinimalTrackedResourceWithSku - from ._models_py3 import PartialMinimalTrackedResourceWithSkuAndIdentity - from ._models_py3 import PartialNotificationSetting - from ._models_py3 import PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PendingUploadCredentialDto - from ._models_py3 import PendingUploadRequestDto - from ._models_py3 import PendingUploadResponseDto - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - from ._models_py3 import PoolEnvironmentConfiguration - from ._models_py3 import PoolModelConfiguration - from ._models_py3 import PoolStatus - from ._models_py3 import PredictionDriftMetricThresholdBase - from ._models_py3 import PredictionDriftMonitoringSignal - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateEndpointDestination - from ._models_py3 import PrivateEndpointOutboundRule - from ._models_py3 import PrivateEndpointResource - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import ProbeSettings - from ._models_py3 import ProgressMetrics - from ._models_py3 import PropertiesBase - from ._models_py3 import ProxyResource - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import Ray - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryPartialManagedServiceIdentity - from ._models_py3 import RegistryPrivateEndpointConnection - from ._models_py3 import RegistryPrivateLinkServiceConnectionState - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionModelPerformanceMetricThreshold - from ._models_py3 import RegressionTrainingSettings - from ._models_py3 import RequestConfiguration - from ._models_py3 import RequestLogging - from ._models_py3 import ResizeSchema - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import ResourceId - from ._models_py3 import ResourceName - from ._models_py3 import ResourceQuota - from ._models_py3 import RollingInputData - from ._models_py3 import Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - from ._models_py3 import SASCredentialDto - from ._models_py3 import SamplingAlgorithm - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ScaleSettings - from ._models_py3 import ScaleSettingsInformation - from ._models_py3 import Schedule - from ._models_py3 import ScheduleActionBase - from ._models_py3 import ScheduleBase - from ._models_py3 import ScheduleProperties - from ._models_py3 import ScheduleResourceArmPaginatedResult - from ._models_py3 import ScriptReference - from ._models_py3 import ScriptsToExecute - from ._models_py3 import Seasonality - from ._models_py3 import SecretConfiguration - from ._models_py3 import ServerlessComputeSettings - from ._models_py3 import ServerlessEndpoint - from ._models_py3 import ServerlessEndpointCapacityReservation - from ._models_py3 import ServerlessEndpointProperties - from ._models_py3 import ServerlessEndpointStatus - from ._models_py3 import ServerlessEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import ServerlessInferenceEndpoint - from ._models_py3 import ServerlessOffer - from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import ServiceTagDestination - from ._models_py3 import ServiceTagOutboundRule - from ._models_py3 import SetupScripts - from ._models_py3 import SharedPrivateLinkResource - from ._models_py3 import Sku - from ._models_py3 import SkuCapacity - from ._models_py3 import SkuResource - from ._models_py3 import SkuResourceArmPaginatedResult - from ._models_py3 import SkuSetting - from ._models_py3 import SparkJob - from ._models_py3 import SparkJobEntry - from ._models_py3 import SparkJobPythonEntry - from ._models_py3 import SparkJobScalaEntry - from ._models_py3 import SparkResourceConfiguration - from ._models_py3 import SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StaticInputData - from ._models_py3 import StatusMessage - from ._models_py3 import StorageAccountDetails - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SynapseSpark - from ._models_py3 import SynapseSparkProperties - from ._models_py3 import SystemCreatedAcrAccount - from ._models_py3 import SystemCreatedStorageAccount - from ._models_py3 import SystemData - from ._models_py3 import SystemService - from ._models_py3 import TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - from ._models_py3 import TableVertical - from ._models_py3 import TableVerticalFeaturizationSettings - from ._models_py3 import TableVerticalLimitSettings - from ._models_py3 import TargetLags - from ._models_py3 import TargetRollingWindowSize - from ._models_py3 import TargetUtilizationScaleSettings - from ._models_py3 import TensorFlow - from ._models_py3 import TextClassification - from ._models_py3 import TextClassificationMultilabel - from ._models_py3 import TextNer - from ._models_py3 import TmpfsOptions - from ._models_py3 import TopNFeaturesByAttribution - from ._models_py3 import TrackedResource - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TritonInferencingServer - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UpdateWorkspaceQuotas - from ._models_py3 import UpdateWorkspaceQuotasResult - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput - from ._models_py3 import Usage - from ._models_py3 import UsageName - from ._models_py3 import UserAccountCredentials - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UserCreatedAcrAccount - from ._models_py3 import UserCreatedStorageAccount - from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties - from ._models_py3 import VirtualMachine - from ._models_py3 import VirtualMachineImage - from ._models_py3 import VirtualMachineSchema - from ._models_py3 import VirtualMachineSchemaProperties - from ._models_py3 import VirtualMachineSecrets - from ._models_py3 import VirtualMachineSecretsSchema - from ._models_py3 import VirtualMachineSize - from ._models_py3 import VirtualMachineSizeListResult - from ._models_py3 import VirtualMachineSshCredentials - from ._models_py3 import VolumeDefinition - from ._models_py3 import VolumeOptions - from ._models_py3 import Webhook - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionApiKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - from ._models_py3 import WorkspaceConnectionPersonalAccessToken - from ._models_py3 import WorkspaceConnectionPropertiesV2 - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult - from ._models_py3 import WorkspaceConnectionServicePrincipal - from ._models_py3 import WorkspaceConnectionSharedAccessSignature - from ._models_py3 import WorkspaceConnectionUpdateParameter - from ._models_py3 import WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceHubConfig - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspacePrivateEndpointResource - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - from ._models import AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AcrDetails # type: ignore - from ._models import ActualCapacityInfo # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AllFeatures # type: ignore - from ._models import AllNodes # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlComputeSchema # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlTokenComputeIdentity # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import ApiKeyAuthWorkspaceConnectionProperties # type: ignore - from ._models import ArmResourceId # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoDeleteSetting # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AutologgerSettings # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureDatastore # type: ignore - from ._models import AzureDevOpsWebhook # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentConfiguration # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpoint # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointProperties # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchPipelineComponentDeploymentConfiguration # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CapacityReservationGroup # type: ignore - from ._models import CapacityReservationGroupProperties # type: ignore - from ._models import CapacityReservationGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import CategoricalDataDriftMetricThreshold # type: ignore - from ._models import CategoricalDataQualityMetricThreshold # type: ignore - from ._models import CategoricalPredictionDriftMetricThreshold # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import ClassificationModelPerformanceMetricThreshold # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainer # type: ignore - from ._models import CodeContainerProperties # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersion # type: ignore - from ._models import CodeVersionProperties # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import Collection # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentConfiguration # type: ignore - from ._models import ComponentContainer # type: ignore - from ._models import ComponentContainerProperties # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersion # type: ignore - from ._models import ComponentVersionProperties # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceAutologgerSettings # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceContainer # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceDataDisk # type: ignore - from ._models import ComputeInstanceDataMount # type: ignore - from ._models import ComputeInstanceEnvironmentInfo # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSchema # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeInstanceVersion # type: ignore - from ._models import ComputeRecurrenceSchedule # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeResourceSchema # type: ignore - from ._models import ComputeRuntimeDto # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomInferencingServer # type: ignore - from ._models import CustomKeys # type: ignore - from ._models import CustomKeysWorkspaceConnectionProperties # type: ignore - from ._models import CustomMetricThreshold # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomMonitoringSignal # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataCollector # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataDriftMetricThresholdBase # type: ignore - from ._models import DataDriftMonitoringSignal # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataImport # type: ignore - from ._models import DataImportSource # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsSchema # type: ignore - from ._models import DataLakeAnalyticsSchemaProperties # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataQualityMetricThresholdBase # type: ignore - from ._models import DataQualityMonitoringSignal # type: ignore - from ._models import DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import DatabaseSource # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DatabricksSchema # type: ignore - from ._models import DatasetExportSummary # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreProperties # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DeploymentResourceConfiguration # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import Docker # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultUpdateProperties # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import EncryptionUpdateProperties # type: ignore - from ._models import Endpoint # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EndpointScheduleAction # type: ignore - from ._models import EnvironmentContainer # type: ignore - from ._models import EnvironmentContainerProperties # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVariable # type: ignore - from ._models import EnvironmentVersion # type: ignore - from ._models import EnvironmentVersionProperties # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExportSummary # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsPropertyBag # type: ignore - from ._models import Feature # type: ignore - from ._models import FeatureAttributionDriftMonitoringSignal # type: ignore - from ._models import FeatureAttributionMetricThreshold # type: ignore - from ._models import FeatureImportanceSettings # type: ignore - from ._models import FeatureProperties # type: ignore - from ._models import FeatureResourceArmPaginatedResult # type: ignore - from ._models import FeatureStoreSettings # type: ignore - from ._models import FeatureSubset # type: ignore - from ._models import FeatureWindow # type: ignore - from ._models import FeaturesetContainer # type: ignore - from ._models import FeaturesetContainerProperties # type: ignore - from ._models import FeaturesetContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # type: ignore - from ._models import FeaturesetVersionBackfillResponse # type: ignore - from ._models import FeaturesetVersionProperties # type: ignore - from ._models import FeaturesetVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityContainer # type: ignore - from ._models import FeaturestoreEntityContainerProperties # type: ignore - from ._models import FeaturestoreEntityContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityVersion # type: ignore - from ._models import FeaturestoreEntityVersionProperties # type: ignore - from ._models import FeaturestoreEntityVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FileSystemSource # type: ignore - from ._models import FixedInputData # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # type: ignore - from ._models import GenerationSafetyQualityMetricThreshold # type: ignore - from ._models import GenerationSafetyQualityMonitoringSignal # type: ignore - from ._models import GenerationTokenUsageMetricThreshold # type: ignore - from ._models import GenerationTokenUsageSignal # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import GroupStatus # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import HDInsightSchema # type: ignore - from ._models import HdfsDatastore # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import IdleShutdownSetting # type: ignore - from ._models import Image # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageMetadata # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import ImportDataAction # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferenceEndpoint # type: ignore - from ._models import InferenceEndpointProperties # type: ignore - from ._models import InferenceEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferenceGroup # type: ignore - from ._models import InferenceGroupProperties # type: ignore - from ._models import InferenceGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencePool # type: ignore - from ._models import InferencePoolProperties # type: ignore - from ._models import InferencePoolTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencingServer # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import IntellectualProperty # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobBaseProperties # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobResourceConfiguration # type: ignore - from ._models import JobScheduleAction # type: ignore - from ._models import JobService # type: ignore - from ._models import JupyterKernelConfig # type: ignore - from ._models import KerberosCredentials # type: ignore - from ._models import KerberosKeytabCredentials # type: ignore - from ._models import KerberosKeytabSecrets # type: ignore - from ._models import KerberosPasswordCredentials # type: ignore - from ._models import KerberosPasswordSecrets # type: ignore - from ._models import KeyVaultProperties # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # type: ignore - from ._models import LakeHouseArtifact # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedComputeIdentity # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelPerformanceMetricThresholdBase # type: ignore - from ._models import ModelPerformanceSignal # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import MonitorComputeConfigurationBase # type: ignore - from ._models import MonitorComputeIdentityBase # type: ignore - from ._models import MonitorDefinition # type: ignore - from ._models import MonitorEmailNotificationSettings # type: ignore - from ._models import MonitorNotificationSettings # type: ignore - from ._models import MonitorServerlessSparkCompute # type: ignore - from ._models import MonitoringDataSegment # type: ignore - from ._models import MonitoringFeatureFilterBase # type: ignore - from ._models import MonitoringInputDataBase # type: ignore - from ._models import MonitoringSignalBase # type: ignore - from ._models import MonitoringTarget # type: ignore - from ._models import MonitoringThreshold # type: ignore - from ._models import MonitoringWorkspaceConnection # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import Nodes # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import NotificationSetting # type: ignore - from ._models import NumericalDataDriftMetricThreshold # type: ignore - from ._models import NumericalDataQualityMetricThreshold # type: ignore - from ._models import NumericalPredictionDriftMetricThreshold # type: ignore - from ._models import Objective # type: ignore - from ._models import OneLakeArtifact # type: ignore - from ._models import OneLakeDatastore # type: ignore - from ._models import OnlineDeployment # type: ignore - from ._models import OnlineDeploymentProperties # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpoint # type: ignore - from ._models import OnlineEndpointProperties # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineInferenceConfiguration # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OsPatchingStatus # type: ignore - from ._models import OutboundRule # type: ignore - from ._models import OutboundRuleBasicResource # type: ignore - from ._models import OutboundRuleListResult # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialJobBase # type: ignore - from ._models import PartialJobBasePartialResource # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialMinimalTrackedResource # type: ignore - from ._models import PartialMinimalTrackedResourceWithIdentity # type: ignore - from ._models import PartialMinimalTrackedResourceWithSku # type: ignore - from ._models import PartialMinimalTrackedResourceWithSkuAndIdentity # type: ignore - from ._models import PartialNotificationSetting # type: ignore - from ._models import PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PendingUploadCredentialDto # type: ignore - from ._models import PendingUploadRequestDto # type: ignore - from ._models import PendingUploadResponseDto # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PoolEnvironmentConfiguration # type: ignore - from ._models import PoolModelConfiguration # type: ignore - from ._models import PoolStatus # type: ignore - from ._models import PredictionDriftMetricThresholdBase # type: ignore - from ._models import PredictionDriftMonitoringSignal # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointDestination # type: ignore - from ._models import PrivateEndpointOutboundRule # type: ignore - from ._models import PrivateEndpointResource # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import ProgressMetrics # type: ignore - from ._models import PropertiesBase # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QueueSettings # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import Ray # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryPartialManagedServiceIdentity # type: ignore - from ._models import RegistryPrivateEndpointConnection # type: ignore - from ._models import RegistryPrivateLinkServiceConnectionState # type: ignore - from ._models import RegistryRegionArmDetails # type: ignore - from ._models import RegistryTrackedResourceArmPaginatedResult # type: ignore - from ._models import Regression # type: ignore - from ._models import RegressionModelPerformanceMetricThreshold # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestConfiguration # type: ignore - from ._models import RequestLogging # type: ignore - from ._models import ResizeSchema # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import RollingInputData # type: ignore - from ._models import Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import Schedule # type: ignore - from ._models import ScheduleActionBase # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import ScheduleProperties # type: ignore - from ._models import ScheduleResourceArmPaginatedResult # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import Seasonality # type: ignore - from ._models import SecretConfiguration # type: ignore - from ._models import ServerlessComputeSettings # type: ignore - from ._models import ServerlessEndpoint # type: ignore - from ._models import ServerlessEndpointCapacityReservation # type: ignore - from ._models import ServerlessEndpointProperties # type: ignore - from ._models import ServerlessEndpointStatus # type: ignore - from ._models import ServerlessEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import ServerlessInferenceEndpoint # type: ignore - from ._models import ServerlessOffer # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import ServiceTagDestination # type: ignore - from ._models import ServiceTagOutboundRule # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import SparkJob # type: ignore - from ._models import SparkJobEntry # type: ignore - from ._models import SparkJobPythonEntry # type: ignore - from ._models import SparkJobScalaEntry # type: ignore - from ._models import SparkResourceConfiguration # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StaticInputData # type: ignore - from ._models import StatusMessage # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemCreatedAcrAccount # type: ignore - from ._models import SystemCreatedStorageAccount # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import TmpfsOptions # type: ignore - from ._models import TopNFeaturesByAttribution # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TritonInferencingServer # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserCreatedAcrAccount # type: ignore - from ._models import UserCreatedStorageAccount # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineSchema # type: ignore - from ._models import VirtualMachineSchemaProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSecretsSchema # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import VolumeDefinition # type: ignore - from ._models import VolumeOptions # type: ignore - from ._models import Webhook # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionApiKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # type: ignore - from ._models import WorkspaceConnectionPersonalAccessToken # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceConnectionServicePrincipal # type: ignore - from ._models import WorkspaceConnectionSharedAccessSignature # type: ignore - from ._models import WorkspaceConnectionUpdateParameter # type: ignore - from ._models import WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceHubConfig # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspacePrivateEndpointResource # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - ActionType, - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - AuthMode, - AutoDeleteCondition, - AutoRebuildSetting, - Autosave, - BaseEnvironmentSourceType, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModelPerformanceMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeRecurrenceFrequency, - ComputeTriggerType, - ComputeType, - ComputeWeekDay, - ConnectionAuthType, - ConnectionCategory, - ContainerType, - CreatedByType, - CredentialsType, - DataAvailabilityStatus, - DataCollectionMode, - DataImportSourceType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureAttributionMetric, - FeatureDataType, - FeatureImportanceMode, - FeatureLags, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - GenerationSafetyQualityMetric, - GenerationTokenUsageMetric, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InferencingServerType, - InputDeliveryMode, - InputPathType, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogTrainingMetrics, - LogValidationLoss, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedNetworkStatus, - ManagedServiceIdentityType, - MaterializationStoreType, - MediaType, - MlflowAutologger, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringModelType, - MonitoringNotificationType, - MonitoringSignalType, - MountAction, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - Origin, - OsType, - OutputDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - PatchStatus, - PendingUploadCredentialType, - PendingUploadType, - PoolProvisioningState, - PrivateEndpointConnectionProvisioningState, - ProtectionLevel, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModelPerformanceMetric, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServerlessInferenceEndpointAuthMode, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - VmPriority, - VolumeDefinitionType, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'ActualCapacityInfo', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CapacityReservationGroup', - 'CapacityReservationGroupProperties', - 'CapacityReservationGroupTrackedResourceArmPaginatedResult', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentConfiguration', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeRecurrenceSchedule', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureImportanceSettings', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionBackfillResponse', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GenerationSafetyQualityMetricThreshold', - 'GenerationSafetyQualityMonitoringSignal', - 'GenerationTokenUsageMetricThreshold', - 'GenerationTokenUsageSignal', - 'GridSamplingAlgorithm', - 'GroupStatus', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferenceEndpoint', - 'InferenceEndpointProperties', - 'InferenceEndpointTrackedResourceArmPaginatedResult', - 'InferenceGroup', - 'InferenceGroupProperties', - 'InferenceGroupTrackedResourceArmPaginatedResult', - 'InferencePool', - 'InferencePoolProperties', - 'InferencePoolTrackedResourceArmPaginatedResult', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'JupyterKernelConfig', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignal', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorEmailNotificationSettings', - 'MonitorNotificationSettings', - 'MonitorServerlessSparkCompute', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'MonitoringWorkspaceConnection', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OsPatchingStatus', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialMinimalTrackedResourceWithSkuAndIdentity', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PoolEnvironmentConfiguration', - 'PoolModelConfiguration', - 'PoolStatus', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PropertiesBase', - 'ProxyResource', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestConfiguration', - 'RequestLogging', - 'ResizeSchema', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'RollingInputData', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServerlessComputeSettings', - 'ServerlessEndpoint', - 'ServerlessEndpointCapacityReservation', - 'ServerlessEndpointProperties', - 'ServerlessEndpointStatus', - 'ServerlessEndpointTrackedResourceArmPaginatedResult', - 'ServerlessInferenceEndpoint', - 'ServerlessOffer', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StaticInputData', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonInferencingServer', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'ActionType', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AuthMode', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeRecurrenceFrequency', - 'ComputeTriggerType', - 'ComputeType', - 'ComputeWeekDay', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataAvailabilityStatus', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureImportanceMode', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'GenerationSafetyQualityMetric', - 'GenerationTokenUsageMetric', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringModelType', - 'MonitoringNotificationType', - 'MonitoringSignalType', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'Origin', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PatchStatus', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PoolProvisioningState', - 'PrivateEndpointConnectionProvisioningState', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServerlessInferenceEndpointAuthMode', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 7f33828e52d2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,2034 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ - - INTERNAL = "Internal" - -class AllocationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AAD = "AAD" - -class AutoDeleteCondition(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_GREATER_THAN = "CreatedGreaterThan" - LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" - -class AutoRebuildSetting(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -class BaseEnvironmentSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Base environment type. - """ - - ENVIRONMENT_ASSET = "EnvironmentAsset" - -class BatchDeploymentConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated property types for batch deployments. - """ - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - -class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class BillingCurrency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Target encoding for text data. - TEXT_TARGET_ENCODER = "TextTargetEncoder" - #: Ohe hot encoding creates a binary feature transformation. - ONE_HOT_ENCODER = "OneHotEncoder" - #: Target encoding for categorical data. - CAT_TARGET_ENCODER = "CatTargetEncoder" - #: Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - #: weighting scheme for identifying information from documents. - TF_IDF = "TfIdf" - #: Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - #: natural log of the P(1)/P(0) to create weights. - WO_E_TARGET_ENCODER = "WoETargetEncoder" - #: Label encoder converts labels/categorical variables in a numerical form. - LABEL_ENCODER = "LabelEncoder" - #: Word embedding helps represents words or phrases as a vector, or a series of numbers. - WORD_EMBEDDING = "WordEmbedding" - #: Naive Bayes is a classified that is used for classification of discrete features that are - #: categorically distributed. - NAIVE_BAYES = "NaiveBayes" - #: Count Vectorizer converts a collection of text documents to a matrix of token counts. - COUNT_VECTORIZER = "CountVectorizer" - #: Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - #: This is often used for high-cardinality categorical features. - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - -class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class ClassificationModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the accuracy of the model predictions. - ACCURACY = "Accuracy" - #: Calculates the precision of the model predictions. - PRECISION = "Precision" - #: Calculates the recall of the model predictions. - RECALL = "Recall" - -class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ClusterPurpose(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - RESIZING = "Resizing" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeRecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a compute recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ComputeTriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ComputeWeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" - -class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - API_KEY = "ApiKey" - CUSTOM_KEYS = "CustomKeys" - -class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - ADLS_GEN2 = "ADLSGen2" - REDIS = "Redis" - API_KEY = "ApiKey" - AZURE_OPEN_AI = "AzureOpenAI" - COGNITIVE_SEARCH = "CognitiveSearch" - COGNITIVE_SERVICE = "CognitiveService" - CUSTOM_KEYS = "CustomKeys" - -class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of container to retrieve logs from. - """ - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_KEYTAB = "KerberosKeytab" - KERBEROS_PASSWORD = "KerberosPassword" - -class DataAvailabilityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - PENDING = "Pending" - INCOMPLETE = "Incomplete" - COMPLETE = "Complete" - -class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataImportSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - DATABASE = "database" - FILE_SYSTEM = "file_system" - -class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - HDFS = "Hdfs" - ONE_LAKE = "OneLake" - -class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DiagnoseResultLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - RAY = "Ray" - -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EmailNotificationEnableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the email notification type. - """ - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - -class EncryptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Connection status of the service consumer with the service provider - """ - - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class EnvironmentVariableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class ExportFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -class FeatureAttributionMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - -class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - -class FeatureImportanceMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The mode of operation for computing feature importance. - """ - - #: Disables computing feature importance within a signal. - DISABLED = "Disabled" - #: Enables computing feature importance within a signal. - ENABLED = "Enabled" - -class FeatureLags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class ForecastHorizonMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - #: brief intro. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class GenerationSafetyQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation safety quality metric enum. - """ - - ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = "AcceptableGroundednessScorePerInstance" - AGGREGATED_GROUNDEDNESS_PASS_RATE = "AggregatedGroundednessPassRate" - ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = "AcceptableCoherenceScorePerInstance" - AGGREGATED_COHERENCE_PASS_RATE = "AggregatedCoherencePassRate" - ACCEPTABLE_FLUENCY_SCORE_PER_INSTANCE = "AcceptableFluencyScorePerInstance" - AGGREGATED_FLUENCY_PASS_RATE = "AggregatedFluencyPassRate" - ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = "AcceptableSimilarityScorePerInstance" - AGGREGATED_SIMILARITY_PASS_RATE = "AggregatedSimilarityPassRate" - ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = "AcceptableRelevanceScorePerInstance" - AGGREGATED_RELEVANCE_PASS_RATE = "AggregatedRelevancePassRate" - -class GenerationTokenUsageMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation token statistics metric enum. - """ - - TOTAL_TOKEN_COUNT = "TotalTokenCount" - TOTAL_TOKEN_COUNT_PER_GROUP = "TotalTokenCountPerGroup" - -class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class ImageAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - Environment images (custom and curated) - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class IncrementalDataRefresh(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether IncrementalDataRefresh is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class InferencingServerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Inferencing server type for various targets. - """ - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - -class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InputPathType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Input path type for package inputs. - """ - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - -class InstanceSegmentationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class IsolationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ - - LITERAL = "literal" - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - #: The job is in a scheduled state. Job is not in any active state. - SCHEDULED = "Scheduled" - -class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job tier. - """ - - NULL = "Null" - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LoadBalancerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class LogTrainingMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log training metrics. - ENABLE = "Enable" - #: Disable compute and log training metrics. - DISABLE = "Disable" - -class LogValidationLoss(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log validation metrics. - ENABLE = "Enable" - #: Disable compute and log validation metrics. - DISABLE = "Disable" - -class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedNetworkStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MediaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class ModelTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model task type enum. - """ - - CLASSIFICATION = "Classification" - REGRESSION = "Regression" - QUESTION_ANSWERING = "QuestionAnswering" - -class MonitorComputeIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute identity type enum. - """ - - #: Authenticates through user's AML token. - AML_TOKEN = "AmlToken" - #: Authenticates through a user-provided managed identity. - MANAGED_IDENTITY = "ManagedIdentity" - -class MonitorComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute type enum. - """ - - #: Serverless Spark compute. - SERVERLESS_SPARK = "ServerlessSpark" - -class MonitoringFeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Used for features of numerical data type. - NUMERICAL = "Numerical" - #: Used for features of categorical data type. - CATEGORICAL = "Categorical" - -class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Includes all features. - ALL_FEATURES = "AllFeatures" - #: Only includes the top contributing features, measured by feature attribution. - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - #: Includes a user-defined subset of features. - FEATURE_SUBSET = "FeatureSubset" - -class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitoring input data type enum. - """ - - #: An input data with a fixed window size. - STATIC = "Static" - #: An input data which rolls relatively to the monitor's current run time. - ROLLING = "Rolling" - #: An input data with tabular format which doesn't require preprocessing. - FIXED = "Fixed" - -class MonitoringModelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: A model trained for classification tasks. - CLASSIFICATION = "Classification" - #: A model trained for regressions tasks. - REGRESSION = "Regression" - -class MonitoringNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enables email notifications through AML notifications. - AML_NOTIFICATION = "AmlNotification" - #: Enables notifications through Azure Monitor by posting metrics to the workspace's Azure Monitor - #: instance. - AZURE_MONITOR = "AzureMonitor" - -class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Tracks model input data distribution change, comparing against training data or past production - #: data. - DATA_DRIFT = "DataDrift" - #: Tracks prediction result data distribution change, comparing against validation/test label data - #: or past production data. - PREDICTION_DRIFT = "PredictionDrift" - #: Tracks model input data integrity. - DATA_QUALITY = "DataQuality" - #: Tracks feature importance change in production, comparing against feature importance at - #: training time. - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - #: Tracks a custom signal provided by users. - CUSTOM = "Custom" - #: Tracks model performance based on ground truth data. - MODEL_PERFORMANCE = "ModelPerformance" - #: Tracks the safety and quality of generated content. - GENERATION_SAFETY_QUALITY = "GenerationSafetyQuality" - #: Tracks the token usage of generative endpoints. - GENERATION_TOKEN_STATISTICS = "GenerationTokenStatistics" - -class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class MultiSelect(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether multiSelect is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class Network(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NlpLearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class NodesValueType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated types for the nodes value - """ - - ALL = "All" - CUSTOM = "Custom" - -class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class ObjectDetectionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OneLakeArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine OneLake artifact type. - """ - - LAKE_HOUSE = "LakeHouse" - -class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - RESIZE = "Resize" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - RESIZE_FAILED = "ResizeFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OperationTrigger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - -class OsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -class PackageBuildState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Package build state returned in package response. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class PackageInputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mounting type of the model or the inputs - """ - - COPY = "Copy" - DOWNLOAD = "Download" - -class PackageInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the inputs. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - -class PatchStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The os patching status. - """ - - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - UNKNOWN = "Unknown" - -class PendingUploadCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the PendingUpload credentials type. - """ - - SAS = "SAS" - -class PendingUploadType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of storage to use for the pending upload location - """ - - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - -class PoolProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of pool related resources provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class ProtectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protection level associated with the Intellectual Property. - """ - - #: All means Intellectual Property is fully protected. - ALL = "All" - #: None means it is not an Intellectual Property. - NONE = "None" - -class Protocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RandomSamplingAlgorithmRule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Mean Absolute Error (MAE) metric. - MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" - #: The Root Mean Squared Error (RMSE) metric. - ROOT_MEAN_SQUARED_ERROR = "RootMeanSquaredError" - #: The Mean Squared Error (MSE) metric. - MEAN_SQUARED_ERROR = "MeanSquaredError" - -class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - YEAR = "Year" - MONTH = "Month" - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - -class RuleAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The action enum for networking rule. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class RuleCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - -class RuleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - IMPORT_DATA = "ImportData" - CREATE_MONITOR = "CreateMonitor" - -class ScheduleListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SeasonalityMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_PASSWORD = "KerberosPassword" - KERBEROS_KEYTAB = "KerberosKeytab" - -class ServerlessInferenceEndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY = "Key" - AAD = "AAD" - -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class StatusMessageLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class StorageAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class TextAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TrainingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Training mode dictates whether to use distributed training or not - """ - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - -class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class UseStl(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class VMPriceOSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" - -class VolumeDefinitionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WebhookType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the webhook callback service type. - """ - - AZURE_DEV_OPS = "AzureDevOps" - -class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py deleted file mode 100644 index d22720e97eee..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models.py +++ /dev/null @@ -1,32464 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccessKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.created_by_workspace_arm_id = None - self.expiry_time = kwargs.get('expiry_time', None) - self.is_shared_to_all = kwargs.get('is_shared_to_all', None) - self.metadata = kwargs.get('metadata', None) - self.target = kwargs.get('target', None) - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar allocated: Gets or sets the total number of instances for the group. - :vartype allocated: int - :ivar assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :vartype assignment_failed: int - :ivar assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :vartype assignment_success: int - """ - - _attribute_map = { - 'allocated': {'key': 'allocated', 'type': 'int'}, - 'assignment_failed': {'key': 'assignmentFailed', 'type': 'int'}, - 'assignment_success': {'key': 'assignmentSuccess', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allocated: Gets or sets the total number of instances for the group. - :paramtype allocated: int - :keyword assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :paramtype assignment_failed: int - :keyword assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :paramtype assignment_success: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.allocated = kwargs.get('allocated', 0) - self.assignment_failed = kwargs.get('assignment_failed', 0) - self.assignment_success = kwargs.get('assignment_success', 0) - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - 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 - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = kwargs.get('condition', None) - self.value = kwargs.get('value', None) - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.secrets_configuration = kwargs.get('secrets_configuration', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - 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) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class CapacityReservationGroup(TrackedResource): - """CapacityReservationGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'CapacityReservationGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(CapacityReservationGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class CapacityReservationGroupProperties(msrest.serialization.Model): - """CapacityReservationGroupProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar offer: Offer used by this capacity reservation group. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :vartype reserved_capacity: int - """ - - _validation = { - 'reserved_capacity': {'required': True}, - } - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer: Offer used by this capacity reservation group. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :keyword reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :paramtype reserved_capacity: int - """ - super(CapacityReservationGroupProperties, self).__init__(**kwargs) - self.offer = kwargs.get('offer', None) - self.reserved_capacity = kwargs['reserved_capacity'] - - -class CapacityReservationGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CapacityReservationGroup entities. - - :ivar next_link: The link to the next page of CapacityReservationGroup objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CapacityReservationGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CapacityReservationGroup objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CapacityReservationGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - super(CapacityReservationGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Classification' # type: str - self.metric = kwargs['metric'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - self.training_mode = kwargs.get('training_mode', None) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentConfiguration(msrest.serialization.Model): - """Used for sweep over component. - - :ivar pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype pipeline_settings: any - """ - - _attribute_map = { - 'pipeline_settings': {'key': 'pipelineSettings', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype pipeline_settings: any - """ - super(ComponentConfiguration, self).__init__(**kwargs) - self.pipeline_settings = kwargs.get('pipeline_settings', None) - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.enable_os_patching = kwargs.get('enable_os_patching', False) - self.enable_root_access = kwargs.get('enable_root_access', True) - self.enable_sso = kwargs.get('enable_sso', True) - self.release_quota_on_stop = kwargs.get('release_quota_on_stop', False) - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', 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) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = kwargs.get('credentials', None) - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, GenerationSafetyQualityMonitoringSignal, GenerationTokenUsageSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenUsageSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = kwargs.get('notification_types', None) - self.properties = kwargs.get('properties', None) - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :ivar workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - 'workspace_connection': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :keyword workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.inputs = kwargs.get('inputs', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.workspace_connection = kwargs['workspace_connection'] - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) - self.kernel = kwargs.get('kernel', None) - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = kwargs.get('connection', None) - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(**kwargs) - self.source_type = 'database' # type: str - self.query = kwargs.get('query', None) - self.stored_procedure = kwargs.get('stored_procedure', None) - self.stored_procedure_params = kwargs.get('stored_procedure_params', None) - self.table_name = kwargs.get('table_name', None) - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.stage = kwargs.get('stage', None) - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = kwargs.get('asset_name', None) - self.source = kwargs.get('source', None) - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.locations = kwargs.get('locations', None) - self.max_instance_count = kwargs.get('max_instance_count', None) - self.properties = kwargs.get('properties', None) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.key_vault = kwargs.get('key_vault', None) - self.nsg = kwargs.get('nsg', None) - self.others = kwargs.get('others', None) - self.required_resource_providers = kwargs.get('required_resource_providers', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.storage_account = kwargs.get('storage_account', None) - self.udr = kwargs.get('udr', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) - self.status = kwargs['status'] - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.target_column = kwargs.get('target_column', None) - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = kwargs.get('data_availability_status', None) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.properties = kwargs.get('properties', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = kwargs.get('job_ids', None) - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) - self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(**kwargs) - self.source_type = 'file_system' # type: str - self.path = kwargs.get('path', None) - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - self.data_context = kwargs.get('data_context', None) - self.input_data_type = None # type: Optional[str] - self.job_input_type = kwargs['job_input_type'] - self.uri = kwargs['uri'] - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(**kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.features_unknown_at_forecast_time = kwargs.get('features_unknown_at_forecast_time', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class OutboundRule(msrest.serialization.Model): - """Outbound rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.status = kwargs.get('status', None) - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) - - -class GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - self.workspace_connection_id = kwargs.get('workspace_connection_id', None) - - -class GenerationTokenUsageMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenUsageMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationTokenUsageSignal(MonitoringSignalBase): - """Generation token usage signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenUsageMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenUsageSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :vartype bonus_extra_capacity: int - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :paramtype bonus_extra_capacity: int - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = kwargs.get('actual_capacity_info', None) - self.bonus_extra_capacity = kwargs.get('bonus_extra_capacity', 0) - self.endpoint_count = kwargs.get('endpoint_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) - self.version = kwargs.get('version', None) - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.log_training_metrics = kwargs.get('log_training_metrics', None) - self.log_validation_loss = kwargs.get('log_validation_loss', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - 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.training_data = kwargs['training_data'] - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = kwargs['data_import_definition'] - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_id: Required. [Required] Group within the same pool with which this endpoint needs - to be associated with. - :vartype group_id: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_id: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_id: str - """ - super(InferenceEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.endpoint_uri = None - self.group_id = kwargs['group_id'] - self.provisioning_state = None - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :vartype bonus_extra_capacity: int - :ivar metadata: Metadata for the inference group. - :vartype metadata: str - :ivar priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20230801Preview.Pools.InferencePools. - :vartype priority: int - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'metadata': {'key': 'metadata', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :paramtype bonus_extra_capacity: int - :keyword metadata: Metadata for the inference group. - :paramtype metadata: str - :keyword priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20230801Preview.Pools.InferencePools. - :paramtype priority: int - """ - super(InferenceGroupProperties, self).__init__(**kwargs) - self.bonus_extra_capacity = kwargs.get('bonus_extra_capacity', 0) - self.metadata = kwargs.get('metadata', None) - self.priority = kwargs.get('priority', 0) - self.provisioning_state = None - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar code_configuration: Code configuration for the inference pool. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar environment_configuration: EnvironmentConfiguration for the inference pool. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :ivar model_configuration: ModelConfiguration for the inference pool. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :ivar node_sku_type: Required. [Required] Compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: Request configuration for the inference pool. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'node_sku_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'PoolEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'PoolModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword code_configuration: Code configuration for the inference pool. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword environment_configuration: EnvironmentConfiguration for the inference pool. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :keyword model_configuration: ModelConfiguration for the inference pool. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :keyword node_sku_type: Required. [Required] Compute instance type. - :paramtype node_sku_type: str - :keyword request_configuration: Request configuration for the inference pool. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferencePoolProperties, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.environment_configuration = kwargs.get('environment_configuration', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.node_sku_type = kwargs['node_sku_type'] - self.provisioning_state = None - self.request_configuration = kwargs.get('request_configuration', None) - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = kwargs.get('argv', None) - self.display_name = kwargs.get('display_name', None) - self.language = kwargs.get('language', None) - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = kwargs.get('identity_client_id', None) - self.key_identifier = kwargs['key_identifier'] - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) - - -class LabelingJob(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = kwargs.get('container_registry_credentials', None) - self.notebook_access_keys = kwargs.get('notebook_access_keys', None) - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = kwargs.get('identity', None) - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = kwargs.get('spark_ready', None) - self.status = kwargs.get('status', None) - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: Detail isolation modes for the managed network of a machine - learning workspace. - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) - self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service which - performance will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - which performance will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(ModelPerformanceSignal, self).__init__(**kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = kwargs.get('alert_notification_settings', None) - self.compute_configuration = kwargs['compute_configuration'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = kwargs.get('feature', None) - self.values = kwargs.get('values', None) - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = kwargs.get('deployment_id', None) - self.model_id = kwargs.get('model_id', None) - self.task_type = kwargs['task_type'] - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = kwargs.get('environment_variables', None) - self.secrets = kwargs.get('secrets', None) - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = kwargs.get('email_notification_settings', None) - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = kwargs['compute_identity'] - self.instance_type = kwargs['instance_type'] - self.runtime_version = kwargs['runtime_version'] - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.is_private_link_enabled = kwargs.get('is_private_link_enabled', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - self.resource_id = kwargs.get('resource_id', None) - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = kwargs.get('patch_status', None) - self.latest_patch_time = kwargs.get('latest_patch_time', None) - self.reboot_pending = kwargs.get('reboot_pending', None) - self.scheduled_reboot_time = kwargs.get('scheduled_reboot_time', None) - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Properties can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Property dictionary. Properties can be added, removed, and updated. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.target_environment_id = kwargs['target_environment_id'] - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Tags can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'properties': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = None - self.tags = None - self.target_environment_id = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = kwargs.get('notification_setting', None) - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = kwargs.get('webhooks', None) - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) - - -class PoolEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: dict[str, str] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: dict[str, str] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(PoolEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.readiness_probe = kwargs.get('readiness_probe', None) - self.startup_probe = kwargs.get('startup_probe', None) - - -class PoolModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(PoolModelConfiguration, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - - -class PoolStatus(msrest.serialization.Model): - """PoolStatus. - - :ivar actual_capacity: Gets or sets the actual number of instances in the pool. - :vartype actual_capacity: int - :ivar group_count: Gets or sets the actual number of groups in the pool. - :vartype group_count: int - :ivar requested_capacity: Gets or sets the requested number of instances for the pool. - :vartype requested_capacity: int - :ivar reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :vartype reserved_capacity: int - """ - - _attribute_map = { - 'actual_capacity': {'key': 'actualCapacity', 'type': 'int'}, - 'group_count': {'key': 'groupCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity: Gets or sets the actual number of instances in the pool. - :paramtype actual_capacity: int - :keyword group_count: Gets or sets the actual number of groups in the pool. - :paramtype group_count: int - :keyword requested_capacity: Gets or sets the requested number of instances for the pool. - :paramtype requested_capacity: int - :keyword reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :paramtype reserved_capacity: int - """ - super(PoolStatus, self).__init__(**kwargs) - self.actual_capacity = kwargs.get('actual_capacity', 0) - self.group_count = kwargs.get('group_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - self.reserved_capacity = kwargs.get('reserved_capacity', 0) - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - self.subresource_target = kwargs.get('subresource_target', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - self.priority = kwargs.get('priority', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = kwargs.get('address', None) - self.dashboard_port = kwargs.get('dashboard_port', None) - self.head_node_additional_args = kwargs.get('head_node_additional_args', None) - self.include_dashboard = kwargs.get('include_dashboard', None) - self.port = kwargs.get('port', None) - self.worker_node_additional_args = kwargs.get('worker_node_additional_args', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.registry_private_endpoint_connections = kwargs.get('registry_private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = kwargs.get('passwords', None) - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(**kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.registry_private_link_service_connection_state = kwargs.get('registry_private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - 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.training_data = kwargs['training_data'] - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Regression' # type: str - self.metric = kwargs['metric'] - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = kwargs.get('target_vm_size', None) - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the trailing data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(**kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_offset = kwargs['window_offset'] - self.window_size = kwargs['window_size'] - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) - self.provisioning_state = None - self.trigger = kwargs['trigger'] - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.workspace_secret_name = kwargs.get('workspace_secret_name', None) - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = kwargs.get('serverless_compute_custom_subnet', None) - self.serverless_compute_no_public_ip = kwargs.get('serverless_compute_no_public_ip', None) - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = kwargs['capacity_reservation_group_id'] - self.endpoint_reserved_capacity = kwargs.get('endpoint_reserved_capacity', None) - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible values - include: "Key", "AAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar offer: Required. [Required] The publisher-defined Serverless Offer to provision the - endpoint with. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'inference_endpoint': {'readonly': True}, - 'offer': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible - values include: "Key", "AAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword offer: Required. [Required] The publisher-defined Serverless Offer to provision the - endpoint with. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs.get('auth_mode', None) - self.capacity_reservation = kwargs.get('capacity_reservation', None) - self.inference_endpoint = None - self.offer = kwargs['offer'] - self.provisioning_state = None - - -class ServerlessEndpointStatus(msrest.serialization.Model): - """ServerlessEndpointStatus. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metrics: The model-specific metrics from the backing inference endpoint. - :vartype metrics: dict[str, str] - """ - - _validation = { - 'metrics': {'readonly': True}, - } - - _attribute_map = { - 'metrics': {'key': 'metrics', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ServerlessEndpointStatus, self).__init__(**kwargs) - self.metrics = None - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. [Required] The name of the Serverless Offer. - :vartype offer_name: str - :ivar publisher: Required. [Required] Publisher name of the Serverless Offer. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer_name: Required. [Required] The name of the Serverless Offer. - :paramtype offer_name: str - :keyword publisher: Required. [Required] Publisher name of the Serverless Offer. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = kwargs['offer_name'] - self.publisher = kwargs['publisher'] - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.address_prefixes = None - self.port_ranges = kwargs.get('port_ranges', None) - self.protocol = kwargs.get('protocol', None) - self.service_tag = kwargs.get('service_tag', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.group_id = kwargs.get('group_id', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(**kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_end = kwargs['window_end'] - self.window_start = kwargs['window_start'] - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar component_configuration: Component Configuration for sweep over component. - :vartype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'component_configuration': {'key': 'componentConfiguration', 'type': 'ComponentConfiguration'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword component_configuration: Component Configuration for sweep over component. - :paramtype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.component_configuration = kwargs.get('component_configuration', None) - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - 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.training_data = kwargs['training_data'] - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :vartype allow_roleassignment_on_rg: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute created in the workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'allow_roleassignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :paramtype allow_roleassignment_on_rg: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute created in the workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', None) - self.application_insights = kwargs.get('application_insights', None) - self.associated_workspaces = kwargs.get('associated_workspaces', None) - self.container_registries = kwargs.get('container_registries', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.allow_roleassignment_on_rg = kwargs.get('allow_roleassignment_on_rg', None) - self.encryption = kwargs.get('encryption', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.hbi_workspace = kwargs.get('hbi_workspace', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.key_vault = kwargs.get('key_vault', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.managed_network = kwargs.get('managed_network', None) - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.service_provisioned_resource_group = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.storage_account = kwargs.get('storage_account', None) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.storage_hns_enabled = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.tenant_id = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) - self.workspace_hub_config = kwargs.get('workspace_hub_config', None) - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = kwargs.get('password', None) - self.username = kwargs.get('username', None) - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = kwargs.get('additional_workspace_storage_accounts', None) - self.default_workspace_resource_group = kwargs.get('default_workspace_resource_group', None) - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :vartype allow_roleassignment_on_rg: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute created in the workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'allow_roleassignment_on_rg' : {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :paramtype allow_roleassignment_on_rg: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute created in the workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.allow_roleassignment_on_rg = kwargs.get('allow_roleassignment_on_rg', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.managed_network = kwargs.get('managed_network', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py deleted file mode 100644 index 6911dae5a24c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/models/_models_py3.py +++ /dev/null @@ -1,35255 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccessKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.created_by_workspace_arm_id = None - self.expiry_time = expiry_time - self.is_shared_to_all = is_shared_to_all - self.metadata = metadata - self.target = target - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = credentials - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - *, - system_created_acr_account: Optional["SystemCreatedAcrAccount"] = None, - user_created_acr_account: Optional["UserCreatedAcrAccount"] = None, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = system_created_acr_account - self.user_created_acr_account = user_created_acr_account - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar allocated: Gets or sets the total number of instances for the group. - :vartype allocated: int - :ivar assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :vartype assignment_failed: int - :ivar assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :vartype assignment_success: int - """ - - _attribute_map = { - 'allocated': {'key': 'allocated', 'type': 'int'}, - 'assignment_failed': {'key': 'assignmentFailed', 'type': 'int'}, - 'assignment_success': {'key': 'assignmentSuccess', 'type': 'int'}, - } - - def __init__( - self, - *, - allocated: Optional[int] = 0, - assignment_failed: Optional[int] = 0, - assignment_success: Optional[int] = 0, - **kwargs - ): - """ - :keyword allocated: Gets or sets the total number of instances for the group. - :paramtype allocated: int - :keyword assignment_failed: Gets or sets the number of instances which failed to successfully - complete assignment. - :paramtype assignment_failed: int - :keyword assignment_success: Gets or sets the number of instances which successfully completed - assignment. - :paramtype assignment_success: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.allocated = allocated - self.assignment_failed = assignment_failed - self.assignment_success = assignment_success - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = properties - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All", "Custom". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = properties - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - property_bag: Optional[Any] = None, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - self.property_bag = property_bag - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionApiKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = credentials - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = resource_id - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.auto_delete_setting = auto_delete_setting - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - condition: Optional[Union[str, "AutoDeleteCondition"]] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = condition - self.value = value - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, LabelingJobProperties, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = notification_setting - self.secrets_configuration = secrets_configuration - self.services = services - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.task_type = None # type: Optional[str] - self.training_data = training_data - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = event_type - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str - 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 - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.intellectual_property = intellectual_property - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = code_configuration - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = resource_id - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["DeploymentResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.deployment_configuration = deployment_configuration - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - component_id: Optional["IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = component_id - self.description = description - self.settings = settings - self.tags = tags - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = propagation - self.create_host_path = create_host_path - self.selinux = selinux - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class CapacityReservationGroup(TrackedResource): - """CapacityReservationGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'CapacityReservationGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "CapacityReservationGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.CapacityReservationGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(CapacityReservationGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class CapacityReservationGroupProperties(msrest.serialization.Model): - """CapacityReservationGroupProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar offer: Offer used by this capacity reservation group. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :vartype reserved_capacity: int - """ - - _validation = { - 'reserved_capacity': {'required': True}, - } - - _attribute_map = { - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - reserved_capacity: int, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword offer: Offer used by this capacity reservation group. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :keyword reserved_capacity: Required. [Required] Specifies the amount of capacity to reserve. - :paramtype reserved_capacity: int - """ - super(CapacityReservationGroupProperties, self).__init__(**kwargs) - self.offer = offer - self.reserved_capacity = reserved_capacity - - -class CapacityReservationGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CapacityReservationGroup entities. - - :ivar next_link: The link to the next page of CapacityReservationGroup objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CapacityReservationGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CapacityReservationGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CapacityReservationGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CapacityReservationGroup objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CapacityReservationGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CapacityReservationGroup] - """ - super(CapacityReservationGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["ClassificationTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = threshold - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "ClassificationModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Classification' # type: str - self.metric = metric - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - self.training_mode = training_mode - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = None - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = 1, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = client_id - self.data_collection_mode = data_collection_mode - self.data_id = data_id - self.sampling_rate = sampling_rate - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, Ray, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, Ray, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.queue_settings = queue_settings - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentConfiguration(msrest.serialization.Model): - """Used for sweep over component. - - :ivar pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype pipeline_settings: any - """ - - _attribute_map = { - 'pipeline_settings': {'key': 'pipelineSettings', 'type': 'object'}, - } - - def __init__( - self, - *, - pipeline_settings: Optional[Any] = None, - **kwargs - ): - """ - :keyword pipeline_settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype pipeline_settings: any - """ - super(ComponentConfiguration, self).__init__(**kwargs) - self.pipeline_settings = pipeline_settings - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the component lifecycle. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - self.stage = stage - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "Network"]] = None, - environment: Optional["ComputeInstanceEnvironmentInfo"] = None, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = name - self.autosave = autosave - self.gpu = gpu - self.network = network - self.environment = environment - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - caching: Optional[Union[str, "Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = caching - self.disk_size_gb = disk_size_gb - self.lun = lun - self.storage_account_type = storage_account_type - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "MountAction"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = source - self.source_type = source_type - self.mount_name = mount_name - self.mount_action = mount_action - self.created_by = created_by - self.mount_path = mount_path - self.mount_state = mount_state - self.mounted_on = mounted_on - self.error = error - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = name - self.version = version - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "OperationTrigger"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - self.operation_trigger = operation_trigger - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - enable_os_patching: Optional[bool] = False, - enable_root_access: Optional[bool] = True, - enable_sso: Optional[bool] = True, - release_quota_on_stop: Optional[bool] = False, - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = True, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.autologger_settings = autologger_settings - self.ssh_settings = ssh_settings - self.custom_services = custom_services - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.enable_os_patching = enable_os_patching - self.enable_root_access = enable_root_access - self.enable_sso = enable_sso - self.release_quota_on_stop = release_quota_on_stop - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - self.idle_time_before_shutdown = idle_time_before_shutdown - self.enable_node_public_ip = enable_node_public_ip - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = runtime - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "ComputeWeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = spark_runtime_version - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "ComputeTriggerType"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - schedule: Optional["ScheduleBase"] = None, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.action = action - self.trigger_type = trigger_type - self.recurrence = recurrence - self.cron = cron - self.schedule = schedule - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, ImportDataAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = monitor_definition - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - *, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = end_time - self.start_time = start_time - self.time_zone = time_zone - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = expression - - -class CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = inference_configuration - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - *, - keys: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = keys - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["CustomKeys"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = credentials - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: str, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'custom_model' # type: str - self.description = description - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, GenerationSafetyQualityMonitoringSignal, GenerationTokenUsageSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenUsageSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = notification_types - self.properties = properties - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :ivar workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - 'workspace_connection': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - workspace_connection: "MonitoringWorkspaceConnection", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - input_assets: Optional[Dict[str, "MonitoringInputDataBase"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource used to - calculate the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - :keyword workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = component_id - self.input_assets = input_assets - self.inputs = inputs - self.metric_thresholds = metric_thresholds - self.workspace_connection = workspace_connection - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - name: Optional[str] = None, - image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, - docker: Optional["Docker"] = None, - endpoints: Optional[List["Endpoint"]] = None, - volumes: Optional[List["VolumeDefinition"]] = None, - kernel: Optional["JupyterKernelConfig"] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.image = image - self.environment_variables = environment_variables - self.docker = docker - self.endpoints = endpoints - self.volumes = volumes - self.kernel = kernel - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - *, - connection: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = connection - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - query: Optional[str] = None, - stored_procedure: Optional[str] = None, - stored_procedure_params: Optional[List[Dict[str, str]]] = None, - table_name: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'database' # type: str - self.query = query - self.stored_procedure = stored_procedure - self.stored_procedure_params = stored_procedure_params - self.table_name = table_name - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = properties - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - *, - collections: Dict[str, "Collection"], - request_logging: Optional["RequestLogging"] = None, - rolling_rate: Optional[Union[str, "RollingRateType"]] = None, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = collections - self.request_logging = request_logging - self.rolling_rate = rolling_rate - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = data_segment - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - self.intellectual_property = intellectual_property - self.stage = stage - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - asset_name: Optional[str] = None, - source: Optional["DataImportSource"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = asset_name - self.source = source - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = properties - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataQualityMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Datastore"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer", "ModelDataCollector". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.locations = locations - self.max_instance_count = max_instance_count - self.properties = properties - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - *, - application_insights: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - required_resource_providers: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - udr: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = application_insights - self.container_registry = container_registry - self.dns_resolution = dns_resolution - self.key_vault = key_vault - self.nsg = nsg - self.others = others - self.required_resource_providers = required_resource_providers - self.resource_lock = resource_lock - self.storage_account = storage_account - self.udr = udr - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, Ray, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - privileged: Optional[bool] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.privileged = privileged - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_properties: "KeyVaultProperties", - status: Union[str, "EncryptionStatus"], - cosmos_db_resource_id: Optional[str] = None, - identity: Optional["IdentityForCmk"] = None, - search_account_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = cosmos_db_resource_id - self.identity = identity - self.key_vault_properties = key_vault_properties - self.search_account_resource_id = search_account_resource_id - self.status = status - self.storage_account_resource_id = storage_account_resource_id - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - *, - key_vault_properties: "EncryptionKeyVaultUpdateProperties", - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = key_vault_properties - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "Protocol"]] = "tcp", - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = protocol - self.name = name - self.target = target - self.published = published - self.host_ip = host_ip - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = endpoint_invocation_definition - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "EnvironmentVariableType"]] = "local", - value: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.value = value - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - auto_rebuild: Optional[Union[str, "AutoRebuildSetting"]] = None, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.auto_rebuild = auto_rebuild - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.intellectual_property = intellectual_property - self.os_type = os_type - self.provisioning_state = None - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpointsPropertyBag"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = properties - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_threshold: "FeatureAttributionMetricThreshold", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "FeatureAttributionMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "FeatureImportanceMode"]] = None, - target_column: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = mode - self.target_column = target_column - - -class FeatureProperties(ResourceBase): - """Dto object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - feature_name: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.data_type = data_type - self.feature_name = feature_name - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Feature"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetContainerProperties(AssetContainer): - """Dto object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetSpecification(msrest.serialization.Model): - """Dto object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = path - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - data_availability_status: Optional[List[Union[str, "DataAvailabilityStatus"]]] = None, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = data_availability_status - self.description = description - self.display_name = display_name - self.feature_window = feature_window - self.job_id = job_id - self.properties = properties - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - job_ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = job_ids - - -class FeaturesetVersionProperties(AssetBase): - """Dto object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - entities: Optional[List[str]] = None, - materialization_settings: Optional["MaterializationSettings"] = None, - specification: Optional["FeaturesetSpecification"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.entities = entities - self.materialization_settings = materialization_settings - self.provisioning_state = None - self.specification = specification - self.stage = stage - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """Dto object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityVersionProperties(AssetBase): - """Dto object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - index_columns: Optional[List["IndexColumn"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.index_columns = index_columns - self.provisioning_state = None - self.stage = stage - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = compute_runtime - self.offline_store_connection_name = offline_store_connection_name - self.online_store_connection_name = online_store_connection_name - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - *, - features: List[str], - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = features - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = feature_window_end - self.feature_window_start = feature_window_start - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'file_system' # type: str - self.path = path - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = columns - self.data_context = data_context - self.input_data_type = None # type: Optional[str] - self.job_input_type = job_input_type - self.uri = uri - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["ForecastingTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - features_unknown_at_forecast_time: Optional[List[str]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.features_unknown_at_forecast_time = features_unknown_at_forecast_time - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpoints"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRule(msrest.serialization.Model): - """Outbound rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = category - self.status = status - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -class GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "GenerationSafetyQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationSafetyQualityMetricThreshold"], - sampling_rate: float, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - workspace_connection_id: Optional[str] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - self.workspace_connection_id = workspace_connection_id - - -class GenerationTokenUsageMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :ivar threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "GenerationTokenUsageMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenUsageMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationTokenUsageSignal(MonitoringSignalBase): - """Generation token usage signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :ivar production_data: Gets or sets the production data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenUsageMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationTokenUsageMetricThreshold"], - sampling_rate: float, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenUsageMetricThreshold] - :keyword production_data: Gets or sets the production data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the production data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenUsageSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :vartype bonus_extra_capacity: int - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity_info: Optional["ActualCapacityInfo"] = None, - bonus_extra_capacity: Optional[int] = 0, - endpoint_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword bonus_extra_capacity: Gets or sets capacity used from the pool's reserved capacity. - :paramtype bonus_extra_capacity: int - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = actual_capacity_info - self.bonus_extra_capacity = bonus_extra_capacity - self.endpoint_count = endpoint_count - self.requested_capacity = requested_capacity - - -class HdfsDatastore(DatastoreProperties): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - name_node_address: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - hdfs_server_certificate: Optional[str] = None, - protocol: Optional[str] = "http", - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = hdfs_server_certificate - self.name_node_address = name_node_address - self.protocol = protocol - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = properties - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = idle_time_before_shutdown - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - self.version = version - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = current_image_version - self.latest_image_version = latest_image_version - self.is_latest_os_image_version = is_latest_os_image_version - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_model = checkpoint_model - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - log_training_metrics: Optional[Union[str, "LogTrainingMetrics"]] = None, - log_validation_loss: Optional[Union[str, "LogValidationLoss"]] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.log_training_metrics = log_training_metrics - self.log_validation_loss = log_validation_loss - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - *, - data_import_definition: "DataImport", - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = data_import_definition - - -class IndexColumn(msrest.serialization.Model): - """Dto object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = column_name - self.data_type = data_type - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_id: Required. [Required] Group within the same pool with which this endpoint needs - to be associated with. - :vartype group_id: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "AuthMode"], - group_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_id: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_id: str - """ - super(InferenceEndpointProperties, self).__init__(description=description, properties=properties, **kwargs) - self.auth_mode = auth_mode - self.endpoint_uri = None - self.group_id = group_id - self.provisioning_state = None - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :vartype bonus_extra_capacity: int - :ivar metadata: Metadata for the inference group. - :vartype metadata: str - :ivar priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20230801Preview.Pools.InferencePools. - :vartype priority: int - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'bonus_extra_capacity': {'key': 'bonusExtraCapacity', 'type': 'int'}, - 'metadata': {'key': 'metadata', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - bonus_extra_capacity: Optional[int] = 0, - metadata: Optional[str] = None, - priority: Optional[int] = 0, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword bonus_extra_capacity: Capacity to be used from the pool's reserved capacity. - optional. - :paramtype bonus_extra_capacity: int - :keyword metadata: Metadata for the inference group. - :paramtype metadata: str - :keyword priority: Priority of the group within the - N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20230801Preview.Pools.InferencePools. - :paramtype priority: int - """ - super(InferenceGroupProperties, self).__init__(description=description, properties=properties, **kwargs) - self.bonus_extra_capacity = bonus_extra_capacity - self.metadata = metadata - self.priority = priority - self.provisioning_state = None - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferencePoolProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar code_configuration: Code configuration for the inference pool. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar environment_configuration: EnvironmentConfiguration for the inference pool. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :ivar model_configuration: ModelConfiguration for the inference pool. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :ivar node_sku_type: Required. [Required] Compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: Request configuration for the inference pool. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'node_sku_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'PoolEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'PoolModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - *, - node_sku_type: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - code_configuration: Optional["CodeConfiguration"] = None, - environment_configuration: Optional["PoolEnvironmentConfiguration"] = None, - model_configuration: Optional["PoolModelConfiguration"] = None, - request_configuration: Optional["RequestConfiguration"] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword code_configuration: Code configuration for the inference pool. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword environment_configuration: EnvironmentConfiguration for the inference pool. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.PoolEnvironmentConfiguration - :keyword model_configuration: ModelConfiguration for the inference pool. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.PoolModelConfiguration - :keyword node_sku_type: Required. [Required] Compute instance type. - :paramtype node_sku_type: str - :keyword request_configuration: Request configuration for the inference pool. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferencePoolProperties, self).__init__(description=description, properties=properties, **kwargs) - self.code_configuration = code_configuration - self.environment_configuration = environment_configuration - self.model_configuration = model_configuration - self.node_sku_type = node_sku_type - self.provisioning_state = None - self.request_configuration = request_configuration - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferencePool"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - publisher: str, - protection_level: Optional[Union[str, "ProtectionLevel"]] = None, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = protection_level - self.publisher = publisher - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = None, - properties: Optional[Dict[str, Any]] = None, - docker_args: Optional[str] = None, - shm_size: Optional[str] = "2g", - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - self.docker_args = docker_args - self.shm_size = shm_size - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = job_definition - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint set by user. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["Nodes"] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint set by user. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.nodes = nodes - self.port = port - self.properties = properties - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - argv: Optional[List[str]] = None, - display_name: Optional[str] = None, - language: Optional[str] = None, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = argv - self.display_name = display_name - self.language = language - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosKeytabSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kerberos_keytab - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosPasswordSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kerberos_password - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - key_vault_arm_id: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = identity_client_id - self.key_identifier = key_identifier - self.key_vault_arm_id = key_vault_arm_id - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.data_collector = data_collector - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - *, - container_registry_credentials: Optional["RegistryListCredentialsResult"] = None, - notebook_access_keys: Optional["ListNotebookKeysResult"] = None, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = container_registry_credentials - self.notebook_access_keys = notebook_access_keys - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str - self.value = value - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = identity - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = include_spark - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_ready: Optional[bool] = None, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = spark_ready - self.status = status - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: Detail isolation modes for the managed network of a machine - learning workspace. - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - *, - isolation_mode: Optional[Union[str, "IsolationMode"]] = None, - outbound_rules: Optional[Dict[str, "OutboundRule"]] = None, - status: Optional["ManagedNetworkProvisionStatus"] = None, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = isolation_mode - self.network_id = None - self.outbound_rules = outbound_rules - self.status = status - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MaterializationComputeResource(msrest.serialization.Model): - """Dto object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = instance_type - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - *, - notification: Optional["NotificationSetting"] = None, - resource: Optional["MaterializationComputeResource"] = None, - schedule: Optional["RecurrenceTrigger"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "MaterializationStoreType"]] = None, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = notification - self.resource = resource - self.schedule = schedule - self.spark_configuration = spark_configuration - self.store_type = store_type - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mlflow_model' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'mlflow_model' # type: str - self.description = description - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mltable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service which - performance will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_threshold: "ModelPerformanceMetricThresholdBase", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - which performance will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The reference data used as the basis to calculate - model performance. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(ModelPerformanceSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = data_segment - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.intellectual_property = intellectual_property - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.provisioning_state = None - self.stage = stage - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The ARM resource ID of either the model or deployment targeted by this - monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - *, - compute_configuration: "MonitorComputeConfigurationBase", - signals: Dict[str, "MonitoringSignalBase"], - alert_notification_settings: Optional["MonitorNotificationSettings"] = None, - monitoring_target: Optional["MonitoringTarget"] = None, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The ARM resource ID of either the model or deployment targeted by - this monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = alert_notification_settings - self.compute_configuration = compute_configuration - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - *, - emails: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = emails - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - *, - feature: Optional[str] = None, - values: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = feature - self.values = values - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - *, - task_type: Union[str, "ModelTaskType"], - deployment_id: Optional[str] = None, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = deployment_id - self.model_id = model_id - self.task_type = task_type - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = value - - -class MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - *, - environment_variables: Optional[Dict[str, str]] = None, - secrets: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = environment_variables - self.secrets = secrets - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - *, - email_notification_settings: Optional["MonitorEmailNotificationSettings"] = None, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = email_notification_settings - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_identity: "MonitorComputeIdentityBase", - instance_type: str, - runtime_version: str, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = compute_identity - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - is_private_link_enabled: Optional[bool] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.is_private_link_enabled = is_private_link_enabled - self.notebook_preparation_error = notebook_preparation_error - self.resource_id = resource_id - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - self.webhooks = webhooks - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - artifact: "OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = artifact - self.endpoint = endpoint - self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - } - - def __init__( - self, - *, - patch_status: Optional[Union[str, "PatchStatus"]] = None, - latest_patch_time: Optional[str] = None, - reboot_pending: Optional[bool] = None, - scheduled_reboot_time: Optional[str] = None, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = patch_status - self.latest_patch_time = latest_patch_time - self.reboot_pending = reboot_pending - self.scheduled_reboot_time = scheduled_reboot_time - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OutboundRuleBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_name: Optional[str] = None, - resource_version: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Properties can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_id: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword properties: Property dictionary. Properties can be added, removed, and updated. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.properties = properties - self.tags = tags - self.target_environment_id = target_environment_id - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar properties: Property dictionary. Tags can be added, removed, and updated. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'properties': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.properties = None - self.tags = None - self.target_environment_id = None - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = description - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Optional["PartialBatchDeployment"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - *, - notification_setting: Optional["PartialNotificationSetting"] = None, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = notification_setting - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - *, - properties: Optional["PartialJobBase"] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = properties - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = tags - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) - self.sku = sku - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - self.sku = sku - - -class PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = webhooks - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["RegistryPartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - self.source_job_id = source_job_id - - -class PoolEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: dict[str, str] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - *, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - liveness_probe: Optional["ProbeSettings"] = None, - readiness_probe: Optional["ProbeSettings"] = None, - startup_probe: Optional["ProbeSettings"] = None, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: dict[str, str] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(PoolEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = environment_id - self.environment_variables = environment_variables - self.liveness_probe = liveness_probe - self.readiness_probe = readiness_probe - self.startup_probe = startup_probe - - -class PoolModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(PoolModelConfiguration, self).__init__(**kwargs) - self.model_id = model_id - - -class PoolStatus(msrest.serialization.Model): - """PoolStatus. - - :ivar actual_capacity: Gets or sets the actual number of instances in the pool. - :vartype actual_capacity: int - :ivar group_count: Gets or sets the actual number of groups in the pool. - :vartype group_count: int - :ivar requested_capacity: Gets or sets the requested number of instances for the pool. - :vartype requested_capacity: int - :ivar reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :vartype reserved_capacity: int - """ - - _attribute_map = { - 'actual_capacity': {'key': 'actualCapacity', 'type': 'int'}, - 'group_count': {'key': 'groupCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - 'reserved_capacity': {'key': 'reservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity: Optional[int] = 0, - group_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - reserved_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity: Gets or sets the actual number of instances in the pool. - :paramtype actual_capacity: int - :keyword group_count: Gets or sets the actual number of groups in the pool. - :paramtype group_count: int - :keyword requested_capacity: Gets or sets the requested number of instances for the pool. - :paramtype requested_capacity: int - :keyword reserved_capacity: Gets or sets the number of instances in the pool reserved by the - system. - :paramtype reserved_capacity: int - """ - super(PoolStatus, self).__init__(**kwargs) - self.actual_capacity = actual_capacity - self.group_count = group_count - self.requested_capacity = requested_capacity - self.reserved_capacity = reserved_capacity - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - private_endpoint: Optional["WorkspacePrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[Union[str, "PrivateEndpointConnectionProvisioningState"]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - subresource_target: Optional[str] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.spark_enabled = spark_enabled - self.spark_status = spark_status - self.subresource_target = subresource_target - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - """ - super(PrivateEndpointOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = subnet_arm_id - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - group_id: Optional[str] = None, - required_members: Optional[List[str]] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.group_id = group_id - self.required_members = required_members - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = None - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - priority: Optional[int] = None, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - self.priority = priority - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = logbase - self.rule = rule - self.seed = seed - - -class Ray(DistributionConfiguration): - """Ray distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - *, - address: Optional[str] = None, - dashboard_port: Optional[int] = None, - head_node_additional_args: Optional[str] = None, - include_dashboard: Optional[bool] = None, - port: Optional[int] = None, - worker_node_additional_args: Optional[str] = None, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = address - self.dashboard_port = dashboard_port - self.head_node_additional_args = head_node_additional_args - self.include_dashboard = include_dashboard - self.port = port - self.worker_node_additional_args = worker_node_additional_args - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "ComputeRecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["ComputeRecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "WeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.schedule = schedule - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - ml_flow_registry_uri: Optional[str] = None, - registry_private_endpoint_connections: Optional[List["RegistryPrivateEndpointConnection"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.sku = sku - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.ml_flow_registry_uri = ml_flow_registry_uri - self.registry_private_endpoint_connections = registry_private_endpoint_connections - self.public_network_access = public_network_access - self.region_details = region_details - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = passwords - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - group_ids: Optional[List[str]] = None, - private_endpoint: Optional["PrivateEndpointResource"] = None, - registry_private_link_service_connection_state: Optional["RegistryPrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = id - self.location = location - self.group_ids = group_ids - self.private_endpoint = private_endpoint - self.registry_private_link_service_connection_state = registry_private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - *, - acr_details: Optional[List["AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = acr_details - self.location = location - self.storage_account_details = storage_account_details - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Registry"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - training_settings: Optional["RegressionTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "RegressionModelPerformanceMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Regression' # type: str - self.metric = metric - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.request_timeout = request_timeout - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = capture_headers - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - *, - target_vm_size: Optional[str] = None, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = target_vm_size - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the trailing data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_offset: datetime.timedelta, - window_size: datetime.timedelta, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_offset = window_offset - self.window_size = window_size - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = properties - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "ScheduleStatus"]] = None, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = id - self.provisioning_status = provisioning_status - self.status = status - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - *, - action: "ScheduleActionBase", - trigger: "TriggerBase", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = True, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.action = action - self.display_name = display_name - self.is_enabled = is_enabled - self.provisioning_state = None - self.trigger = trigger - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Schedule"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - workspace_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = uri - self.workspace_secret_name = workspace_secret_name - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - *, - serverless_compute_custom_subnet: Optional[str] = None, - serverless_compute_no_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = serverless_compute_custom_subnet - self.serverless_compute_no_public_ip = serverless_compute_no_public_ip - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "ServerlessEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - capacity_reservation_group_id: str, - endpoint_reserved_capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. [Required] Specifies a capacity reservation - group ID to allocate capacity from. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: Specifies a capacity amount to reserve for this endpoint - within the parent capacity reservation group. - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = capacity_reservation_group_id - self.endpoint_reserved_capacity = endpoint_reserved_capacity - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible values - include: "Key", "AAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar offer: Required. [Required] The publisher-defined Serverless Offer to provision the - endpoint with. - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'inference_endpoint': {'readonly': True}, - 'offer': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - offer: "ServerlessOffer", - auth_mode: Optional[Union[str, "ServerlessInferenceEndpointAuthMode"]] = None, - capacity_reservation: Optional["ServerlessEndpointCapacityReservation"] = None, - **kwargs - ): - """ - :keyword auth_mode: Specifies the authentication mode for the Serverless endpoint. Possible - values include: "Key", "AAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: Optional capacity reservation information for the endpoint. When - specified, the Serverless Endpoint - will be allocated capacity from the specified capacity reservation group. - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword offer: Required. [Required] The publisher-defined Serverless Offer to provision the - endpoint with. - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.capacity_reservation = capacity_reservation - self.inference_endpoint = None - self.offer = offer - self.provisioning_state = None - - -class ServerlessEndpointStatus(msrest.serialization.Model): - """ServerlessEndpointStatus. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metrics: The model-specific metrics from the backing inference endpoint. - :vartype metrics: dict[str, str] - """ - - _validation = { - 'metrics': {'readonly': True}, - } - - _attribute_map = { - 'metrics': {'key': 'metrics', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ServerlessEndpointStatus, self).__init__(**kwargs) - self.metrics = None - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ServerlessEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. [Required] The name of the Serverless Offer. - :vartype offer_name: str - :ivar publisher: Required. [Required] Publisher name of the Serverless Offer. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - offer_name: str, - publisher: str, - **kwargs - ): - """ - :keyword offer_name: Required. [Required] The name of the Serverless Offer. - :paramtype offer_name: str - :keyword publisher: Required. [Required] Publisher name of the Serverless Offer. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = offer_name - self.publisher = publisher - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - *, - action: Optional[Union[str, "RuleAction"]] = None, - port_ranges: Optional[str] = None, - protocol: Optional[str] = None, - service_tag: Optional[str] = None, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = action - self.address_prefixes = None - self.port_ranges = port_ranges - self.protocol = protocol - self.service_tag = service_tag - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar status: Type of a managed network outbound rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network outbound rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network outbound rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network outbound rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'ServiceTag' # type: str - self.destination = destination - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - group_id: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.group_id = group_id - self.private_link_resource_id = private_link_resource_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] ARM resource ID of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - *, - code_id: str, - entry: "SparkJobEntry", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - archives: Optional[List[str]] = None, - args: Optional[str] = None, - conf: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - files: Optional[List[str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jars: Optional[List[str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - py_files: Optional[List[str]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["SparkResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] ARM resource ID of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Spark' # type: str - self.archives = archives - self.args = args - self.code_id = code_id - self.conf = conf - self.entry = entry - self.environment_id = environment_id - self.environment_variables = environment_variables - self.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - self.queue_settings = queue_settings - self.resources = resources - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - *, - file: str, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = file - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - *, - class_name: str, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = class_name - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = "3.1", - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_end: datetime.datetime, - window_start: datetime.datetime, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: The ARM resource ID of the component resource used to - preprocess the data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_end = window_end - self.window_start = window_start - - -class StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = system_created_storage_account - self.user_created_storage_account = user_created_storage_account - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar component_configuration: Component Configuration for sweep over component. - :vartype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'component_configuration': {'key': 'componentConfiguration', 'type': 'ComponentConfiguration'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - component_configuration: Optional["ComponentConfiguration"] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword component_configuration: Component Configuration for sweep over component. - :paramtype component_configuration: - ~azure.mgmt.machinelearningservices.models.ComponentConfiguration - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.component_configuration = component_configuration - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = acr_account_name - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = allow_blob_public_access - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_name = storage_account_name - self.storage_account_type = storage_account_type - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = size - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = top - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = inference_configuration - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'triton_model' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'triton_model' # type: str - self.description = description - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_file' # type: str - self.description = description - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_file' # type: str - self.description = description - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_folder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_folder' # type: str - self.description = description - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: The arm id of the workspace which created this connection. - :vartype created_by_workspace_arm_id: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :vartype is_shared_to_all: bool - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: whether this connection will be shared to all the project workspace - under the hub. - :paramtype is_shared_to_all: bool - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, target=target, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = properties - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, 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_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.notebook_server_port = notebook_server_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = administrator_account - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) - self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "VolumeDefinitionType"]] = "bind", - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["BindOptions"] = None, - volume: Optional["VolumeOptions"] = None, - tmpfs: Optional["TmpfsOptions"] = None, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = type - self.read_only = read_only - self.source = source - self.target = target - self.consistency = consistency - self.bind = bind - self.volume = volume - self.tmpfs = tmpfs - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = nocopy - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :vartype allow_roleassignment_on_rg: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute created in the workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'allow_roleassignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_public_access_when_behind_vnet: Optional[bool] = None, - application_insights: Optional[str] = None, - associated_workspaces: Optional[List[str]] = None, - container_registries: Optional[List[str]] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - discovery_url: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - allow_roleassignment_on_rg: Optional[bool] = None, - encryption: Optional["EncryptionProperty"] = None, - existing_workspaces: Optional[List[str]] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - hbi_workspace: Optional[bool] = None, - hub_resource_id: Optional[str] = None, - image_build_compute: Optional[str] = None, - key_vault: Optional[str] = None, - key_vaults: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - soft_delete_retention_in_days: Optional[int] = None, - storage_account: Optional[str] = None, - storage_accounts: Optional[List[str]] = None, - system_datastores_auth_mode: Optional[str] = None, - v1_legacy_mode: Optional[bool] = None, - workspace_hub_config: Optional["WorkspaceHubConfig"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :paramtype allow_roleassignment_on_rg: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute created in the workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.sku = sku - self.tags = tags - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.application_insights = application_insights - self.associated_workspaces = associated_workspaces - self.container_registries = container_registries - self.container_registry = container_registry - self.description = description - self.discovery_url = discovery_url - self.enable_data_isolation = enable_data_isolation - self.allow_roleassignment_on_rg = allow_roleassignment_on_rg - self.encryption = encryption - self.existing_workspaces = existing_workspaces - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.hbi_workspace = hbi_workspace - self.hub_resource_id = hub_resource_id - self.image_build_compute = image_build_compute - self.key_vault = key_vault - self.key_vaults = key_vaults - self.managed_network = managed_network - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = primary_user_assigned_identity - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.service_provisioned_resource_group = None - self.shared_private_link_resources = shared_private_link_resources - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.storage_account = storage_account - self.storage_accounts = storage_accounts - self.storage_hns_enabled = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.tenant_id = None - self.v1_legacy_mode = v1_legacy_mode - self.workspace_hub_config = workspace_hub_config - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = access_key_id - self.secret_access_key = secret_access_key - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = client_id - self.resource_id = resource_id - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: Optional["WorkspaceConnectionPropertiesV2"] = None, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = password - self.username = username - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_workspace_storage_accounts: Optional[List[str]] = None, - default_workspace_resource_group: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = additional_workspace_storage_accounts - self.default_workspace_resource_group = default_workspace_resource_group - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Workspace"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :vartype allow_roleassignment_on_rg: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute created in the workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'allow_roleassignment_on_rg' : {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'} - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - allow_roleassignment_on_rg: Optional[bool] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - v1_legacy_mode: Optional[bool] = None, - system_datastores_auth_mode: Optional[str] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword allow_roleassignment_on_rg: Determine whether allow workspace role assignment on resource group level. - :paramtype allow_roleassignment_on_rg: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute created in the workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - self.application_insights = application_insights - self.container_registry = container_registry - self.description = description - self.enable_data_isolation = enable_data_isolation - self.allow_roleassignment_on_rg = allow_roleassignment_on_rg - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.managed_network = managed_network - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.v1_legacy_mode = v1_legacy_mode - self.system_datastores_auth_mode = system_datastores_auth_mode diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/__init__.py deleted file mode 100644 index bec69c6b6538..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/__init__.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._capacity_reservation_groups_operations import CapacityReservationGroupsOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._jobs_operations import JobsOperations -from ._labeling_jobs_operations import LabelingJobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'CapacityReservationGroupsOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 03dd837b325a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,876 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index 73c6f3dbdad8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_capacity_reservation_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_capacity_reservation_groups_operations.py deleted file mode 100644 index 3b17145a106c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_capacity_reservation_groups_operations.py +++ /dev/null @@ -1,702 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups") # 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) - - # Construct parameters - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups") # 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) - - # Construct parameters - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}") # 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), - "groupId": _SERIALIZER.url("group_id", group_id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CapacityReservationGroupsOperations(object): - """CapacityReservationGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - """list_by_subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - """list. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - CapacityReservationGroupTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CapacityReservationGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CapacityReservationGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """get. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - group_id, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :param body: - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - group_id, # type: str - body, # type: "_models.CapacityReservationGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapacityReservationGroup" - """create_or_update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param group_id: - :type group_id: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapacityReservationGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapacityReservationGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityReservationGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapacityReservationGroup') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - group_id=group_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CapacityReservationGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index 4cb7affd9b71..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index a5a5782930fe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - hash = kwargs.pop('hash', None) # type: Optional[str] - hash_version = kwargs.pop('hash_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if hash is not None: - _query_parameters['hash'] = _SERIALIZER.query("hash", hash, 'str') - if hash_version is not None: - _query_parameters['hashVersion'] = _SERIALIZER.query("hash_version", hash_version, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - hash=None, # type: Optional[str] - hash_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 889f4e26862b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index f7275f0022ed..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,568 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_compute_operations.py deleted file mode 100644 index 75a4b670e536..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1990 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_custom_services_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_idle_shutdown_setting_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_allowed_resize_sizes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resize_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): # pylint: disable=too-many-public-methods - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - custom_services, # type: List["_models.CustomService"] - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace - def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace - def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace - def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.IdleShutdownSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get_allowed_resize_sizes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace - def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index be6151d8b59c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index ed94a2ae172d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,580 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param stage: data stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_datastores_operations.py deleted file mode 100644 index d10b164ec9e2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - _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') - if order_by is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Datastore" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index b97f0bb6c787..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 7424a9d73878..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,569 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_features_operations.py deleted file mode 100644 index 1ebaf00512c5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,359 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - feature_name = kwargs.pop('feature_name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 1000) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if feature_name is not None: - _query_parameters['featureName'] = _SERIALIZER.query("feature_name", feature_name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - "featureName": _SERIALIZER.url("feature_name", feature_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - feature_name=None, # type: Optional[str] - description=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=1000, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureResourceArmPaginatedResult"] - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :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 - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Feature" - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index 92c60de052a5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetContainersOperations(object): - """FeaturesetContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 4ba6ac614859..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,924 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_backfill_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetVersionsOperations(object): - """FeaturesetVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featuresets/{name}/versions/{version}"} # type: ignore - - def _backfill_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.FeaturesetVersionBackfillResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace - def begin_backfill( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersionBackfillResponse"] - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersionBackfillResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index d783d8af54db..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityContainersOperations(object): - """FeaturestoreEntityContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 52cadfd8c150..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityVersionsOperations(object): - """FeaturestoreEntityVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_endpoints_operations.py deleted file mode 100644 index 3f787c27ecd0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,894 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceEndpointsOperations(object): - """InferenceEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_groups_operations.py deleted file mode 100644 index 52da9eb6c2d2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_groups_operations.py +++ /dev/null @@ -1,1159 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceGroupsOperations(object): - """InferenceGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceGroup"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.GroupStatus" - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_pools_operations.py deleted file mode 100644 index ae1c0aa80d59..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_inference_pools_operations.py +++ /dev/null @@ -1,1108 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferencePoolsOperations(object): - """InferencePoolsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferencePoolTrackedResourceArmPaginatedResult"] - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferencePool"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PoolStatus" - """Retrieve inference pool status. - - Retrieve inference pool status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PoolStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PoolStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PoolStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PoolStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Pool Skus. - - List Inference Pool Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Inference Group name. - :type inference_pool_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 46f40df1b1b5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,903 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - asset_name = kwargs.pop('asset_name', None) # type: Optional[str] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - _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') - if asset_name is not None: - _query_parameters['assetName'] = _SERIALIZER.query("asset_name", asset_name, 'str') - if scheduled is not None: - _query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') - if schedule_id is not None: - _query_parameters['scheduleId'] = _SERIALIZER.query("schedule_id", schedule_id, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_cancel_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - asset_name=None, # type: Optional[str] - scheduled=None, # type: Optional[bool] - schedule_id=None, # type: Optional[str] - properties=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: 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 - :param asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - properties=properties, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - scheduled=scheduled, - schedule_id=schedule_id, - properties=properties, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.PartialJobBasePartialResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Updates a Job. - - Updates a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Creates and executes a Job. - - Creates and executes a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index 4b93211bc41e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1045 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_export_labels_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_pause_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resume_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param top: Number of labeling jobs to return. - :type top: int - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - top=top, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._export_labels_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the - status of the job export operation can be tracked. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def pause( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJobProperties" - """Pause a labeling job. - - Pause a labeling job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJobProperties, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_pause_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.LabelingJobProperties"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LabelingJobProperties"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_resume_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._resume_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace - def begin_resume( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJobProperties"] - """Resume a labeling job (asynchronous). - - Resume a labeling job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the LabelingJob. - :type id: 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LabelingJobProperties or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJobProperties] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobProperties"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resume_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJobProperties', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 6efe2280cb82..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_provision_managed_network_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkProvisionsOperations(object): - """ManagedNetworkProvisionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _provision_managed_network_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 8a0800583da1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,629 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkSettingsRuleOperations(object): - """ManagedNetworkSettingsRuleOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundRuleListResult"] - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OutboundRuleBasicResource" - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OutboundRuleBasicResource"] - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OutboundRuleBasicResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 57a95dba1a69..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index 0b7d0aa63605..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,812 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :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 - :param stage: Model stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - 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 - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - def _package_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index f52465e2cebf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _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') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index 95dab3fd1410..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_operations.py deleted file mode 100644 index fd2680bc52f0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index cec2c776726f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,501 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - body, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.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/v2023_08_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index d146605deb33..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,190 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateLinkResourceListResult"] - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - 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/v2023_08_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_quotas_operations.py deleted file mode 100644 index 165138bc0044..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registries_operations.py deleted file mode 100644 index caeb557593fe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_remove_regions_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") # 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\-_]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistriesOperations(object): - """RegistriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by subscription. - - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - 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 - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _remove_regions_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 12992fe410ee..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,636 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeContainersOperations(object): - """RegistryCodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeContainer"] - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index a3bc47279f0f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,802 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeVersionsOperations(object): - """RegistryCodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index e8227fd5287f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # 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\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentContainersOperations(object): - """RegistryComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index b77839070f68..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentVersionsOperations(object): - """RegistryComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param stage: Component stage. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index be6063cd267e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataContainersOperations(object): - """RegistryDataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index 6eee101af5ce..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataVersionsOperations(object): - """RegistryDataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataVersionBase"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 76e884fa9ef5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # 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\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentContainersOperations(object): - """RegistryEnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 45da2675d119..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,699 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _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') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentVersionsOperations(object): - """RegistryEnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :type stage: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 099d01772ace..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelContainersOperations(object): - """RegistryModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainer"] - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index 02956c4eb336..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,1036 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/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), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_package_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") # 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\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelVersionsOperations(object): - """RegistryModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :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 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type 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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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/{modelName}/versions/{version}"} # type: ignore - - def _package_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._package_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._package_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 816b72986e01..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,643 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ScheduleListViewType"]] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SchedulesOperations(object): - """SchedulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ScheduleListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ScheduleResourceArmPaginatedResult"] - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - 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 - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Schedule"] - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Schedule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 35e2daeab6a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,1217 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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] - 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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "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) - - # Construct parameters - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ServerlessEndpointsOperations(object): - """ServerlessEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ServerlessEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointAuthKeys"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointAuthKeys"] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpointStatus" - """Status of the model backing the Serverless Endpoint. - - Status of the model backing the Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpointStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpointStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_usages_operations.py deleted file mode 100644 index 2ffd3f588822..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index b83a3abb83bc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - 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/v2023_08_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 7b796dd5bf7f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - aoai_models_to_deploy = kwargs.pop('aoai_models_to_deploy', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if aoai_models_to_deploy is not None: - _query_parameters['aoaiModelsToDeploy'] = _SERIALIZER.query("aoai_models_to_deploy", aoai_models_to_deploy, '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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - aoai_models_to_deploy = kwargs.pop('aoai_models_to_deploy', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/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), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if aoai_models_to_deploy is not None: - _query_parameters['aoaiModelsToDeploy'] = _SERIALIZER.query("aoai_models_to_deploy", aoai_models_to_deploy, 'str') - - # Construct headers - _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, - **kwargs - ) - - -def build_test_connection_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection") # 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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - aoai_models_to_deploy=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionUpdateParameter"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - aoai_models_to_deploy=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param aoai_models_to_deploy: query parameter for which AOAI mode should be deployed. - :type aoai_models_to_deploy: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - aoai_models_to_deploy=aoai_models_to_deploy, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace - def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 0c93dfbb6244..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -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, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: 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) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 4ebf45e84e9c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1907 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -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 .. 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, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - force_to_purge = kwargs.pop('force_to_purge', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - if force_to_purge is not None: - _query_parameters['forceToPurge'] = _SERIALIZER.query("force_to_purge", force_to_purge, 'bool') - - # Construct headers - _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, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - accept = "application/json" - # Construct URL - _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', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _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') - - # Construct headers - _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, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: 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: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :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 - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: 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 - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 - - def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace - def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index 2805d4fbc609..e171620fd77e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -189,6 +189,12 @@ def _from_rest_object(cls, model_rest_object: ModelVersion) -> "Model": DeploymentTemplateReference(asset_id=getattr(item, "asset_id", None)) ) + # Handle intellectual_property (attribute for msrest models, camelCase mapping key for arm hybrid + # models returned by the shared arm_ml_service client). + _ip_rest = getattr(rest_model_version, "intellectual_property", None) + if _ip_rest is None and isinstance(rest_model_version, Mapping): + _ip_rest = rest_model_version.get("intellectualProperty") + model = Model( id=model_rest_object.id, name=arm_id.asset_name, @@ -203,11 +209,7 @@ def _from_rest_object(cls, model_rest_object: ModelVersion) -> "Model": creation_context=SystemData._from_rest_object(model_rest_object.system_data), type=rest_model_version.model_type, job_name=rest_model_version.job_name, - intellectual_property=( - IntellectualProperty._from_rest_object(getattr(rest_model_version, "intellectual_property", None)) - if getattr(rest_model_version, "intellectual_property", None) - else None - ), + intellectual_property=(IntellectualProperty._from_rest_object(_ip_rest) if _ip_rest else None), system_metadata=model_system_metadata, default_deployment_template=default_deployment_template, allowed_deployment_templates=allowed_deployment_templates, diff --git a/sdk/ml/azure-ai-ml/samples/ml_samples_misc.py b/sdk/ml/azure-ai-ml/samples/ml_samples_misc.py index aef2b52be46a..04c1d7ebb7a1 100644 --- a/sdk/ml/azure-ai-ml/samples/ml_samples_misc.py +++ b/sdk/ml/azure-ai-ml/samples/ml_samples_misc.py @@ -48,7 +48,7 @@ def ml_misc_config_0(self): # [END job_operations_create_and_update] # [START job_operations_list] - from azure.ai.ml._restclient.v2023_04_01_preview.models import ListViewType + from azure.ai.ml._restclient.arm_ml_service.models import ListViewType list_of_jobs = ml_client.jobs.list(parent_job_name=job_name, list_view_type=ListViewType.ARCHIVED_ONLY) # [END job_operations_list] diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py index 9d1fa83fcec6..56d366be1cf4 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py @@ -10,7 +10,7 @@ from azure.ai.ml._restclient.arm_ml_service.models import BatchDeployment as BatchDeploymentData from azure.ai.ml._restclient.arm_ml_service.models import BatchOutputAction, EndpointComputeType from azure.ai.ml._restclient.arm_ml_service._utils.model_base import _deserialize -from azure.ai.ml._restclient.v2023_04_01_preview.models import BatchPipelineComponentDeploymentConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import BatchPipelineComponentDeploymentConfiguration from azure.ai.ml._restclient.arm_ml_service.models import ( KubernetesOnlineDeployment as RestKubernetesOnlineDeployment, ) diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py index b6a0271d700b..bf42e5848e9d 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py @@ -6,7 +6,7 @@ import pytest -from azure.ai.ml._restclient.v2023_08_01_preview.models import BatchDeployment as RestBatchDeployment +from azure.ai.ml._restclient.arm_ml_service.models import BatchDeployment as RestBatchDeployment from azure.ai.ml.entities import PipelineComponent from azure.ai.ml.entities._deployment.pipeline_component_batch_deployment import PipelineComponentBatchDeployment from azure.ai.ml.entities._load_functions import load_pipeline_component_batch_deployment diff --git a/sdk/ml/azure-ai-ml/tests/command_job/e2etests/test_command_job.py b/sdk/ml/azure-ai-ml/tests/command_job/e2etests/test_command_job.py index 8d2b0832c7df..1b8644569a05 100644 --- a/sdk/ml/azure-ai-ml/tests/command_job/e2etests/test_command_job.py +++ b/sdk/ml/azure-ai-ml/tests/command_job/e2etests/test_command_job.py @@ -9,7 +9,7 @@ from azure.ai.ml import Input, MLClient, command, load_environment, load_job from azure.ai.ml._azure_environments import _get_base_url_from_metadata, _resource_to_scopes -from azure.ai.ml._restclient.v2023_04_01_preview.models import ListViewType +from azure.ai.ml._restclient.arm_ml_service.models import ListViewType from azure.ai.ml._utils._arm_id_utils import AMLVersionedArmId from azure.ai.ml.constants._common import COMMON_RUNTIME_ENV_VAR, LOCAL_COMPUTE_TARGET, TID_FMT, AssetTypes from azure.ai.ml.entities import AmlTokenConfiguration, QueueSettings diff --git a/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_entity.py b/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_entity.py index eb8fdaddbfb2..3b54309497f4 100644 --- a/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_entity.py @@ -4,7 +4,7 @@ import pytest from azure.ai.ml import Input, MpiDistribution -from azure.ai.ml._restclient.v2023_04_01_preview.models import AmlToken, JobBase +from azure.ai.ml._restclient.arm_ml_service.models import AmlToken, JobBase from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities import CommandJob, Environment, Job @@ -42,7 +42,7 @@ def test_job_name_generator(self): def test_from_rest_legacy1_command(self, mock_workspace_scope: OperationScope, file: str): with open(file, "r") as f: resource = json.load(f) - rest_job = JobBase.deserialize(resource) + rest_job = JobBase._deserialize(resource, []) print(type(rest_job.properties)) job = Job._from_rest_object(rest_job) assert job.command == "echo ${{inputs.filePath}} && ls ${{inputs.dirPath}}" @@ -50,7 +50,7 @@ def test_from_rest_legacy1_command(self, mock_workspace_scope: OperationScope, f def test_missing_input_raises(self): with open("./tests/test_configs/command_job/rest_command_job_env_var_command.json", "r") as f: resource = json.load(f) - rest_job = JobBase.deserialize(resource) + rest_job = JobBase._deserialize(resource, []) job = Job._from_rest_object(rest_job) job.command = "echo ${{inputs.missing_input}}" with pytest.raises(ValidationException): diff --git a/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py b/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py index 0da26e9a2fb5..0bc66bbbd180 100644 --- a/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py @@ -5,13 +5,13 @@ from marshmallow.exceptions import ValidationError from azure.ai.ml import load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( InputDeliveryMode, JobInputType, JobOutputType, OutputDeliveryMode, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFolderJobOutput as RestUriFolderJobOutput +from azure.ai.ml._restclient.arm_ml_service.models import UriFolderJobOutput as RestUriFolderJobOutput from azure.ai.ml._schema import CommandJobSchema from azure.ai.ml._utils.utils import is_valid_uuid, load_yaml from azure.ai.ml.constants._common import ANONYMOUS_ENV_NAME, BASE_PATH_CONTEXT_KEY, AssetTypes, InputOutputModes diff --git a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py index f4632b0e1a8c..46fad536184d 100644 --- a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py +++ b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py @@ -9,7 +9,7 @@ from azure.ai.ml import load_compute from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder from azure.ai.ml._restclient.arm_ml_service.models import ComputeResource, ImageMetadata -from azure.ai.ml._restclient.v2023_04_01_preview.models import DataFactory +from azure.ai.ml._restclient.arm_ml_service.models import DataFactory from azure.ai.ml.constants._compute import CustomApplicationDefaults from azure.ai.ml.entities import ( AmlCompute, @@ -227,7 +227,7 @@ def test_compute_instance_from_msrest_response(self): # client, so ``_from_rest_object`` must read the 2023-08 typed attributes (enableRootAccess / # releaseQuotaOnStop / enableOSPatching) -- not only the arm-hybrid wire keys produced by the # entity's own ``_to_rest_object`` round-trip. Guards the read path that only e2e exercised. - from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + from azure.ai.ml._restclient.arm_ml_service.models import ( ComputeInstance as MsrestComputeInstance, ComputeInstanceProperties as MsrestComputeInstanceProperties, ComputeResource as MsrestComputeResource, @@ -255,7 +255,7 @@ def test_aml_compute_from_msrest_response(self): # ``AmlCompute._load_from_rest`` reads ``createdOn`` from the msrest ``additional_properties`` bag # (the v2023_08 response carries it as an undeclared field). Guards against assuming the arm-hybrid # mapping shape on the real ops response. - from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + from azure.ai.ml._restclient.arm_ml_service.models import ( AmlCompute as MsrestAmlCompute, AmlComputeProperties as MsrestAmlComputeProperties, ComputeResource as MsrestComputeResource, diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py index d7b52e28ca2d..f62d0194715e 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_schema.py @@ -4,7 +4,7 @@ import azure.ai.ml._schema._datastore as DatastoreSchemaDir from azure.ai.ml import load_datastore from azure.ai.ml._restclient.arm_ml_service import models as models_arm -from azure.ai.ml._restclient.v2023_04_01_preview import models as models_preview +from azure.ai.ml._restclient.arm_ml_service import models as models_preview from azure.ai.ml._restclient.arm_ml_service.models import AzureBlobDatastore as RestAzureBlobDatastore from azure.ai.ml._restclient.arm_ml_service.models import ( AzureDataLakeGen1Datastore as RestAzureDataLakeGen1Datastore, diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py index a440a0b87d5d..84dc59d6bab5 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_serialization_regression.py @@ -6,7 +6,7 @@ Context (production regression, azure-ai-ml 1.34.0/1.35.0): ``DatastoreOperations.create_or_update`` was migrated to the arm_ml_service client (its operation serializes the request body with ``json.dumps(body, cls=SdkJSONEncoder, ...)``), but the datastore -ENTITIES still returned an old ``v2023_04_01_preview`` msrest ``Datastore`` model. ``SdkJSONEncoder`` +ENTITIES still returned an old per-version msrest ``Datastore`` model. ``SdkJSONEncoder`` can only serialize arm hybrid models, so a msrest datastore body raised ``TypeError: Object of type Datastore is not JSON serializable`` on every create/update — a hard failure for customers, invisible to the mocked unit tests and the (skipped/live-only) e2e tests. diff --git a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py index 9c23e37ef8a6..300ffa224bf8 100644 --- a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py +++ b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_env_entity.py @@ -10,7 +10,7 @@ from azure.ai.ml.entities import Component as ComponentEntity from azure.ai.ml.entities._assets import Environment from azure.ai.ml.entities._assets.environment import BuildContext -from azure.ai.ml._restclient.v2023_08_01_preview.models import EnvironmentVersion as RestEnvironment +from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentVersion as RestEnvironment @pytest.mark.unittest @@ -158,7 +158,7 @@ def test_ipp_environment(self) -> None: }, } - from_rest_environment = Environment._from_rest_object(RestEnvironment.deserialize(ipp_environment)) + from_rest_environment = Environment._from_rest_object(RestEnvironment._deserialize(ipp_environment, [])) assert from_rest_environment._intellectual_property assert from_rest_environment._intellectual_property.protection_level == "All" diff --git a/sdk/ml/azure-ai-ml/tests/feature_set/unittests/test_list_materialization_job_request.py b/sdk/ml/azure-ai-ml/tests/feature_set/unittests/test_list_materialization_job_request.py deleted file mode 100644 index b04cd3abf3dd..000000000000 --- a/sdk/ml/azure-ai-ml/tests/feature_set/unittests/test_list_materialization_job_request.py +++ /dev/null @@ -1,32 +0,0 @@ -# --------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# --------------------------------------------------------- - -import pytest -import re - - -@pytest.mark.unittest -@pytest.mark.data_experiences_test -class TestListMaterializationJobRequest: - # --------------------------------------------------------- - # Ensure list_materialization_jobs request is a POST request - # Regenerating the rest client for v2023-04-01-preview will fail this test - # because the request method is set to GET in list_materialization_jobs function - # To fix: manually update the _featureset_versions_operations.py file in rest client - # Upate: request.method = "POST" in list_materialization_jobs function - # --------------------------------------------------------- - def test_list_materialization_job_request(self) -> None: - test_path = "azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py" - with open(test_path, "r") as f: - file_contents = f.read() - start = "def list_materialization_jobs" - end = "return request" - pattern = re.compile(start + r"(.*?)" + end, re.DOTALL) - match = pattern.search(file_contents) - - assert match is not None - assert len(match.groups()) == 1 - content = match.group(1) - expectedPostRequest = 'request.method = "POST"' - assert expectedPostRequest in content diff --git a/sdk/ml/azure-ai-ml/tests/feature_store/unittests/test_feature_store_operations.py b/sdk/ml/azure-ai-ml/tests/feature_store/unittests/test_feature_store_operations.py index 194b1a1aaaba..af5dd1331a9b 100644 --- a/sdk/ml/azure-ai-ml/tests/feature_store/unittests/test_feature_store_operations.py +++ b/sdk/ml/azure-ai-ml/tests/feature_store/unittests/test_feature_store_operations.py @@ -306,7 +306,7 @@ def outgoing_get_call(rg, name): def outgoing_workspace_connection_call(resource_group_name, workspace_name, connection_name): if connection_name.startswith(OFFLINE_STORE_CONNECTION_NAME): - from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionPropertiesV2, WorkspaceConnectionPropertiesV2BasicResource, ) @@ -318,7 +318,7 @@ def outgoing_workspace_connection_call(resource_group_name, workspace_name, conn ) return resource elif connection_name.startswith(ONLINE_STORE_CONNECTION_NAME): - from azure.ai.ml._restclient.v2023_04_01_preview.models import ( + from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionPropertiesV2, WorkspaceConnectionPropertiesV2BasicResource, ) diff --git a/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py b/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py index 9e18fc1c40c5..95416333fba7 100644 --- a/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py +++ b/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py @@ -9,7 +9,7 @@ from azure.ai.ml import load_job from azure.ai.ml._azure_environments import _get_aml_resource_id_from_metadata, _resource_to_scopes -from azure.ai.ml._restclient.v2023_04_01_preview import models +from azure.ai.ml._restclient.arm_ml_service import models from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope from azure.ai.ml.constants._common import AZUREML_PRIVATE_FEATURES_ENV_VAR, AzureMLResourceType, GitProperties from azure.ai.ml.entities._builders import Command @@ -285,7 +285,7 @@ def test_update_routes_through_runhistory_patch( the correct experiment_name / run_id and a CreateRun body carrying the supplied fields. The returned entity must also be routed through _resolve_azureml_id so callers get the same resolved view they'd get from jobs.get().""" - from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType + from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType fake_job = Mock() fake_job.properties.job_type = RestJobType.COMMAND @@ -333,7 +333,7 @@ def test_update_pipeline_uses_2401_refetch( ) -> None: """PIPELINE jobs must be re-fetched via _get_job_2401 to obtain the non-projected view before the RunHistory PATCH is issued. The refreshed entity is then resolved.""" - from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType + from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType pipeline_job = Mock() pipeline_job.properties.job_type = RestJobType.PIPELINE @@ -359,7 +359,7 @@ def test_update_pipeline_child_raises( ) -> None: """A pipeline child job (properties is None on the 2401 view) must raise PipelineChildJobError and must NOT issue any RunHistory PATCH.""" - from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType + from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType from azure.ai.ml.exceptions import PipelineChildJobError parent_view = Mock() @@ -393,7 +393,7 @@ def test_create_or_update_metadata_shortcut_uses_runhistory_patch( """For a Job that was previously fetched (has an ARM id) and is being resubmitted with only metadata edits (no compute/experiment_name change), create_or_update must route through the RunHistory PATCH shortcut and skip the legacy MFE PUT round-trip.""" - from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType + from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType fake_job = Mock() fake_job.properties.job_type = RestJobType.COMMAND @@ -437,7 +437,7 @@ def test_create_or_update_metadata_shortcut_uses_runhistory_patch( def test_parse_corrupt_job_data(self, mocker: MockFixture, corrupt_job_data: str) -> None: with open(corrupt_job_data, "r") as f: resource = json.load(f) - resource = models.JobBase.deserialize(resource) + resource = models.JobBase._deserialize(resource, []) with pytest.raises(Exception, match="Unknown search space type"): # Convert from REST object Job._from_rest_object(resource) diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py index 041b14bdfcdf..0454920b4d37 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_schema.py @@ -77,10 +77,8 @@ def test_ipp_model(self) -> None: "systemData": {}, } - # intellectual_property is a workspace-model field (v2023_08); deserialize into that model for this test. - from azure.ai.ml._restclient.v2023_08_01_preview.models import ModelVersion as ModelVersion2308 - - from_rest_ipp_model = Model._from_rest_object(ModelVersion2308.deserialize(rest_ipp_model)) + # intellectual_property is preserved on the arm hybrid model as a camelCase mapping key. + from_rest_ipp_model = Model._from_rest_object(ModelVersion._deserialize(rest_ipp_model, [])) assert from_rest_ipp_model._intellectual_property assert from_rest_ipp_model._intellectual_property.protection_level == "All" diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index c5f791d6a1ea..7e0ce75a83b3 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -11,7 +11,7 @@ from test_utilities.utils import omit_with_wildcard, verify_entity_load_and_dump from azure.ai.ml import Input, MLClient, dsl, load_component, load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase as RestJob +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as RestJob from azure.ai.ml._schema.automl import AutoMLRegressionSchema from azure.ai.ml._utils.utils import dump_yaml_to_file, load_yaml from azure.core.serialization import as_attribute_dict diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py index d02eeadee04f..e01dc2febed9 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py @@ -12,16 +12,16 @@ from pytest_mock import MockFixture from azure.ai.ml import MLClient, load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( JobOutput as RestJobOutput, ) from azure.core.serialization import as_attribute_dict -from azure.ai.ml._restclient.v2023_04_01_preview.models import MLTableJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import MLTableJobInput +from azure.ai.ml._restclient.arm_ml_service.models import ( PipelineJob as RestPipelineJob, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFolderJobInput -from azure.ai.ml._restclient.v2023_04_01_preview.models._azure_machine_learning_workspaces_enums import ( +from azure.ai.ml._restclient.arm_ml_service.models import UriFolderJobInput +from azure.ai.ml._restclient.arm_ml_service.models import ( LearningRateScheduler, StochasticOptimizer, ) diff --git a/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py b/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py index 781897ba691d..605d4cb62b11 100644 --- a/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_entity.py @@ -1,9 +1,9 @@ import pytest from azure.ai.ml import Input, Output -from azure.ai.ml._restclient.v2023_04_01_preview.models import AmlToken, JobBase -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJob as RestSparkJob -from azure.ai.ml._restclient.v2023_04_01_preview.models import SparkJobPythonEntry +from azure.ai.ml._restclient.arm_ml_service.models import AmlToken, JobBase +from azure.ai.ml._restclient.arm_ml_service.models import SparkJob as RestSparkJob +from azure.ai.ml._restclient.arm_ml_service.models import SparkJobPythonEntry from azure.ai.ml.entities import SparkJob from azure.ai.ml.entities._builders.spark_func import spark from azure.ai.ml.entities._job.job_name_generator import generate_job_name diff --git a/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_schema.py b/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_schema.py index 9f6cb2b54449..a19509a38fed 100644 --- a/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/spark_job/unittests/test_spark_job_schema.py @@ -4,7 +4,7 @@ import yaml from azure.ai.ml import Input, load_job -from azure.ai.ml._restclient.v2023_04_01_preview.models import InputDeliveryMode, JobOutputType, OutputDeliveryMode +from azure.ai.ml._restclient.arm_ml_service.models import InputDeliveryMode, JobOutputType, OutputDeliveryMode from azure.ai.ml._schema import SparkJobSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.entities import SparkJob diff --git a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py index 4780fa1196ca..d8ff98918d73 100644 --- a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py +++ b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job.py @@ -48,9 +48,7 @@ def test_sweep_job_top_level_properties(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs={ "input1": { "path": "top_level.csv", @@ -87,9 +85,7 @@ def test_sweep_job_override_missing_properties(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs=None, ) rest = sweep._to_rest_object() @@ -125,19 +121,14 @@ def test_sampling_algorithm_to_rest(self, sampling_algorithm, expected_rest_type sweep = SweepJob( sampling_algorithm=sampling_algorithm, trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs={"input1": {"file": "top_level.csv", "mode": "ro_mount"}}, compute="top_level", limits=SweepJobLimits(trial_timeout=600), ) rest = sweep._to_rest_object() - assert ( - rest.properties.sampling_algorithm.sampling_algorithm_type - == expected_rest_type - ) + assert rest.properties.sampling_algorithm.sampling_algorithm_type == expected_rest_type @pytest.mark.parametrize( "sampling_algorithm, expected_from_rest_type", @@ -150,9 +141,7 @@ def test_sampling_algorithm_to_rest(self, sampling_algorithm, expected_rest_type (BayesianSamplingAlgorithm(), "bayesian"), ], ) - def test_sampling_algorithm_from_rest( - self, sampling_algorithm, expected_from_rest_type - ): + def test_sampling_algorithm_from_rest(self, sampling_algorithm, expected_from_rest_type): command_job = CommandJob( code=Code(base_path="./src"), command="python train.py --ss {search_space.ss}", @@ -166,9 +155,7 @@ def test_sampling_algorithm_from_rest( sweep = SweepJob( sampling_algorithm=sampling_algorithm, trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs={"input1": Input(path="trial.csv")}, compute="top_level", limits=SweepJobLimits(trial_timeout=600), @@ -207,9 +194,7 @@ def test_random_sampling_object_with_props(self, properties_dict): sweep = SweepJob( sampling_algorithm=random_sampling_algorithm, trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs={"input1": Input(path="trial.csv")}, compute="top_level", limits=SweepJobLimits(trial_timeout=600), @@ -285,9 +270,7 @@ def test_sweep_job_builder_serialization(self) -> None: command="echo ${{inputs.uri}} ${{search_space.lr}} ${{search_space.lr2}}", distribution=MpiDistribution(), environment_variables={"EVN1": "VAR1"}, - resources=JobResourceConfiguration( - instance_count=2, instance_type="STANDARD_BLA" - ), + resources=JobResourceConfiguration(instance_count=2, instance_type="STANDARD_BLA"), code="./", ) @@ -351,9 +334,7 @@ def test_sweep_job_trial_distribution_to_rest(self, distribution) -> None: sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs={ "input1": { "path": "top_level.csv", @@ -367,11 +348,7 @@ def test_sweep_job_trial_distribution_to_rest(self, distribution) -> None: ) rest_obj = sweep._to_rest_object() - ( - rest_obj.properties.trial.distribution == distribution._to_rest_object() - if distribution - else None - ) + (rest_obj.properties.trial.distribution == distribution._to_rest_object() if distribution else None) # validate from rest scenario sweep_job: SweepJob = Job._from_rest_object(rest_obj) @@ -404,9 +381,7 @@ def test_sweep_job_resources_to_rest(self, resources) -> None: sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, inputs={ "input1": { "path": "top_level.csv", @@ -421,11 +396,7 @@ def test_sweep_job_resources_to_rest(self, resources) -> None: ) rest_obj = sweep._to_rest_object() - ( - rest_obj.properties.get("resources") == resources._to_rest_object() - if resources - else None - ) + (rest_obj.properties.get("resources") == resources._to_rest_object() if resources else None) # validate from rest scenario sweep_job: SweepJob = Job._from_rest_object(rest_obj) @@ -436,12 +407,6 @@ def test_sweep_job_resources_to_rest(self, resources) -> None: assert sweep_job.identity == sweep.identity if sweep_job.resources: if "instance_type" in sweep.resources: - assert ( - sweep_job.resources.instance_type - == sweep.resources["instance_type"] - ) + assert sweep_job.resources.instance_type == sweep.resources["instance_type"] if "instance_count" in sweep.resources: - assert ( - sweep_job.resources.instance_count - == sweep.resources["instance_count"] - ) + assert sweep_job.resources.instance_count == sweep.resources["instance_count"] diff --git a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py index 855ad24c4ee2..29da7b79d41e 100644 --- a/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/sweep_job/unittests/test_sweep_job_schema.py @@ -7,7 +7,7 @@ from azure.ai.ml import load_job from azure.ai.ml._restclient.arm_ml_service.models import AmlToken as RestAmlToken -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( InputDeliveryMode, JobInputType, JobOutputType, @@ -15,8 +15,8 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedIdentity as RestManagedIdentity, ) -from azure.ai.ml._restclient.v2023_04_01_preview.models import OutputDeliveryMode -from azure.ai.ml._restclient.v2023_04_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import OutputDeliveryMode +from azure.ai.ml._restclient.arm_ml_service.models import ( UriFolderJobOutput as RestUriFolderJobOutput, ) from azure.ai.ml._restclient.arm_ml_service.models import ( @@ -108,9 +108,7 @@ def test_search_space_to_rest(self, search_space: SweepDistribution, expected): (QLogUniform(1.0, 10.0, 3), ["qloguniform", [1.0, 10.0, 3]]), ], ) - def test_search_space_from_rest( - self, expected: SweepDistribution, rest_search_space - ): + def test_search_space_from_rest(self, expected: SweepDistribution, rest_search_space): command_job = CommandJob( code="./src", command="python train.py --ss {search_space.ss}", @@ -140,9 +138,7 @@ def test_search_space_from_rest( (JobResourceConfiguration(instance_count=2), {"instance_count": 2}), ], ) - def test_resources_from_rest( - self, expected_resources: JobResourceConfiguration, rest_resources - ): + def test_resources_from_rest(self, expected_resources: JobResourceConfiguration, rest_resources): command_job = CommandJob( code="./src", command="python train.py --ss {search_space.ss}", @@ -173,9 +169,7 @@ def test_resources_from_rest( (JobResourceConfiguration(instance_count=2), {"instance_count": 2}), ], ) - def test_resources_to_rest( - self, rest_resources: JobResourceConfiguration, expected_resources - ): + def test_resources_to_rest(self, rest_resources: JobResourceConfiguration, expected_resources): command_job = CommandJob( code="./src", command="python train.py --lr 0.01", @@ -195,15 +189,9 @@ def test_resources_to_rest( rest_resources_obj = rest.properties.get("resources") if rest_resources_obj: if "instance_count" in expected_resources: - assert ( - rest_resources_obj.instance_count - == expected_resources["instance_count"] - ) + assert rest_resources_obj.instance_count == expected_resources["instance_count"] if "instance_type" in expected_resources: - assert ( - rest_resources_obj.instance_type - == expected_resources["instance_type"] - ) + assert rest_resources_obj.instance_type == expected_resources["instance_type"] def test_sweep_with_ints(self): expected_rest = ["quniform", [1, 100, 1]] @@ -219,9 +207,7 @@ def test_sweep_with_ints(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": QUniform(type="quniform", min_value=1, max_value=100, q=1) - }, + search_space={"ss": QUniform(type="quniform", min_value=1, max_value=100, q=1)}, ) rest = sweep._to_rest_object() sweep: SweepJob = Job._from_rest_object(rest) @@ -250,9 +236,7 @@ def test_sweep_with_floats(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": QUniform(type="quniform", min_value=1.1, max_value=100.12, q=1) - }, + search_space={"ss": QUniform(type="quniform", min_value=1.1, max_value=100.12, q=1)}, ) rest = sweep._to_rest_object() sweep: SweepJob = Job._from_rest_object(rest) @@ -285,100 +269,53 @@ def test_sweep_with_string(self): assert vars(sweep.search_space["ss"]) == expected_ss def test_inputs_types_sweep_job(self): - original_entity = load_job( - Path("./tests/test_configs/sweep_job/sweep_job_input_types.yml") - ) + original_entity = load_job(Path("./tests/test_configs/sweep_job/sweep_job_input_types.yml")) rest_representation = to_rest_job_object(original_entity) reconstructed_entity = Job._from_rest_object(rest_representation) assert original_entity.inputs["test_dataset"].mode is None - assert ( - rest_representation.properties.inputs["test_dataset"].job_input_type - == JobInputType.URI_FOLDER - ) + assert rest_representation.properties.inputs["test_dataset"].job_input_type == JobInputType.URI_FOLDER assert rest_representation.properties.inputs["test_dataset"].mode is None assert reconstructed_entity.inputs["test_dataset"].mode is None assert original_entity.inputs["test_url"].mode == InputOutputModes.RO_MOUNT assert original_entity.inputs["test_url"].type == AssetTypes.URI_FILE assert original_entity.inputs["test_url"].path == "azureml://fake/url.json" - assert ( - rest_representation.properties.inputs["test_url"].job_input_type - == JobInputType.URI_FILE - ) - assert ( - rest_representation.properties.inputs["test_url"].mode - == InputDeliveryMode.READ_ONLY_MOUNT - ) - assert ( - rest_representation.properties.inputs["test_url"].uri - == "azureml://fake/url.json" - ) + assert rest_representation.properties.inputs["test_url"].job_input_type == JobInputType.URI_FILE + assert rest_representation.properties.inputs["test_url"].mode == InputDeliveryMode.READ_ONLY_MOUNT + assert rest_representation.properties.inputs["test_url"].uri == "azureml://fake/url.json" assert reconstructed_entity.inputs["test_url"].mode == InputOutputModes.RO_MOUNT assert reconstructed_entity.inputs["test_url"].type == AssetTypes.URI_FILE assert reconstructed_entity.inputs["test_url"].path == "azureml://fake/url.json" assert original_entity.inputs["test_string_literal"] == "literal string" - assert ( - rest_representation.properties.inputs["test_string_literal"].job_input_type - == JobInputType.LITERAL - ) - assert ( - rest_representation.properties.inputs["test_string_literal"].value - == "literal string" - ) + assert rest_representation.properties.inputs["test_string_literal"].job_input_type == JobInputType.LITERAL + assert rest_representation.properties.inputs["test_string_literal"].value == "literal string" assert reconstructed_entity.inputs["test_string_literal"] == "literal string" assert original_entity.inputs["test_literal_valued_int"] == 42 - assert ( - rest_representation.properties.inputs[ - "test_literal_valued_int" - ].job_input_type - == JobInputType.LITERAL - ) - assert ( - rest_representation.properties.inputs["test_literal_valued_int"].value - == "42" - ) + assert rest_representation.properties.inputs["test_literal_valued_int"].job_input_type == JobInputType.LITERAL + assert rest_representation.properties.inputs["test_literal_valued_int"].value == "42" assert reconstructed_entity.inputs["test_literal_valued_int"] == "42" def test_outputs_types_standalone_jobs(self): - original_entity = load_job( - Path("./tests/test_configs/sweep_job/sweep_job_output_types.yml") - ) + original_entity = load_job(Path("./tests/test_configs/sweep_job/sweep_job_output_types.yml")) rest_representation = to_rest_job_object(original_entity) - dummy_default = RestUriFolderJobOutput( - uri="azureml://foo", mode=OutputDeliveryMode.READ_WRITE_MOUNT - ) + dummy_default = RestUriFolderJobOutput(uri="azureml://foo", mode=OutputDeliveryMode.READ_WRITE_MOUNT) rest_representation.properties.outputs["default"] = dummy_default reconstructed_entity = Job._from_rest_object(rest_representation) assert original_entity.outputs["test1"] is None - assert ( - rest_representation.properties.outputs["test1"].job_output_type - == JobOutputType.URI_FOLDER - ) + assert rest_representation.properties.outputs["test1"].job_output_type == JobOutputType.URI_FOLDER assert rest_representation.properties.outputs["test1"].mode is None assert original_entity.outputs["test2"].mode == InputOutputModes.UPLOAD - assert ( - rest_representation.properties.outputs["test2"].job_output_type - == JobOutputType.URI_FOLDER - ) - assert ( - rest_representation.properties.outputs["test2"].mode - == OutputDeliveryMode.UPLOAD - ) + assert rest_representation.properties.outputs["test2"].job_output_type == JobOutputType.URI_FOLDER + assert rest_representation.properties.outputs["test2"].mode == OutputDeliveryMode.UPLOAD assert original_entity.outputs["test3"].mode == InputOutputModes.RW_MOUNT - assert ( - rest_representation.properties.outputs["test3"].job_output_type - == JobOutputType.URI_FOLDER - ) - assert ( - rest_representation.properties.outputs["test3"].mode - == OutputDeliveryMode.READ_WRITE_MOUNT - ) + assert rest_representation.properties.outputs["test3"].job_output_type == JobOutputType.URI_FOLDER + assert rest_representation.properties.outputs["test3"].mode == OutputDeliveryMode.READ_WRITE_MOUNT assert reconstructed_entity.outputs["default"].path == "azureml://foo" def test_sweep_with_dicts(self): @@ -395,9 +332,7 @@ def test_sweep_with_dicts(self): sweep = SweepJob( sampling_algorithm="random", trial=command_job, - search_space={ - "ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}]) - }, + search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])}, ) rest = sweep._to_rest_object() sweep: SweepJob = Job._from_rest_object(rest) @@ -425,15 +360,10 @@ def test_sweep_termination_roundtrip(self): rest_intermediate = internal_representation._to_rest_object() internal_obj = SweepJob._from_rest_object(rest_intermediate) reconstructed_yaml = schema.dump(internal_obj) - assert ( - reconstructed_yaml["early_termination"]["type"] - == cfg["early_termination"]["type"] - ) + assert reconstructed_yaml["early_termination"]["type"] == cfg["early_termination"]["type"] def test_sweep_search_space_environment_variables(self): - sweep: SweepJob = load_job( - Path("./tests/test_configs/sweep_job/sweep-search.yaml") - ) + sweep: SweepJob = load_job(Path("./tests/test_configs/sweep_job/sweep-search.yaml")) # This is to guard against using mutable values as default for constructor args assert sweep.search_space["dropout_rate"] != sweep.search_space["dropout_rate2"] @@ -443,26 +373,20 @@ def test_sweep_search_space_environment_variables(self): assert f"--{param} ${{{{search_space.{param}}}}}" in rest_command def test_sweep_job_recursive_search_space(self): - yaml_path = Path( - "./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml" - ) + yaml_path = Path("./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml") with open(yaml_path, "r") as f: yaml_job = yaml.safe_load(f) - job: SweepJob = load_job( - Path("./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml") - ) + job: SweepJob = load_job(Path("./tests/test_configs/sweep_job/sweep_job_recursive_search_space.yaml")) rest_job = job._to_rest_object() - with open( - "./tests/test_configs/sweep_job/expected_recursive_search_space.json" - ) as f: + with open("./tests/test_configs/sweep_job/expected_recursive_search_space.json") as f: expected_recursive_search_space = json.load(f) assert rest_job.properties.search_space == expected_recursive_search_space from_rest_sweep_job = Job._from_rest_object(rest_job) - assert json.loads(json.dumps(from_rest_sweep_job._to_dict()))[ - "search_space" - ] == json.loads(json.dumps(yaml_job["search_space"])) + assert json.loads(json.dumps(from_rest_sweep_job._to_dict()))["search_space"] == json.loads( + json.dumps(yaml_job["search_space"]) + ) @pytest.mark.parametrize( "yaml_path,expected_sampling_algorithm", @@ -478,9 +402,7 @@ def test_sweep_job_recursive_search_space(self): ), ], ) - def test_sampling_algorithm_string_preservation( - self, yaml_path: str, expected_sampling_algorithm: str - ): + def test_sampling_algorithm_string_preservation(self, yaml_path: str, expected_sampling_algorithm: str): sweep_entity: SweepJob = load_job(Path(yaml_path)) assert isinstance(sweep_entity.sampling_algorithm, str) assert sweep_entity.sampling_algorithm == expected_sampling_algorithm @@ -502,9 +424,7 @@ def test_sampling_algorithm_string_preservation( ), ], ) - def test_sampling_algorithm_object_preservation( - self, yaml_path: str, expected_sampling_algorithm: str - ): + def test_sampling_algorithm_object_preservation(self, yaml_path: str, expected_sampling_algorithm: str): sweep_entity = load_job(Path(yaml_path)) assert isinstance(sweep_entity.sampling_algorithm, SamplingAlgorithm) assert sweep_entity.sampling_algorithm.type == expected_sampling_algorithm @@ -539,9 +459,7 @@ def test_sampling_algorithm_object_preservation( ), ], ) - def test_sampling_algorithm_object_properties( - self, yaml_path: str, property_name: str, expected_value: Any - ): + def test_sampling_algorithm_object_properties(self, yaml_path: str, property_name: str, expected_value: Any): sweep_entity = load_job(Path(yaml_path)) assert isinstance(sweep_entity.sampling_algorithm, SamplingAlgorithm) assert sweep_entity.sampling_algorithm.__dict__[property_name] == expected_value @@ -567,9 +485,7 @@ def test_identity_to_rest(self, identity, rest_identity): sampling_algorithm="random", trial=command_job, identity=identity, - search_space={ - "ss": QUniform(type="quniform", min_value=1, max_value=100, q=1) - }, + search_space={"ss": QUniform(type="quniform", min_value=1, max_value=100, q=1)}, ) rest = sweep._to_rest_object() From d44f08f0debf5db0408bd1387da7e05312520e61 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 20:30:30 +0530 Subject: [PATCH 097/146] Add explicit CHANGELOG entry for datastore mixed-tree serialization fix --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index f221703f23f5..5f7bfb82c1ee 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features Added ### Bugs Fixed +- Fixed `MLClient.datastores.create_or_update` failing with `TypeError: Object of type Datastore is not JSON serializable` for every datastore type (Blob, File, Gen1, Gen2, OneLake, Hdfs). The datastore operation client serialized request bodies with the shared `arm_ml_service` encoder (`SdkJSONEncoder`), but the datastore entities still returned a legacy per-version msrest `Datastore` model that the encoder could not serialize. Datastore entities now build `arm_ml_service` bodies, resolving the mixed-tree serialization regression. - Fixed `MLClient.jobs.create_or_update`, `archive`, and `restore` failing for previously-fetched jobs across all job types by routing metadata-only edits through the RunHistory PATCH endpoint. - Fixed `DeploymentTemplate.creation_context` always being `None` when retrieved via `get()` or `list()`. The created/modified timestamps and identity returned by the service (as `createdTime` / `modifiedTime` / `createdBy`) are now populated on `creation_context`, making `DeploymentTemplate` consistent with `Model` and `Environment`. - Fixed `BatchEndpoint` defaults serialization regression where `deployment_name` was sent to the service as snake_case instead of camelCase (`deploymentName`), causing `begin_create_or_update` to fail with "Could not find member 'deployment_name' on object of type 'BatchEndpointDefaults'". Serialization now emits the correct camelCase wire format, while `BatchEndpoint.defaults` returned from `get()` continues to expose an object that supports attribute access (e.g. `endpoint.defaults.deployment_name`), preserving backward compatibility with existing code and samples. From 1bcf98175b1632ac0a3ee8052e2171ec0f856305 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 10 Jul 2026 20:35:47 +0530 Subject: [PATCH 098/146] Revert duplicate datastore CHANGELOG entry (already documented on upstream/main) --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index 5f7bfb82c1ee..f221703f23f5 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -5,7 +5,6 @@ ### Features Added ### Bugs Fixed -- Fixed `MLClient.datastores.create_or_update` failing with `TypeError: Object of type Datastore is not JSON serializable` for every datastore type (Blob, File, Gen1, Gen2, OneLake, Hdfs). The datastore operation client serialized request bodies with the shared `arm_ml_service` encoder (`SdkJSONEncoder`), but the datastore entities still returned a legacy per-version msrest `Datastore` model that the encoder could not serialize. Datastore entities now build `arm_ml_service` bodies, resolving the mixed-tree serialization regression. - Fixed `MLClient.jobs.create_or_update`, `archive`, and `restore` failing for previously-fetched jobs across all job types by routing metadata-only edits through the RunHistory PATCH endpoint. - Fixed `DeploymentTemplate.creation_context` always being `None` when retrieved via `get()` or `list()`. The created/modified timestamps and identity returned by the service (as `createdTime` / `modifiedTime` / `createdBy`) are now populated on `creation_context`, making `DeploymentTemplate` consistent with `Model` and `Environment`. - Fixed `BatchEndpoint` defaults serialization regression where `deployment_name` was sent to the service as snake_case instead of camelCase (`deploymentName`), causing `begin_create_or_update` to fail with "Could not find member 'deployment_name' on object of type 'BatchEndpointDefaults'". Serialization now emits the correct camelCase wire format, while `BatchEndpoint.defaults` returned from `get()` continues to expose an object that supports attribute access (e.g. `endpoint.defaults.deployment_name`), preserving backward compatibility with existing code and samples. From 5df2e44ae4652d273797009eb2ca3c79fb2f5bc7 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 14:19:36 +0530 Subject: [PATCH 099/146] Regenerate api.md + api.metadata.yml for arm_ml_service migration --- sdk/ml/azure-ai-ml/api.md | 21 +++++++++------------ sdk/ml/azure-ai-ml/api.metadata.yml | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/api.md b/sdk/ml/azure-ai-ml/api.md index 9be2ca290999..02ff4e846845 100644 --- a/sdk/ml/azure-ai-ml/api.md +++ b/sdk/ml/azure-ai-ml/api.md @@ -6685,7 +6685,7 @@ namespace azure.ai.ml.entities @experimental - class azure.ai.ml.entities.ModelPackage(Resource, PackageRequest): + class azure.ai.ml.entities.ModelPackage(Resource): property base_path: str # Read-only property creation_context: Optional[SystemData] # Read-only property id: Optional[str] # Read-only @@ -9908,14 +9908,14 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: ServiceClient2020404Preview, + service_client: ServiceClient042024PreviewArm, connections_operations: WorkspaceConnectionsOperations ): ... def list( self, connection_name: str, - **kwargs + **kwargs: Any ) -> Iterable[AzureOpenAIDeployment]: ... @@ -10061,7 +10061,7 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient012024, ServiceClient102021Dataplane], + service_client: ServiceClient012024, all_operations: OperationsContainer, preflight_operation: Optional[DeploymentsOperations] = None, **kwargs: Dict @@ -10141,7 +10141,7 @@ namespace azure.ai.ml.operations operation_scope: OperationScope, operation_config: OperationConfig, service_client: ServiceClient022023Preview, - service_client_2024: ServiceClient042024Preview, + service_client_2024_arm: ServiceClient042024PreviewArm, **kwargs: Dict ) -> None: ... @@ -10233,8 +10233,7 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient042023_preview, ServiceClient102021Dataplane], - service_client_012024_preview: ServiceClient012024_preview, + service_client: ServiceClient042023_preview, datastore_operations: DatastoreOperations, **kwargs: Any ): ... @@ -10326,7 +10325,6 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - serviceclient_2024_01_01_preview: ServiceClient012024Preview, serviceclient_2024_10_01_preview: ServiceClient102024Preview, **kwargs: Dict ): ... @@ -10454,7 +10452,7 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient042023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient042023Preview, all_operations: OperationsContainer, **kwargs: Any ): ... @@ -10515,7 +10513,7 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient082023Preview, datastore_operations: DatastoreOperations, all_operations: Optional[OperationsContainer] = None, **kwargs: dict @@ -11002,7 +11000,7 @@ namespace azure.ai.ml.operations self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient082023Preview, ServiceClient102021Dataplane], + service_client: ServiceClient082023Preview, datastore_operations: DatastoreOperations, service_client_model_dataplane: ServiceClientModelDataPlane = None, all_operations: Optional[OperationsContainer] = None, @@ -11266,7 +11264,6 @@ namespace azure.ai.ml.operations operation_scope: OperationScope, operation_config: OperationConfig, service_client_06_2023_preview: ServiceClient062023Preview, - service_client_01_2024_preview: ServiceClient012024Preview, all_operations: OperationsContainer, credential: TokenCredential, **kwargs: Any diff --git a/sdk/ml/azure-ai-ml/api.metadata.yml b/sdk/ml/azure-ai-ml/api.metadata.yml index 14c9e4ed800a..c6789b6c57f6 100644 --- a/sdk/ml/azure-ai-ml/api.metadata.yml +++ b/sdk/ml/azure-ai-ml/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 81371e37ca26ea3c761bdb2104b7a0b89a0026216a97510bc16f533cf936e2d9 +apiMdSha256: cafe2d1eac23a18bf16a585b789ffeeacf37f5606e32cafbe37a5bbca3d33fad parserVersion: 0.3.28 pythonVersion: 3.12.10 From 674c5c6c314ff34242f92b11bfc027a991d5cecb Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 15:03:38 +0530 Subject: [PATCH 100/146] Fix ComputeOperations test fixture: service_client_2024 -> service_client_2024_arm --- .../tests/compute/unittests/test_compute_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py index a1bcff924a12..7e7b624ee88c 100644 --- a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py +++ b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py @@ -30,7 +30,7 @@ def mock_compute_operation( operation_scope=mock_workspace_scope, operation_config=mock_operation_config, service_client=mock_aml_services_2023_08_01_preview, - service_client_2024=mock_aml_services_2023_04_01_preview, + service_client_2024_arm=mock_aml_services_2023_04_01_preview, ) From fdbafd8829e5830770e85133222743badf6daf29 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 15:33:14 +0530 Subject: [PATCH 101/146] Fix stage param leak + rewrite registry unit tests for arm_ml_service raw-HTTP paths --- .../ai/ml/operations/_evaluator_operations.py | 4 +- .../ai/ml/operations/_model_operations.py | 4 +- .../test_component_operations_registry.py | 99 +++++++++---------- .../dataset/unittests/test_data_operations.py | 53 +++++----- .../test_environment_operations_registry.py | 39 ++++---- 5 files changed, 90 insertions(+), 109 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py index 7d6a0fc566b3..e01f910540bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_evaluator_operations.py @@ -195,7 +195,9 @@ def list( cls=lambda objs: [Model._from_rest_object(obj) for obj in objs], list_view_type=list_view_type, properties=properties_str, - stage=stage, + # The arm_ml_service ModelVersions.list has no typed ``stage`` param; send it as a + # query param (byte-identical to the legacy client) instead of leaking it to the transport. + **({"params": {"stage": stage}} if stage else {}), **self._model_op._scope_kwargs, ) ), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index d8708c89262e..15d8d3797fa9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -633,7 +633,9 @@ def list( workspace_name=self._workspace_name, cls=lambda objs: [Model._from_rest_object(obj) for obj in objs], list_view_type=list_view_type, - stage=stage, + # The arm_ml_service ModelVersions.list has no typed ``stage`` param; send it as a + # query param (byte-identical to the legacy client) instead of leaking it to the transport. + **({"params": {"stage": stage}} if stage else {}), **self._scope_kwargs, ) ), diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py index c49929e00ca4..c0086734d8b6 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py @@ -29,6 +29,7 @@ def mock_component_operation( operation_config=mock_operation_config, service_client=mock_aml_services_2021_10_01_dataplanepreview, all_operations=mock_machinelearning_registry_client._operation_container, + registry_service_client=mock_aml_services_2021_10_01_dataplanepreview, ) @@ -44,11 +45,13 @@ def test_create_in_non_ipp_registry(self, mock_component_operation: ComponentOpe with patch.object(ComponentOperations, "_resolve_arm_id_or_upload_dependencies") as mock_thing, patch( "azure.ai.ml.operations._component_operations.Component._from_rest_object", return_value=CommandComponent(), - ): + ), patch( + "azure.ai.ml.operations._component_operations.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch("azure.ai.ml.operations._component_operations.polling_wait"): mock_component_operation.create_or_update(component) mock_thing.assert_called_once() - mock_component_operation._version_operation.begin_create_or_update.assert_called_once() + mock_create.assert_called_once() @pytest.mark.usefixtures("enable_private_preview_schema_features") def test_create_in_ipp_registry(self, mock_component_operation: ComponentOperations) -> None: @@ -63,79 +66,67 @@ def test_create_in_ipp_registry(self, mock_component_operation: ComponentOperati with patch.object(ComponentOperations, "_resolve_arm_id_or_upload_dependencies") as mock_thing, patch( "azure.ai.ml.operations._component_operations.Component._from_rest_object", return_value=CommandComponent(), - ): + ), patch( + "azure.ai.ml.operations._component_operations.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch("azure.ai.ml.operations._component_operations.polling_wait"): mock_component_operation.create_or_update(component) # for IPP components, we need to make sure _resolve_arm_id_or_upload_dependencies is not called mock_thing.assert_not_called() + mock_create.assert_called_once() + def test_list(self, mock_component_operation: ComponentOperations) -> None: - mock_component_operation.list(name="mock") - mock_component_operation._version_operation.list.assert_called_once() - mock_component_operation.list() - mock_component_operation._container_operation.list.assert_called_once() + with patch("azure.ai.ml.operations._component_operations.list_registry_assets") as mock_list: + mock_component_operation.list(name="mock") + mock_component_operation.list() + assert mock_list.call_count == 2 def test_get(self, mock_component_operation: ComponentOperations) -> None: - with patch("azure.ai.ml.operations._component_operations.Component") as mock_component_entity: + with patch("azure.ai.ml.operations._component_operations.get_registry_versioned_asset") as mock_get, patch( + "azure.ai.ml.operations._component_operations.Component" + ) as mock_component_entity, patch.object(ComponentVersionData, "_deserialize", return_value=Mock()): mock_component_operation.get("mock_component", "1") - mock_component_operation._version_operation.get.assert_called_once() - create_call_args_str = str(mock_component_operation._version_operation.get.call_args) - assert "name='mock_component'" in create_call_args_str - assert "version='1'" in create_call_args_str + mock_get.assert_called_once() + create_call_args_str = str(mock_get.call_args) + assert "mock_component" in create_call_args_str + assert "'1'" in create_call_args_str mock_component_entity._from_rest_object.assert_called_once() def test_archive_version(self, mock_component_operation: ComponentOperations): name = "random_name" - component = Mock(ComponentVersionData(properties=Mock(ComponentVersionDetails()))) version = "1" - mock_component_operation._version_operation.get.return_value = component - mock_component_operation.archive(name=name, version=version) - - mock_component_operation._version_operation.begin_create_or_update.assert_called_with( - name=name, - version=version, - registry_name=mock_component_operation._registry_name, - body=component, - resource_group_name=mock_component_operation._resource_group_name, - ) + with patch("azure.ai.ml._utils._registry_utils.get_registry_versioned_asset"), patch( + "azure.ai.ml._utils._registry_utils.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch.object(ComponentVersionData, "_deserialize", return_value=Mock()): + mock_component_operation.archive(name=name, version=version) + + mock_create.assert_called_once() def test_restore_version(self, mock_component_operation: ComponentOperations): name = "random_name" - component = Mock(ComponentVersionData(properties=Mock(ComponentVersionDetails()))) version = "1" - mock_component_operation._version_operation.get.return_value = component - mock_component_operation.restore(name=name, version=version) - - mock_component_operation._version_operation.begin_create_or_update.assert_called_with( - name=name, - version=version, - registry_name=mock_component_operation._registry_name, - body=component, - resource_group_name=mock_component_operation._resource_group_name, - ) + with patch("azure.ai.ml._utils._registry_utils.get_registry_versioned_asset"), patch( + "azure.ai.ml._utils._registry_utils.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch.object(ComponentVersionData, "_deserialize", return_value=Mock()): + mock_component_operation.restore(name=name, version=version) + + mock_create.assert_called_once() def test_archive_container(self, mock_component_operation: ComponentOperations): name = "random_name" - component = Mock(ComponentContainerData(properties=Mock(ComponentContainerDetails()))) - mock_component_operation._container_operation.get.return_value = component - mock_component_operation.archive(name=name) - - mock_component_operation._container_operation.begin_create_or_update.assert_called_with( - name=name, - registry_name=mock_component_operation._registry_name, - body=component, - resource_group_name=mock_component_operation._resource_group_name, - ) + with patch("azure.ai.ml._utils._registry_utils.get_registry_container_asset"), patch( + "azure.ai.ml._utils._registry_utils.begin_create_or_update_registry_container" + ) as mock_create, patch.object(ComponentContainerData, "_deserialize", return_value=Mock()): + mock_component_operation.archive(name=name) + + mock_create.assert_called_once() def test_restore_container(self, mock_component_operation: ComponentOperations): name = "random_name" - component = Mock(ComponentContainerData(properties=Mock(ComponentContainerDetails()))) - mock_component_operation._container_operation.get.return_value = component - mock_component_operation.restore(name=name) - - mock_component_operation._container_operation.begin_create_or_update.assert_called_with( - name=name, - registry_name=mock_component_operation._registry_name, - body=component, - resource_group_name=mock_component_operation._resource_group_name, - ) + with patch("azure.ai.ml._utils._registry_utils.get_registry_container_asset"), patch( + "azure.ai.ml._utils._registry_utils.begin_create_or_update_registry_container" + ) as mock_create, patch.object(ComponentContainerData, "_deserialize", return_value=Mock()): + mock_component_operation.restore(name=name) + + mock_create.assert_called_once() diff --git a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py index ceb7bd89718b..7415292d3fcf 100644 --- a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py +++ b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py @@ -82,6 +82,7 @@ def mock_data_operations_in_registry( datastore_operations=mock_datastore_operation, requests_pipeline=mock_machinelearning_client._requests_pipeline, all_operations=mock_machinelearning_client._operation_container, + registry_service_client=mock_aml_services_2022_10_01, ) @@ -118,27 +119,14 @@ def test_list(self, mock_data_operations: DataOperations) -> None: mock_data_operations._operation.list.assert_called_once() def test_list_in_registry(self, mock_data_operations_in_registry: DataOperations) -> None: - mock_data_operations_in_registry._operation.list.return_value = [Mock(Data) for _ in range(10)] - mock_data_operations_in_registry._container_operation.list.return_value = [Mock(Data) for _ in range(10)] - mock_data_operations_in_registry.list(name="random_name") - mock_data_operations_in_registry._operation.list.assert_called_once_with( - name="random_name", - resource_group_name=Test_Resource_Group, - registry_name=Test_Registry_Name, - list_view_type=ANY, - cls=ANY, - ) + with patch("azure.ai.ml.operations._data_operations.list_registry_assets") as mock_list: + mock_data_operations_in_registry.list(name="random_name") + mock_list.assert_called_once() def test_list_in_registry_no_name(self, mock_data_operations_in_registry: DataOperations) -> None: - mock_data_operations_in_registry._operation.list.return_value = [Mock(Data) for _ in range(10)] - mock_data_operations_in_registry._container_operation.list.return_value = [Mock(Data) for _ in range(10)] - mock_data_operations_in_registry.list() - mock_data_operations_in_registry._container_operation.list.assert_called_once_with( - resource_group_name=Test_Resource_Group, - registry_name=Test_Registry_Name, - list_view_type=ANY, - cls=ANY, - ) + with patch("azure.ai.ml.operations._data_operations.list_registry_assets") as mock_list: + mock_data_operations_in_registry.list() + mock_list.assert_called_once() def test_get_with_version(self, mock_data_operations: DataOperations) -> None: name_only = "some_name" @@ -154,11 +142,16 @@ def test_get_in_registry_with_version(self, mock_data_operations_in_registry: Da name_only = "some_name" version = "1" data_asset = Data(name=name_only, version=version) - with patch.object(ItemPaged, "next"), patch.object(Data, "_from_rest_object", return_value=data_asset): + with patch( + "azure.ai.ml.operations._data_operations.get_registry_versioned_asset" + ) as mock_get, patch( + "azure.ai.ml.operations._data_operations.DataVersionBase._deserialize", return_value=Mock() + ), patch.object(Data, "_from_rest_object", return_value=data_asset): mock_data_operations_in_registry.get(name_only, version) - mock_data_operations_in_registry._operation.get.assert_called_once_with( - name=name_only, version=version, resource_group_name=Test_Resource_Group, registry_name=Test_Registry_Name - ) + mock_get.assert_called_once() + get_call_args_str = str(mock_get.call_args) + assert name_only in get_call_args_str + assert "'1'" in get_call_args_str def test_get_no_version(self, mock_data_operations: DataOperations) -> None: name = "random_name" @@ -219,16 +212,14 @@ def test_create_or_update_in_registry( return_value=(data, "indicatorfile.txt"), ), patch("azure.ai.ml.operations._data_operations.Data._from_rest_object", return_value=data), patch( "azure.ai.ml.operations._data_operations.get_sas_uri_for_registry_asset", return_value="test_sas_uri" - ) as mock_sas_uri: + ) as mock_sas_uri, patch( + "azure.ai.ml.operations._data_operations.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch( + "azure.ai.ml.operations._data_operations.DataVersionBase._deserialize", return_value=Mock() + ): mock_data_operations_in_registry.create_or_update(data) mock_sas_uri.assert_called_once() - mock_data_operations_in_registry._operation.begin_create_or_update.assert_called_once_with( - name="testFileData", - version="1", - registry_name=Test_Registry_Name, - resource_group_name=Test_Resource_Group, - body=ANY, - ) + mock_create.assert_called_once() def test_create_with_mltable_pattern_path( self, diff --git a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py index e1b4d616552d..9440b5cfe61f 100644 --- a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py +++ b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py @@ -23,6 +23,7 @@ def mock_environment_operation( operation_config=mock_operation_config, service_client=mock_aml_services_2021_10_01_dataplanepreview, all_operations=mock_machinelearning_registry_client._operation_container, + registry_service_client=mock_aml_services_2021_10_01_dataplanepreview, ) @@ -30,33 +31,23 @@ def mock_environment_operation( class TestEnvironmentOperation: def test_archive_version(self, mock_environment_operation: EnvironmentOperations): name = "random_name" - env_version = Mock(EnvironmentVersionData(properties=Mock(EnvironmentVersionDetails()))) version = "1" - mock_environment_operation._version_operations.get.return_value = env_version - mock_environment_operation.archive(name=name, version=version) + with patch("azure.ai.ml._utils._registry_utils.get_registry_versioned_asset"), patch( + "azure.ai.ml._utils._registry_utils.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch.object(EnvironmentVersionData, "_deserialize", return_value=Mock()): + mock_environment_operation.archive(name=name, version=version) - mock_environment_operation._version_operations.begin_create_or_update.assert_called_with( - name=name, - version=version, - registry_name=mock_environment_operation._registry_name, - body=env_version, - resource_group_name=mock_environment_operation._resource_group_name, - ) + mock_create.assert_called_once() def test_restore_version(self, mock_environment_operation: EnvironmentOperations): name = "random_name" - env_version = Mock(EnvironmentVersionData(properties=Mock(EnvironmentVersionDetails()))) version = "1" - mock_environment_operation._version_operations.get.return_value = env_version - mock_environment_operation.restore(name=name, version=version) + with patch("azure.ai.ml._utils._registry_utils.get_registry_versioned_asset"), patch( + "azure.ai.ml._utils._registry_utils.begin_create_or_update_registry_versioned_asset" + ) as mock_create, patch.object(EnvironmentVersionData, "_deserialize", return_value=Mock()): + mock_environment_operation.restore(name=name, version=version) - mock_environment_operation._version_operations.begin_create_or_update.assert_called_with( - name=name, - version=version, - registry_name=mock_environment_operation._registry_name, - body=env_version, - resource_group_name=mock_environment_operation._resource_group_name, - ) + mock_create.assert_called_once() def test_create_or_update_sas_uri_success(self, mock_environment_operation: EnvironmentOperations): env = load_environment(source="./tests/test_configs/environment/environment_conda.yml") @@ -66,7 +57,9 @@ def test_create_or_update_sas_uri_success(self, mock_environment_operation: Envi "azure.ai.ml.operations._environment_operations.get_sas_uri_for_registry_asset", return_value="some_sas_uri" ), patch( "azure.ai.ml.operations._environment_operations._check_and_upload_env_build_context" - ) as check_upload: + ) as check_upload, patch( + "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset" + ), patch.object(EnvironmentVersionData, "_deserialize", return_value=Mock()): mock_environment_operation.create_or_update(env) check_upload.assert_called_once() @@ -78,6 +71,8 @@ def test_create_or_update_sas_uri_failure(self, mock_environment_operation: Envi "azure.ai.ml.operations._environment_operations.get_sas_uri_for_registry_asset", return_value=None ), patch( "azure.ai.ml.operations._environment_operations._check_and_upload_env_build_context" - ) as check_upload: + ) as check_upload, patch( + "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset" + ), patch.object(EnvironmentVersionData, "_deserialize", return_value=Mock()): mock_environment_operation.create_or_update(env) check_upload.assert_not_called() From 6f9f3b7ffac419959a1e5673ed24f583b2351c6e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 15:37:13 +0530 Subject: [PATCH 102/146] Rewrite model registry get tests for arm_ml_service raw-HTTP paths --- .../model/unittests/test_model_operations.py | 78 +++++++++++-------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_operations.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_operations.py index 37761ae5c842..4685536abd24 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_operations.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_operations.py @@ -595,35 +595,41 @@ def test_get_with_registry_with_version(self, mock_model_operation_reg: ModelOpe """Test _get_with_registry retrieves model with specific version from registry.""" name = "test_model" version = "1" - mock_model_version = Mock(ModelVersionData(properties=Mock(ModelVersionDetails()))) - mock_model_operation_reg._model_versions_operation.get.return_value = mock_model_version - - result = mock_model_operation_reg._get_with_registry(name=name, version=version) - - mock_model_operation_reg._model_versions_operation.get.assert_called_once_with( - name=name, - version=version, - registry_name=mock_model_operation_reg._registry_name, - **mock_model_operation_reg._scope_kwargs, + sentinel = Mock() + with patch( + "azure.ai.ml.operations._model_operations.get_registry_versioned_asset", + return_value={"properties": {}}, + ) as mock_get_asset, patch.object(ModelVersionData, "_deserialize", return_value=sentinel): + result = mock_model_operation_reg._get_with_registry(name=name, version=version) + + mock_get_asset.assert_called_once_with( + mock_model_operation_reg._registry_service_client, + "models", + name, + version, + mock_model_operation_reg._resource_group_name, + mock_model_operation_reg._registry_name, ) - assert result == mock_model_version - assert mock_model_operation_reg._model_container_operation.get.call_count == 0 + assert result == sentinel def test_get_with_registry_without_version(self, mock_model_operation_reg: ModelOperations) -> None: """Test _get_with_registry retrieves model container when no version specified.""" name = "test_model" - mock_model_container = Mock(ModelContainerData(properties=Mock(ModelContainerDetails()))) - mock_model_operation_reg._model_container_operation.get.return_value = mock_model_container - - result = mock_model_operation_reg._get_with_registry(name=name, version=None) - - mock_model_operation_reg._model_container_operation.get.assert_called_once_with( - name=name, - registry_name=mock_model_operation_reg._registry_name, - **mock_model_operation_reg._scope_kwargs, + sentinel = Mock() + with patch( + "azure.ai.ml.operations._model_operations.get_registry_container_asset", + return_value={"properties": {}}, + ) as mock_get_container, patch.object(ModelContainerData, "_deserialize", return_value=sentinel): + result = mock_model_operation_reg._get_with_registry(name=name, version=None) + + mock_get_container.assert_called_once_with( + mock_model_operation_reg._registry_service_client, + "models", + name, + mock_model_operation_reg._resource_group_name, + mock_model_operation_reg._registry_name, ) - assert result == mock_model_container - assert mock_model_operation_reg._model_versions_operation.get.call_count == 0 + assert result == sentinel def test_get_delegates_to_workspace(self, mock_model_operation: ModelOperations) -> None: """Test _get method delegates to _get_with_workspace when workspace is set.""" @@ -646,15 +652,19 @@ def test_get_delegates_to_registry(self, mock_model_operation_reg: ModelOperatio """Test _get method delegates to _get_with_registry when registry is set.""" name = "test_model" version = "1" - mock_model_version = Mock(ModelVersionData(properties=Mock(ModelVersionDetails()))) - mock_model_operation_reg._model_versions_operation.get.return_value = mock_model_version - - result = mock_model_operation_reg._get(name=name, version=version) - - mock_model_operation_reg._model_versions_operation.get.assert_called_once_with( - name=name, - version=version, - registry_name=mock_model_operation_reg._registry_name, - **mock_model_operation_reg._scope_kwargs, + sentinel = Mock() + with patch( + "azure.ai.ml.operations._model_operations.get_registry_versioned_asset", + return_value={"properties": {}}, + ) as mock_get_asset, patch.object(ModelVersionData, "_deserialize", return_value=sentinel): + result = mock_model_operation_reg._get(name=name, version=version) + + mock_get_asset.assert_called_once_with( + mock_model_operation_reg._registry_service_client, + "models", + name, + version, + mock_model_operation_reg._resource_group_name, + mock_model_operation_reg._registry_name, ) - assert result == mock_model_version + assert result == sentinel From 4ad927b266bc0cb44f426d5ff4d6082ab6ce8976 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 15:43:53 +0530 Subject: [PATCH 103/146] Fix job runhistory test attr, UnsupportedCompute additional_properties guard, compute-instance arm wire-key test --- .../ai/ml/entities/_compute/unsupported_compute.py | 6 +++++- .../tests/compute/unittests/test_compute_entity.py | 13 +++++++------ .../job_common/unittests/test_job_operations.py | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py index 131146c0c0c7..fd7786a379cf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py @@ -30,6 +30,10 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "UnsupportedCompute": tags = rest_obj.tags else: tags = None + # arm_ml_service hybrid models (e.g. DataFactory) do not expose the msrest ``additional_properties`` + # bag; guard the read so unsupported computes still load. + _additional_properties = getattr(prop, "additional_properties", None) + created_on = _additional_properties.get("createdOn", None) if _additional_properties else None response = UnsupportedCompute( name=rest_obj.name, id=rest_obj.id, @@ -38,7 +42,7 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "UnsupportedCompute": resource_id=prop.resource_id, tags=tags, provisioning_state=prop.provisioning_state, - created_on=prop.additional_properties.get("createdOn", None), + created_on=created_on, ) return response diff --git a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py index 46fad536184d..29c542419ed2 100644 --- a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py +++ b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py @@ -237,14 +237,15 @@ def test_compute_instance_from_msrest_response(self): name="ci-from-service", location="eastus", properties=MsrestComputeInstance( - properties=MsrestComputeInstanceProperties( - vm_size="STANDARD_DS3_V2", - enable_root_access=False, - release_quota_on_stop=True, - enable_os_patching=True, - ), + properties=MsrestComputeInstanceProperties(vm_size="STANDARD_DS3_V2"), ), ) + # arm_ml_service ComputeInstanceProperties does not declare enableRootAccess / releaseQuotaOnStop / + # enableOSPatching as typed fields; the real response carries them as camelCase wire keys, which + # ``_from_rest_object`` reads via the hybrid mapping's ``.get()``. + rest.properties.properties["enableRootAccess"] = False + rest.properties.properties["releaseQuotaOnStop"] = True + rest.properties.properties["enableOSPatching"] = True instance = ComputeInstance._from_rest_object(rest) assert instance.enable_root_access is False diff --git a/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py b/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py index 95416333fba7..8b99b4f46534 100644 --- a/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py +++ b/sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py @@ -425,7 +425,7 @@ def test_create_or_update_metadata_shortcut_uses_runhistory_patch( assert body.tags == {"k": "v"} assert body.properties == {"pk": "pv"} # Legacy MFE PUT paths must be untouched when the shortcut succeeds. - mock_job_operation.service_client_01_2024_preview.jobs.create_or_update.assert_not_called() + mock_job_operation.service_client_01_2024_preview_arm.jobs.create_or_update.assert_not_called() mock_job_operation._operation_2023_02_preview.create_or_update.assert_not_called() @pytest.mark.parametrize( From 0a0dd5823bd8d47cbe97300e47276610d9eb66d0 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 15:59:30 +0530 Subject: [PATCH 104/146] Fix command_builder tests: arm as_dict camelCase resources + version-robust distribution key normalization --- .../dsl/unittests/test_command_builder.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py index f76f5d5cabab..ee71bda3e649 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_command_builder.py @@ -41,6 +41,13 @@ from .._util import _DSL_TIMEOUT_SECOND +def _snake_keys(d: dict) -> dict: + # The arm_ml_service hybrid distribution dict exposes typed fields by their snake_case attribute + # name and un-modeled (e.g. Ray) fields by their camelCase wire key, and the discriminator casing + # can differ across Python versions. Normalize to snake_case so the content comparison is stable. + return {re.sub(r"(? Date: Mon, 13 Jul 2026 16:03:52 +0530 Subject: [PATCH 105/146] Fix model deployment-template tests for arm hybrid wire-key storage --- .../unittests/test_model_allowed_deployment_templates.py | 7 ++++--- .../unittests/test_model_default_deployment_template.py | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py index a1453b2df91c..67992844ec4f 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_allowed_deployment_templates.py @@ -313,6 +313,7 @@ def test_model_round_trip_rest_with_both_templates(self) -> None: # Now simulate deserialization from the REST object # We can't do a full round-trip via _from_rest_object because it expects ARM IDs, - # but we can verify the REST serialization is correct - assert rest_object.properties.allowed_deployment_templates[0].asset_id == allowed[0].asset_id - assert rest_object.properties.allowed_deployment_templates[1].asset_id == allowed[1].asset_id + # but we can verify the REST serialization is correct. arm ModelVersionProperties has no typed + # ``allowed_deployment_templates`` field; the templates are carried as camelCase wire keys. + assert rest_object.properties["allowedDeploymentTemplates"][0]["assetId"] == allowed[0].asset_id + assert rest_object.properties["allowedDeploymentTemplates"][1]["assetId"] == allowed[1].asset_id diff --git a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py index c8df1afbe18b..255fe24ca764 100644 --- a/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py +++ b/sdk/ml/azure-ai-ml/tests/model/unittests/test_model_default_deployment_template.py @@ -182,6 +182,9 @@ def test_model_from_rest_object_without_default_deployment_template(self) -> Non rest_properties.stage = "Production" rest_properties.job_name = None rest_properties.intellectual_property = None + # arm ModelVersionProperties is a MutableMapping; make the mapping ``.get()`` return None so the + # optional camelCase template/IP keys are treated as absent (response without those fields). + rest_properties.get = Mock(return_value=None) rest_object = Mock(spec=ModelVersion) rest_object.id = "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/ws/models/test-model/versions/1" From 6e1e057ce86e4cd40b941182e8a78ad051143646 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 16:07:59 +0530 Subject: [PATCH 106/146] Fix mfe_url test (_config.base_url for TSP clients) + storage_utils registry env create patch --- .../tests/internal_utils/unittests/test_ml_client.py | 4 ++-- .../tests/internal_utils/unittests/test_storage_utils.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_ml_client.py b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_ml_client.py index 3000967945f4..aa7f3a55942f 100644 --- a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_ml_client.py +++ b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_ml_client.py @@ -125,8 +125,8 @@ def test_mfe_url_overwrite(self, mock_get_mfe_url_override, mock_credential): # TSP-generated workspaces client keeps `_client._base_url` as the literal "{endpoint}" # template and stores the resolved endpoint on `_config.base_url`. assert ml_client.workspaces._operation._config.base_url == mock_url - assert ml_client.compute._operation._client._base_url == mock_url - assert ml_client.jobs._operation_2023_02_preview._client._base_url == mock_url + assert ml_client.compute._operation._config.base_url == mock_url + assert ml_client.jobs._operation_2023_02_preview._config.base_url == mock_url assert ml_client.jobs._kwargs["enforce_https"] is False # @patch("azure.ai.ml._ml_client.RegistryOperations", Mock()) diff --git a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py index 757a469c49ae..f0ae3a4b520d 100644 --- a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py +++ b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py @@ -265,6 +265,9 @@ def test_show_progress_disabled_env( ), patch( "azure.ai.ml.operations._environment_operations.get_sas_uri_for_registry_asset", return_value="mocksasuri", + ), patch( + "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset", + return_value={"properties": {}}, ): mock_environment_operation.create_or_update(environment) mock_thing.assert_called_once_with( From f7bd0a331c43de734a0d348a4719fe7daa9c59c3 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 18:08:06 +0530 Subject: [PATCH 107/146] Fix batch deployment list_jobs test: mock requests pipeline (raw MFE HTTP path) --- .../batch_services/unittests/test_batch_deployment.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment.py b/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment.py index dddd4a215364..b03a25832da3 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment.py +++ b/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment.py @@ -115,12 +115,14 @@ def test_list_deployment_jobs( return_value="https://somebatch-url.com", ) mockresponse = Mock() - mockresponse.text = '{"key": "value"}' + mockresponse.text = Mock(return_value='{"value": [], "nextLink": null}') mockresponse.status_code = 200 - mocker.patch("requests.request", return_value=mockresponse) + # The v2020_09 dataplane list-jobs op has no arm equivalent; the migrated code pages the MFE + # endpoint via the raw requests pipeline, so mock that instead of the old client method. + mocker.patch.object(mock_batch_deployment_operations._requests_pipeline, "get", return_value=mockresponse) mock_batch_deployment_operations.list_jobs(endpoint_name="batch-ept", name="testdeployment") - mock_batch_deployment_operations._batch_job_deployment.list.assert_called_once() + mock_batch_deployment_operations._requests_pipeline.get.assert_called_once() def test_delete_batch_endpoint( self, From d30c6042e146dd7cc169f34539843dc487fff1bb Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 18:12:36 +0530 Subject: [PATCH 108/146] Fix batch endpoint list_jobs tests (pipeline mock) + pipeline-component from_rest (_deserialize) --- .../test_pipeline_component_bach_deployment.py | 2 +- .../unittests/test_batch_endpoints.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py index bf42e5848e9d..aab870f37b45 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_pipeline_component_bach_deployment.py @@ -75,7 +75,7 @@ def test_to_dict(self) -> None: def test_from_rest_object(self) -> None: with open(TestPipelineComponentBatchDeployment.HELLO_BATCH_DEPLOYMENT_REST, "r") as file: - pipeline_component_rest = RestBatchDeployment.from_dict(json.load(file)) + pipeline_component_rest = RestBatchDeployment._deserialize(json.load(file), []) pipeline_component_rest.properties.additional_properties = { "deploymentConfiguration": { "componentId": {"assetId": "azureml:hello_batch@latest"}, diff --git a/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_endpoints.py b/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_endpoints.py index a0c3ad70be5b..0acc2aec223c 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_endpoints.py +++ b/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_endpoints.py @@ -285,12 +285,14 @@ def test_list_endpoint_jobs( return_value="https://some-url.com", ) mockresponse = Mock() - mockresponse.text = '{"key": "value"}' + mockresponse.text = Mock(return_value='{"value": [], "nextLink": null}') mockresponse.status_code = 200 - mocker.patch("requests.request", return_value=mockresponse) + # list_jobs pages the MFE endpoint via the raw requests pipeline (no arm equivalent for the + # v2020_09 dataplane op), so mock that pipeline rather than the old client method. + mocker.patch.object(mock_batch_endpoint_operations._requests_pipeline, "get", return_value=mockresponse) mock_batch_endpoint_operations.list_jobs(endpoint_name="ept") - mock_batch_endpoint_operations._batch_job_endpoint.list.assert_called_once() + mock_batch_endpoint_operations._requests_pipeline.get.assert_called_once() def test_list_deployment_jobs( self, mock_batch_endpoint_operations: BatchEndpointOperations, mocker: MockFixture @@ -300,12 +302,14 @@ def test_list_deployment_jobs( return_value="https://some-url.com", ) mockresponse = Mock() - mockresponse.text = '{"key": "value"}' + mockresponse.text = Mock(return_value='{"value": [], "nextLink": null}') mockresponse.status_code = 200 - mocker.patch("requests.request", return_value=mockresponse) + # list_jobs pages the MFE endpoint via the raw requests pipeline (no arm equivalent for the + # v2020_09 dataplane op), so mock that pipeline rather than the old client method. + mocker.patch.object(mock_batch_endpoint_operations._requests_pipeline, "get", return_value=mockresponse) mock_batch_endpoint_operations.list_jobs(endpoint_name="ept") - mock_batch_endpoint_operations._batch_job_endpoint.list.assert_called_once() + mock_batch_endpoint_operations._requests_pipeline.get.assert_called_once() def test_batch_get( self, From 25eda61d907cd9ac62a7858d9854545fc9ea06a9 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 18:29:41 +0530 Subject: [PATCH 109/146] Fix pipeline_job_entity rest-fixture deserialize: camelize snake fixtures for arm JobBase._deserialize --- .../unittests/test_pipeline_job_entity.py | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index 7e0ce75a83b3..c6a15ff2f5ff 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -47,9 +47,39 @@ from .._util import _PIPELINE_JOB_TIMEOUT_SECOND +def _rest_job_from_dict(job_dict): + """Build an arm JobBase from a (msrest-era) rest fixture. + + arm ``JobBase._deserialize`` expects camelCase wire keys, but these fixtures are authored in + snake_case (fully, or just for the input/output ``*_type`` discriminators). Camelize the + envelope + ``properties`` schema field keys and the input/output *field* keys (never the + user-defined input/output/job names, nor free-form ``tags``/``properties``/``settings``/``jobs`` + values, which downstream entity code reads as-is) so the arm discriminators resolve. + """ + from azure.ai.ml._utils.utils import snake_to_camel + + d = json.loads(json.dumps(job_dict)) + d = {snake_to_camel(k): v for k, v in d.items()} + props = d.get("properties") + if isinstance(props, dict): + new_props = {} + for k, v in props.items(): + ck = snake_to_camel(k) + if k in ("inputs", "outputs") and isinstance(v, dict): + new_props[ck] = { + name: ({snake_to_camel(fk): fv for fk, fv in fields.items()} if isinstance(fields, dict) else fields) + for name, fields in v.items() + } + else: + # jobs / tags / properties / settings values are free-form and read as-is downstream. + new_props[ck] = v + d["properties"] = new_props + return RestJob._deserialize(d, []) + + def load_pipeline_entity_from_rest_json(job_dict) -> PipelineJob: """Rest pipeline json -> rest pipeline object -> pipeline entity""" - rest_obj = RestJob.from_dict(json.loads(json.dumps(job_dict))) + rest_obj = _rest_job_from_dict(job_dict) internal_pipeline = PipelineJob._from_rest_object(rest_obj) return internal_pipeline @@ -239,7 +269,7 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self): rest_job_file = "./tests/test_configs/pipeline_jobs/invalid/with_invalid_job_input_type_mode.json" with open(rest_job_file, "r") as f: job_dict = yaml.safe_load(f) - rest_obj = RestJob.from_dict(json.loads(json.dumps(job_dict))) + rest_obj = _rest_job_from_dict(job_dict) pipeline = PipelineJob._from_rest_object(rest_obj) pipeline_dict = pipeline._to_dict() assert pydash.omit(pipeline_dict["jobs"], *["properties", "hello_python_world_job.properties"]) == { From b87c8e0ff19a5789040446583fedc1d4ee0a0fe5 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 18:34:18 +0530 Subject: [PATCH 110/146] Fix wire helper to serialize plain-dict rest objects (feature store) --- sdk/ml/azure-ai-ml/tests/smoke_serialization/_wire.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_wire.py index 5bb2bed04104..ff697f3d2019 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_wire.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_wire.py @@ -39,6 +39,10 @@ def serialize_wire(rest_obj): if getattr(rest_obj, "_is_model", False) is True: # arm hybrid: serialize exactly the way the generated operation does. return json.loads(json.dumps(rest_obj, cls=SdkJSONEncoder, exclude_readonly=True)) + if isinstance(rest_obj, dict): + # Some migrated entities (e.g. feature store) build the camelCase wire body as a plain dict + # directly; serialize it the same way the generated operation would (handles nested hybrids). + return json.loads(json.dumps(rest_obj, cls=SdkJSONEncoder, exclude_readonly=True)) # msrest: ``.serialize()`` already returns the camelCase wire dict and omits readonly fields. return rest_obj.serialize() From a44a31a6fed02d763854793c421344c720cd963a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Mon, 13 Jul 2026 21:44:28 +0530 Subject: [PATCH 111/146] Apply black formatting to migration-modified source and test files --- .../azure/ai/ml/entities/_builders/sweep.py | 58 +--- .../ml/entities/_job/_input_output_helpers.py | 69 +--- .../finetuning/azure_openai_finetuning_job.py | 34 +- .../azure_openai_hyperparameters.py | 4 +- .../azure/ai/ml/entities/_job/job_limits.py | 4 +- .../ml/entities/_job/pipeline/pipeline_job.py | 190 +++-------- .../ai/ml/entities/_job/queue_settings.py | 32 +- .../ai/ml/entities/_job/spark_job_entry.py | 18 +- .../_job/spark_resource_configuration.py | 24 +- .../_job/sweep/early_termination_policy.py | 32 +- .../ai/ml/entities/_job/sweep/objective.py | 4 +- .../entities/_job/sweep/sampling_algorithm.py | 28 +- .../ai/ml/entities/_job/sweep/sweep_job.py | 84 ++--- .../ai/ml/entities/_monitoring/signals.py | 212 +++---------- .../test_component_operations_registry.py | 8 +- .../dataset/unittests/test_data_operations.py | 4 +- .../unittests/test_controlflow_pipeline.py | 129 ++------ .../unittests/test_dsl_pipeline_samples.py | 51 +-- .../test_dsl_pipeline_with_specific_nodes.py | 297 +++++------------- .../tests/dsl/unittests/test_io_builder.py | 106 ++----- .../test_environment_operations_registry.py | 8 +- .../test_finetuning_job_convesion.py | 179 +++-------- .../internal/unittests/test_pipeline_job.py | 127 ++------ .../unittests/test_pipeline_job_entity.py | 4 +- .../azure-ai-ml/tests/test_utilities/utils.py | 47 +-- 25 files changed, 440 insertions(+), 1313 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py index 5deb18d6dddc..ddf3942bf8af 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py @@ -257,9 +257,7 @@ def search_space( return self._search_space @search_space.setter - def search_space( - self, values: Optional[Dict[str, Dict[str, Union[str, int, float, dict]]]] - ) -> None: + def search_space(self, values: Optional[Dict[str, Dict[str, Union[str, int, float, dict]]]]) -> None: """Sets the search space for the sweep job. :param values: The search space to set. @@ -271,11 +269,7 @@ def search_space( search_space: Dict = {} for name, value in values.items(): # If value is a SearchSpace object, directly pass it to job.search_space[name] - search_space[name] = ( - self._value_type_to_class(value) - if isinstance(value, dict) - else value - ) + search_space[name] = self._value_type_to_class(value) if isinstance(value, dict) else value self._search_space = search_space @classmethod @@ -306,9 +300,7 @@ def _get_supported_inputs_types(cls) -> Tuple: ) @classmethod - def _load_from_dict( - cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any - ) -> "Sweep": + def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Sweep": raise NotImplementedError("Sweep._load_from_dict is not supported") @classmethod @@ -337,9 +329,7 @@ def _to_rest_object(self, **kwargs: Any) -> dict: # ``as_attribute_dict`` yields the snake_case field view (``policy_type``/``delay_evaluation``) # that the round-trip reader and schema expect; the arm_ml_service hybrid ``as_dict`` would emit # camelCase and break the node dict. - rest_obj["early_termination"] = as_attribute_dict( - _early_termination._to_rest_object() - ) + rest_obj["early_termination"] = as_attribute_dict(_early_termination._to_rest_object()) rest_obj.update( { @@ -357,9 +347,7 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: # the change if "early_termination" in obj and "policy_type" in obj["early_termination"]: # can't use _from_rest_object here, because obj is a dict instead of an EarlyTerminationPolicy rest object - obj["early_termination"]["type"] = camel_to_snake( - obj["early_termination"].pop("policy_type") - ) + obj["early_termination"]["type"] = camel_to_snake(obj["early_termination"].pop("policy_type")) # TODO: use cls._get_schema() to load from rest object from azure.ai.ml._schema._sweep.parameterized_sweep import ( @@ -367,9 +355,7 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: ) schema = ParameterizedSweepSchema(context={BASE_PATH_CONTEXT_KEY: "./"}) - support_data_binding_expression_for_fields( - schema, ["type", "component", "trial"] - ) + support_data_binding_expression_for_fields(schema, ["type", "component", "trial"]) base_sweep = schema.load(obj, unknown=EXCLUDE, partial=True) for key, value in base_sweep.items(): @@ -390,9 +376,7 @@ def _get_trial_component_rest_obj(self) -> Union[Dict, ComponentVersion, None]: return {"componentId": trial_component_id} if isinstance(trial_component_id, CommandComponent): return trial_component_id._to_rest_object() - raise UserErrorException( - f"invalid trial in sweep node {self.name}: {str(self.trial)}" - ) + raise UserErrorException(f"invalid trial in sweep node {self.name}: {str(self.trial)}") def _to_job(self) -> SweepJob: command = self.trial.command @@ -400,9 +384,7 @@ def _to_job(self) -> SweepJob: for key, _ in self.search_space.items(): if command is not None: # Double curly brackets to escape - command = command.replace( - f"${{{{inputs.{key}}}}}", f"${{{{search_space.{key}}}}}" - ) + command = command.replace(f"${{{{inputs.{key}}}}}", f"${{{{search_space.{key}}}}}") # TODO: raise exception when the trial is a pre-registered component if command != self.trial.command and isinstance(self.trial, CommandComponent): @@ -444,17 +426,13 @@ def _build_inputs(self) -> Dict: return built_inputs @classmethod - def _create_schema_for_validation( - cls, context: Any - ) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation(cls, context: Any) -> Union[PathAwareSchema, Schema]: from azure.ai.ml._schema.pipeline.component_job import SweepSchema return SweepSchema(context=context) @classmethod - def _get_origin_inputs_and_search_space( - cls, built_inputs: Optional[Dict[str, NodeInput]] - ) -> Tuple: + def _get_origin_inputs_and_search_space(cls, built_inputs: Optional[Dict[str, NodeInput]]) -> Tuple: """Separate mixed true inputs & search space definition from inputs of this node and return them. @@ -481,9 +459,7 @@ def _get_origin_inputs_and_search_space( msg = "unsupported built input type: {}: {}" raise ValidationException( message=msg.format(input_name, type(input_obj)), - no_personal_data_message=msg.format( - "[input_name]", type(input_obj) - ), + no_personal_data_message=msg.format("[input_name]", type(input_obj)), target=ErrorTarget.SWEEP_JOB, error_type=ValidationErrorType.INVALID_VALUE, ) @@ -496,9 +472,7 @@ def _is_input_set(self, input_name: str) -> bool: def __setattr__(self, key: Any, value: Any) -> None: super(Sweep, self).__setattr__(key, value) - if key == "early_termination" and isinstance( - self.early_termination, BanditPolicy - ): + if key == "early_termination" and isinstance(self.early_termination, BanditPolicy): # only one of slack_amount and slack_factor can be specified but default value is 0.0. # Need to keep track of which one is null. if self.early_termination.slack_amount == 0.0: @@ -516,9 +490,7 @@ def early_termination(self) -> Optional[Union[str, EarlyTerminationPolicy]]: return self._early_termination @early_termination.setter - def early_termination( - self, value: Optional[Union[str, EarlyTerminationPolicy]] - ) -> None: + def early_termination(self, value: Optional[Union[str, EarlyTerminationPolicy]]) -> None: """Sets the early termination policy for the sweep job. :param value: The early termination policy for the sweep job. @@ -527,7 +499,5 @@ def early_termination( """ if isinstance(value, dict): early_termination_schema = EarlyTerminationField() - value = early_termination_schema._deserialize( - value=value, attr=None, data=None - ) + value = early_termination_schema._deserialize(value=value, attr=None, data=None) self._early_termination = value # type: ignore[assignment] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py index f4973338cbb6..41f617766466 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/_input_output_helpers.py @@ -86,18 +86,14 @@ def to_hybrid_rest_model(value: Any, arm_base_cls: Any) -> Any: if value is None: return None if isinstance(value, dict): - return { - key: to_hybrid_rest_model(item, arm_base_cls) for key, item in value.items() - } + return {key: to_hybrid_rest_model(item, arm_base_cls) for key, item in value.items()} if isinstance(value, list): return [to_hybrid_rest_model(item, arm_base_cls) for item in value] # Already an arm_ml_service hybrid model (e.g. a partially-migrated child): leave as-is. if hasattr(value, "_is_model"): return value # msrest model -> camelCase wire dict -> discriminated arm hybrid model. - return arm_base_cls._deserialize( - value.serialize(), [] - ) # pylint: disable=protected-access + return arm_base_cls._deserialize(value.serialize(), []) # pylint: disable=protected-access INPUT_MOUNT_MAPPING_FROM_REST = { @@ -200,24 +196,13 @@ def build_input_output( return item -def _validate_inputs_for( - input_consumer_name: str, input_consumer: str, inputs: Optional[Dict] -) -> None: +def _validate_inputs_for(input_consumer_name: str, input_consumer: str, inputs: Optional[Dict]) -> None: implicit_inputs = re.findall(r"\${{inputs\.([\w\.-]+)}}", input_consumer) # optional inputs no need to validate whether they're in inputs - optional_inputs = re.findall( - r"\[[\w\.\s-]*\${{inputs\.([\w\.-]+)}}]", input_consumer - ) + optional_inputs = re.findall(r"\[[\w\.\s-]*\${{inputs\.([\w\.-]+)}}]", input_consumer) for key in implicit_inputs: - if ( - inputs is not None - and inputs.get(key, None) is None - and key not in optional_inputs - ): - msg = ( - "Inputs to job does not contain '{}' referenced in " - + input_consumer_name - ) + if inputs is not None and inputs.get(key, None) is None and key not in optional_inputs: + msg = "Inputs to job does not contain '{}' referenced in " + input_consumer_name raise ValidationException( message=msg.format(key), no_personal_data_message=msg.format("[key]"), @@ -253,7 +238,9 @@ def validate_pipeline_input_key_characters(key: str) -> None: # Note: ([a-zA-Z_]+[a-zA-Z0-9_]*) is a valid single key, # so a valid pipeline key is: ^{single_key}([.]{single_key})*$ if re.match(IOConstants.VALID_KEY_PATTERN, key) is None: - msg = "Pipeline input key name {} must be composed letters, numbers, and underscores with optional split by dots." + msg = ( + "Pipeline input key name {} must be composed letters, numbers, and underscores with optional split by dots." + ) raise ValidationException( message=msg.format(key), no_personal_data_message=msg.format("[key]"), @@ -309,11 +296,7 @@ def to_rest_dataset_literal_inputs( if input_value.type in target_cls_dict: input_data = target_cls_dict[input_value.type]( uri=input_value.path, - mode=( - INPUT_MOUNT_MAPPING_TO_REST[input_value.mode.lower()] - if input_value.mode - else None - ), + mode=(INPUT_MOUNT_MAPPING_TO_REST[input_value.mode.lower()] if input_value.mode else None), ) else: msg = f"Job input type {input_value.type} is not supported as job input." @@ -376,11 +359,7 @@ def from_rest_inputs_to_dataset_literal(inputs: Dict[str, RestJobInput]) -> Dict input_data = Input( type=type_transfer_dict[input_value.job_input_type], path=path, - mode=( - INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] - if input_value.mode - else None - ), + mode=(INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] if input_value.mode else None), path_on_compute=sourcePathOnCompute, ) elif input_value.job_input_type in (JobInputType.LITERAL, JobInputType.LITERAL): @@ -396,9 +375,7 @@ def from_rest_inputs_to_dataset_literal(inputs: Dict[str, RestJobInput]) -> Dict error_type=ValidationErrorType.INVALID_VALUE, ) - from_rest_inputs[input_name] = ( - input_data # pylint: disable=possibly-used-before-assignment - ) + from_rest_inputs[input_name] = input_data # pylint: disable=possibly-used-before-assignment return from_rest_inputs @@ -421,18 +398,12 @@ def to_rest_data_outputs(outputs: Optional[Dict]) -> Dict[str, RestJobOutput]: else: target_cls_dict = get_output_rest_cls_dict() - output_value_type = ( - output_value.type if output_value.type else AssetTypes.URI_FOLDER - ) + output_value_type = output_value.type if output_value.type else AssetTypes.URI_FOLDER if output_value_type in target_cls_dict: output = target_cls_dict[output_value_type]( asset_name=output_value.name, uri=output_value.path, - mode=( - OUTPUT_MOUNT_MAPPING_TO_REST[output_value.mode.lower()] - if output_value.mode - else None - ), + mode=(OUTPUT_MOUNT_MAPPING_TO_REST[output_value.mode.lower()] if output_value.mode else None), description=output_value.description, ) # The shared arm_ml_service JobOutput models dropped ``assetVersion``/``pathOnCompute`` @@ -479,20 +450,12 @@ def from_rest_data_outputs(outputs: Dict[str, RestJobOutput]) -> Dict[str, Outpu asset_version = output_value.get("assetVersion") else: sourcePathOnCompute = getattr(output_value, "pathOnCompute", None) - asset_version = ( - output_value.asset_version - if hasattr(output_value, "asset_version") - else None - ) + asset_version = output_value.asset_version if hasattr(output_value, "asset_version") else None if output_value.job_output_type in output_type_mapping: from_rest_outputs[output_name] = Output( type=output_type_mapping[output_value.job_output_type], path=output_value.uri, - mode=( - OUTPUT_MOUNT_MAPPING_FROM_REST[output_value.mode] - if output_value.mode - else None - ), + mode=(OUTPUT_MOUNT_MAPPING_FROM_REST[output_value.mode] if output_value.mode else None), path_on_compute=sourcePathOnCompute, description=output_value.description, name=output_value.asset_name, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py index 66fd501f0468..2584bc377f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py @@ -51,9 +51,7 @@ def __init__( training_data = kwargs.pop("training_data", None) validation_data = kwargs.pop("validation_data", None) hyperparameters = kwargs.pop("hyperparameters", None) - if hyperparameters and not isinstance( - hyperparameters, AzureOpenAIHyperparameters - ): + if hyperparameters and not isinstance(hyperparameters, AzureOpenAIHyperparameters): raise ValidationException( category=ErrorCategory.USER_ERROR, target=ErrorTarget.JOB, @@ -98,11 +96,7 @@ def _to_rest_object(self) -> "RestFineTuningJob": """ # TSP rest models coerce SDK Input entities to dicts at construction, so # convert to TSP JobInput types up front rather than mutating after. - model = ( - MLFlowModelJobInput(uri=self._model.path) - if isinstance(self._model, Input) - else self._model - ) + model = MLFlowModelJobInput(uri=self._model.path) if isinstance(self._model, Input) else self._model training_data = ( UriFileJobInput(uri=self._training_data.path) if isinstance(self._training_data, Input) @@ -119,9 +113,7 @@ def _to_rest_object(self) -> "RestFineTuningJob": model_provider=self._model_provider, training_data=training_data, validation_data=validation_data, - hyper_parameters=( - self.hyperparameters._to_rest_object() if self.hyperparameters else None - ), + hyper_parameters=(self.hyperparameters._to_rest_object() if self.hyperparameters else None), ) finetuning_job = RestFineTuningJob( @@ -137,9 +129,7 @@ def _to_rest_object(self) -> "RestFineTuningJob": is_archived=False, # The shared ``to_rest_data_outputs`` helper emits msrest models; convert to the # arm_ml_service hybrid equivalent so the hybrid SdkJSONEncoder can serialize the body. - outputs=to_hybrid_rest_model( - to_rest_data_outputs(self.outputs), RestJobOutput - ), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), ) result = RestJobBase(properties=finetuning_job) @@ -162,9 +152,7 @@ def _to_dict(self) -> Dict: # if inside_pipeline: # schema_dict = AutoMLClassificationNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) # else: - schema_dict = AzureOpenAIFineTuningSchema( - context={BASE_PATH_CONTEXT_KEY: "./"} - ).dump(self) + schema_dict = AzureOpenAIFineTuningSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return schema_dict @@ -225,9 +213,7 @@ def _from_rest_object(cls, obj: RestJobBase) -> "AzureOpenAIFineTuningJob": model=finetuning_details.model, training_data=finetuning_details.training_data, validation_data=finetuning_details.validation_data, - hyperparameters=AzureOpenAIHyperparameters._from_rest_object( - finetuning_details.hyper_parameters - ), + hyperparameters=AzureOpenAIHyperparameters._from_rest_object(finetuning_details.hyper_parameters), **job_args_dict, ) @@ -270,17 +256,13 @@ def _load_from_dict( # **kwargs, # ) # else: - loaded_data = load_from_dict( - AzureOpenAIFineTuningSchema, data, context, additional_message, **kwargs - ) + loaded_data = load_from_dict(AzureOpenAIFineTuningSchema, data, context, additional_message, **kwargs) job_instance = cls._create_instance_from_schema_dict(loaded_data) return job_instance @classmethod - def _create_instance_from_schema_dict( - cls, loaded_data: Dict - ) -> "AzureOpenAIFineTuningJob": + def _create_instance_from_schema_dict(cls, loaded_data: Dict) -> "AzureOpenAIFineTuningJob": """Create an instance from a schema dictionary. :param loaded_data: dictionary containing the data. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py index 371f8648c746..9fa7150ea0f3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_hyperparameters.py @@ -116,9 +116,7 @@ def __ne__(self, other: object) -> bool: return not self.__eq__(other) @classmethod - def _from_rest_object( - cls, obj: RestAzureOpenAiHyperParameters - ) -> "AzureOpenAIHyperparameters": + def _from_rest_object(cls, obj: RestAzureOpenAiHyperParameters) -> "AzureOpenAIHyperparameters": aoai_hyperparameters = cls( batch_size=obj.batch_size, learning_rate_multiplier=obj.learning_rate_multiplier, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py index 7d3cbe74063d..f5af19be4267 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py @@ -68,9 +68,7 @@ def _to_rest_object(self) -> RestCommandJobLimits: return RestCommandJobLimits(timeout=to_iso_duration_format(self.timeout)) @classmethod - def _from_rest_object( - cls, obj: Union[RestCommandJobLimits, dict] - ) -> Optional["CommandJobLimits"]: + def _from_rest_object(cls, obj: Union[RestCommandJobLimits, dict]) -> Optional["CommandJobLimits"]: if not obj: return None if isinstance(obj, dict): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py index 9e5c7a25205f..5d230bcabc80 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py @@ -77,9 +77,7 @@ module_logger = logging.getLogger(__name__) -class PipelineJob( - Job, YamlTranslatableMixin, PipelineJobIOMixin, PathAwareSchemaValidatableMixin -): +class PipelineJob(Job, YamlTranslatableMixin, PipelineJobIOMixin, PathAwareSchemaValidatableMixin): """Pipeline job. You should not instantiate this class directly. Instead, you should @@ -157,16 +155,12 @@ def __init__( ComponentSource.DSL, ComponentSource.YAML_COMPONENT, ]: - self._inputs = self._build_inputs_dict( - inputs, input_definition_dict=component.inputs - ) + self._inputs = self._build_inputs_dict(inputs, input_definition_dict=component.inputs) # for pipeline component created pipeline jobs, # it's output should have same value with the component outputs, # then override it with given outputs (filter out None value) pipeline_outputs = {k: v for k, v in (outputs or {}).items() if v} - self._outputs = self._build_pipeline_outputs_dict( - {**component.outputs, **pipeline_outputs} - ) + self._outputs = self._build_pipeline_outputs_dict({**component.outputs, **pipeline_outputs}) else: # Build inputs/outputs dict without meta when definition not available self._inputs = self._build_inputs_dict(inputs) @@ -186,16 +180,12 @@ def __init__( # If component is Pipeline component, jobs will be component.jobs self._jobs = (jobs or {}) if isinstance(component, str) else {} - self.component: Union[PipelineComponent, str] = cast( - Union[PipelineComponent, str], component - ) + self.component: Union[PipelineComponent, str] = cast(Union[PipelineComponent, str], component) if "type" not in kwargs: kwargs["type"] = JobType.PIPELINE if isinstance(component, PipelineComponent): description = component.description if description is None else description - display_name = ( - component.display_name if display_name is None else display_name - ) + display_name = component.display_name if display_name is None else display_name super(PipelineJob, self).__init__( name=name, description=description, @@ -240,11 +230,7 @@ def jobs(self) -> Dict: :return: Jobs of pipeline job. :rtype: dict """ - res: dict = ( - self.component.jobs - if isinstance(self.component, PipelineComponent) - else self._jobs - ) + res: dict = self.component.jobs if isinstance(self.component, PipelineComponent) else self._jobs return res @property @@ -273,17 +259,11 @@ def settings(self, value: Optional[Union[Dict, PipelineJobSettings]]) -> None: elif isinstance(value, dict): value = PipelineJobSettings(**value) else: - raise TypeError( - "settings must be PipelineJobSettings or dict but got {}".format( - type(value) - ) - ) + raise TypeError("settings must be PipelineJobSettings or dict but got {}".format(type(value))) self._settings = value @classmethod - def _create_validation_error( - cls, message: str, no_personal_data_message: str - ) -> ValidationException: + def _create_validation_error(cls, message: str, no_personal_data_message: str) -> ValidationException: return ValidationException( message=message, no_personal_data_message=no_personal_data_message, @@ -329,8 +309,7 @@ def _customized_validate(self) -> MutableValidationResult: # Skip top level parameter missing type error validation_result.merge_with( self.component._customized_validate(), - condition_skip=lambda x: x.error_code - == ValidationErrorCode.PARAMETER_TYPE_UNKNOWN + condition_skip=lambda x: x.error_code == ValidationErrorCode.PARAMETER_TYPE_UNKNOWN and x.yaml_path.startswith("inputs"), ) # Validate compute @@ -349,9 +328,7 @@ def _validate_input(self) -> MutableValidationResult: used_pipeline_inputs = set( itertools.chain( *[ - self.component._get_input_binding_dict( - node if not isinstance(node, LoopNode) else node.body - )[0] + self.component._get_input_binding_dict(node if not isinstance(node, LoopNode) else node.body)[0] for node in self.jobs.values() if not isinstance(node, ConditionNode) # condition node has no inputs @@ -362,9 +339,7 @@ def _validate_input(self) -> MutableValidationResult: if not isinstance(self.component, Component): return validation_result for key, meta in self.component.inputs.items(): - if ( - key not in used_pipeline_inputs - ): # pylint: disable=possibly-used-before-assignment + if key not in used_pipeline_inputs: # pylint: disable=possibly-used-before-assignment # Only validate inputs certainly used. continue # raise error when required input with no default value not set @@ -415,20 +390,12 @@ def _validate_init_finalize_job( on_init, on_finalize = self.settings.on_init, self.settings.on_finalize - append_on_init_error = partial( - validation_result.append_error, "settings.on_init" - ) - append_on_finalize_error = partial( - validation_result.append_error, "settings.on_finalize" - ) + append_on_init_error = partial(validation_result.append_error, "settings.on_init") + append_on_finalize_error = partial(validation_result.append_error, "settings.on_finalize") # on_init and on_finalize cannot be same if on_init == on_finalize: - append_on_init_error( - f"Invalid on_init job {on_init}, it should be different from on_finalize." - ) - append_on_finalize_error( - f"Invalid on_finalize job {on_finalize}, it should be different from on_init." - ) + append_on_init_error(f"Invalid on_init job {on_init}, it should be different from on_finalize.") + append_on_finalize_error(f"Invalid on_finalize job {on_finalize}, it should be different from on_init.") # pipeline should have at least one normal node if len(set(self.jobs.keys()) - {on_init, on_finalize}) == 0: validation_result.append_error( @@ -457,13 +424,9 @@ def _try_get_data_bindings( """ # handle group input if GroupInput._is_group_attr_dict(_input_output_data): - _new_input_output_data: _GroupAttrDict = cast( - _GroupAttrDict, _input_output_data - ) + _new_input_output_data: _GroupAttrDict = cast(_GroupAttrDict, _input_output_data) # flatten to avoid nested cases - flattened_values: List[Input] = list( - _new_input_output_data.flatten(_name).values() - ) + flattened_values: List[Input] = list(_new_input_output_data.flatten(_name).values()) # handle invalid empty group if len(flattened_values) == 0: return None @@ -478,9 +441,7 @@ def _try_get_data_bindings( _validate_job = self.jobs[_validate_job_name] # no input to validate job for _input_name in _validate_job.inputs: - _data_bindings = _try_get_data_bindings( - _input_name, _validate_job.inputs[_input_name] - ) + _data_bindings = _try_get_data_bindings(_input_name, _validate_job.inputs[_input_name]) if _data_bindings is None: continue for _data_binding in _data_bindings: @@ -492,15 +453,11 @@ def _try_get_data_bindings( if _is_control_flow_node(_job_name): continue for _input_name in _job.inputs: - _data_bindings = _try_get_data_bindings( - _input_name, _job.inputs[_input_name] - ) + _data_bindings = _try_get_data_bindings(_input_name, _job.inputs[_input_name]) if _data_bindings is None: continue for _data_binding in _data_bindings: - if is_data_binding_expression( - _data_binding, ["parent", "jobs", _validate_job_name] - ): + if is_data_binding_expression(_data_binding, ["parent", "jobs", _validate_job_name]): return False return True @@ -510,38 +467,25 @@ def _try_get_data_bindings( append_on_init_error(f"On_init job name {on_init} not exists in jobs.") else: if _is_control_flow_node(on_init): - append_on_init_error( - "On_init job should not be a control flow node." - ) + append_on_init_error("On_init job should not be a control flow node.") elif not _is_isolated_job(on_init): - append_on_init_error( - "On_init job should not have connection to other execution node." - ) + append_on_init_error("On_init job should not have connection to other execution node.") # validate on_finalize if on_finalize is not None: if on_finalize not in self.jobs: - append_on_finalize_error( - f"On_finalize job name {on_finalize} not exists in jobs." - ) + append_on_finalize_error(f"On_finalize job name {on_finalize} not exists in jobs.") else: if _is_control_flow_node(on_finalize): - append_on_finalize_error( - "On_finalize job should not be a control flow node." - ) + append_on_finalize_error("On_finalize job should not be a control flow node.") elif not _is_isolated_job(on_finalize): - append_on_finalize_error( - "On_finalize job should not have connection to other execution node." - ) + append_on_finalize_error("On_finalize job should not have connection to other execution node.") return validation_result def _remove_pipeline_input(self) -> None: """Remove None pipeline input.If not remove, it will pass "None" to backend.""" redundant_pipeline_inputs = [] for pipeline_input_name, pipeline_input in self._inputs.items(): - if ( - isinstance(pipeline_input, PipelineInput) - and pipeline_input._data is None - ): + if isinstance(pipeline_input, PipelineInput) and pipeline_input._data is None: redundant_pipeline_inputs.append(pipeline_input_name) for redundant_pipeline_input in redundant_pipeline_inputs: self._inputs.pop(redundant_pipeline_input) @@ -619,23 +563,17 @@ def _to_rest_object(self) -> JobBase: source = ComponentSource.REMOTE_WORKSPACE_JOB rest_component_jobs = {} # add _source on pipeline job.settings - if ( - "_source" not in settings_dict - ): # pylint: disable=possibly-used-before-assignment + if "_source" not in settings_dict: # pylint: disable=possibly-used-before-assignment settings_dict.update({"_source": source}) # TODO: Revisit this logic when multiple types of component jobs are supported rest_compute = self.compute # This will be resolved in job_operations _resolve_arm_id_or_upload_dependencies. - component_id = ( - self.component if isinstance(self.component, str) else self.component.id - ) + component_id = self.component if isinstance(self.component, str) else self.component.id # TODO remove it in the future. # MFE not support pass None or empty input value. Remove the empty inputs in pipeline job. - built_inputs = { - k: v for k, v in built_inputs.items() if v is not None and v != "" - } + built_inputs = {k: v for k, v in built_inputs.items() if v is not None and v != ""} pipeline_job = RestPipelineJob( compute_id=rest_compute, @@ -655,9 +593,7 @@ def _to_rest_object(self) -> JobBase: to_rest_dataset_literal_inputs(built_inputs, job_type=self.type), RestJobInput, ), - outputs=to_hybrid_rest_model( - to_rest_data_outputs(built_outputs), RestJobOutput - ), + outputs=to_hybrid_rest_model(to_rest_data_outputs(built_outputs), RestJobOutput), settings=settings_dict, services=( to_hybrid_rest_model( @@ -692,22 +628,10 @@ def _load_from_rest(cls, obj: JobBase) -> "PipelineJob": from_rest_inputs = from_rest_inputs_to_dataset_literal(properties.inputs) or {} from_rest_outputs = from_rest_data_outputs(properties.outputs) or {} # Unpack the component jobs - sub_nodes = ( - PipelineComponent._resolve_sub_nodes(properties.jobs) - if properties.jobs - else {} - ) + sub_nodes = PipelineComponent._resolve_sub_nodes(properties.jobs) if properties.jobs else {} # backend may still store Camel settings, eg: DefaultDatastore, translate them to snake when load back - settings_dict = ( - transform_dict_keys(properties.settings, camel_to_snake) - if properties.settings - else None - ) - settings_sdk = ( - PipelineJobSettings(**settings_dict) - if settings_dict - else PipelineJobSettings() - ) + settings_dict = transform_dict_keys(properties.settings, camel_to_snake) if properties.settings else None + settings_sdk = PipelineJobSettings(**settings_dict) if settings_dict else PipelineJobSettings() # Create component or use component id if getattr(properties, "component_id", None): component = properties.component_id @@ -734,22 +658,12 @@ def _load_from_rest(cls, obj: JobBase) -> "PipelineJob": properties=properties.properties, experiment_name=properties.experiment_name, status=properties.status, - creation_context=( - SystemData._from_rest_object(obj.system_data) - if obj.system_data - else None - ), - services=( - JobServiceBase._from_rest_job_services(properties.services) - if properties.services - else None - ), + creation_context=(SystemData._from_rest_object(obj.system_data) if obj.system_data else None), + services=(JobServiceBase._from_rest_job_services(properties.services) if properties.services else None), compute=get_resource_name_from_arm_id_safe(properties.compute_id), settings=settings_sdk, identity=( - _BaseJobIdentityConfiguration._from_rest_object(properties.identity) - if properties.identity - else None + _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None ), ) @@ -763,33 +677,23 @@ def _to_dict(self) -> Dict: def _component_items_from_path(cls, data: Dict) -> Generator: if "jobs" in data: for node_name, job_instance in data["jobs"].items(): - potential_component_path = ( - job_instance["component"] if "component" in job_instance else None - ) - if isinstance( - potential_component_path, str - ) and potential_component_path.startswith("file:"): + potential_component_path = job_instance["component"] if "component" in job_instance else None + if isinstance(potential_component_path, str) and potential_component_path.startswith("file:"): yield node_name, potential_component_path @classmethod - def _load_from_dict( - cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any - ) -> "PipelineJob": + def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "PipelineJob": path_first_occurrence: dict = {} component_first_occurrence = {} for node_name, component_path in cls._component_items_from_path(data): if component_path in path_first_occurrence: - component_first_occurrence[node_name] = path_first_occurrence[ - component_path - ] + component_first_occurrence[node_name] = path_first_occurrence[component_path] # set components to be replaced here may break the validation logic else: path_first_occurrence[component_path] = node_name # use this instead of azure.ai.ml.entities._util.load_from_dict to avoid parsing - loaded_schema = cls._create_schema_for_validation(context=context).load( - data, **kwargs - ) + loaded_schema = cls._create_schema_for_validation(context=context).load(data, **kwargs) # replace repeat component with first occurrence to reduce arm id resolution # current load yaml file logic is in azure.ai.ml._schema.core.schema.YamlFileSchema.load_from_file @@ -825,9 +729,7 @@ def _get_telemetry_values(self) -> Dict: telemetry_values.pop("is_anonymous") return telemetry_values - def _to_component( - self, context: Optional[Dict] = None, **kwargs: Any - ) -> "PipelineComponent": + def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> "PipelineComponent": """Translate a pipeline job to pipeline component. :param context: Context of pipeline job YAML file. @@ -851,11 +753,7 @@ def _to_component( return PipelineComponent( base_path=context[BASE_PATH_CONTEXT_KEY], display_name=self.display_name, - inputs=self._to_inputs( - inputs=self.inputs, pipeline_job_dict=pipeline_job_dict - ), - outputs=self._to_outputs( - outputs=self.outputs, pipeline_job_dict=pipeline_job_dict - ), + inputs=self._to_inputs(inputs=self.inputs, pipeline_job_dict=pipeline_job_dict), + outputs=self._to_outputs(outputs=self.outputs, pipeline_job_dict=pipeline_job_dict), jobs=self.jobs, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py index c9c248a8da7c..8617de8723e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py @@ -48,16 +48,8 @@ def __init__( def _to_rest_object(self) -> RestQueueSettings: self._validate() - job_tier = ( - JobTierNames.ENTITY_TO_REST.get(self.job_tier.lower(), None) - if self.job_tier - else None - ) - priority = ( - JobPriorityValues.ENTITY_TO_REST.get(self.priority.lower(), None) - if self.priority - else None - ) + job_tier = JobTierNames.ENTITY_TO_REST.get(self.job_tier.lower(), None) if self.job_tier else None + priority = JobPriorityValues.ENTITY_TO_REST.get(self.priority.lower(), None) if self.priority else None rest_obj = RestQueueSettings(job_tier=job_tier) # The shared arm_ml_service QueueSettings model dropped ``priority`` from its constructor; the legacy # msrest model carried it (as an int) on the wire, so preserve it as an unknown wire key. @@ -66,32 +58,20 @@ def _to_rest_object(self) -> RestQueueSettings: return rest_obj @classmethod - def _from_rest_object( - cls, obj: Union[Dict[str, Any], RestQueueSettings, None] - ) -> Optional["QueueSettings"]: + def _from_rest_object(cls, obj: Union[Dict[str, Any], RestQueueSettings, None]) -> Optional["QueueSettings"]: if obj is None: return None if isinstance(obj, dict): - queue_settings = RestQueueSettings._deserialize( - obj, [] - ) # pylint: disable=protected-access + queue_settings = RestQueueSettings._deserialize(obj, []) # pylint: disable=protected-access return cls._from_rest_object(queue_settings) - job_tier = ( - JobTierNames.REST_TO_ENTITY.get(obj.job_tier, None) - if obj.job_tier - else None - ) + job_tier = JobTierNames.REST_TO_ENTITY.get(obj.job_tier, None) if obj.job_tier else None # ``priority`` is an unknown wire key on the arm hybrid (a MutableMapping); read it via mapping # access when present, else fall back to attribute access for legacy msrest objects. if getattr(obj, "_is_model", False) is True: rest_priority = obj.get("priority") else: rest_priority = obj.priority if hasattr(obj, "priority") else None - priority = ( - JobPriorityValues.REST_TO_ENTITY.get(rest_priority, None) - if rest_priority - else None - ) + priority = JobPriorityValues.REST_TO_ENTITY.get(rest_priority, None) if rest_priority else None return cls(job_tier=job_tier, priority=priority) def _validate(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py index a94f6f21b664..65b82695075e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py @@ -38,16 +38,12 @@ class SparkJobEntry(RestTranslatableMixin): :caption: Creating SparkComponent. """ - def __init__( - self, *, entry: str, type: str = SparkJobEntryType.SPARK_JOB_FILE_ENTRY - ) -> None: + def __init__(self, *, entry: str, type: str = SparkJobEntryType.SPARK_JOB_FILE_ENTRY) -> None: self.entry_type = type self.entry = entry @classmethod - def _from_rest_object( - cls, obj: Union[SparkJobPythonEntry, SparkJobScalaEntry] - ) -> Optional["SparkJobEntry"]: + def _from_rest_object(cls, obj: Union[SparkJobPythonEntry, SparkJobScalaEntry]) -> Optional["SparkJobEntry"]: if obj is None: return None if isinstance(obj, dict): @@ -66,16 +62,10 @@ def _from_rest_object( ) if obj.spark_job_entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: return SparkJobEntry( - entry=( - obj.get("file", None) - if hasattr(obj, "get") - else obj.__dict__.get("file", None) - ), + entry=(obj.get("file", None) if hasattr(obj, "get") else obj.__dict__.get("file", None)), type=SparkJobEntryType.SPARK_JOB_FILE_ENTRY, ) - return SparkJobEntry( - entry=obj.class_name, type=SparkJobEntryType.SPARK_JOB_CLASS_ENTRY - ) + return SparkJobEntry(entry=obj.class_name, type=SparkJobEntryType.SPARK_JOB_CLASS_ENTRY) def _to_rest_object(self) -> Union[SparkJobPythonEntry, SparkJobScalaEntry]: if self.entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py index b5a1a1c5a9aa..9ef9cb5bd07d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_resource_configuration.py @@ -37,19 +37,12 @@ class SparkResourceConfiguration(RestTranslatableMixin, DictMixin): "standard_e64s_v3", ] - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = None - ) -> None: + def __init__(self, *, instance_type: Optional[str] = None, runtime_version: Optional[str] = None) -> None: self.instance_type = instance_type self.runtime_version = runtime_version def _to_rest_object(self) -> RestSparkResourceConfiguration: - return RestSparkResourceConfiguration( - instance_type=self.instance_type, runtime_version=self.runtime_version - ) + return RestSparkResourceConfiguration(instance_type=self.instance_type, runtime_version=self.runtime_version) @classmethod def _from_rest_object( @@ -59,9 +52,7 @@ def _from_rest_object( return None if isinstance(obj, dict): return SparkResourceConfiguration(**obj) - return SparkResourceConfiguration( - instance_type=obj.instance_type, runtime_version=obj.runtime_version - ) + return SparkResourceConfiguration(instance_type=obj.instance_type, runtime_version=obj.runtime_version) def _validate(self) -> None: # TODO: below logic is duplicated to SparkResourceConfigurationSchema, maybe make SparkJob schema validatable @@ -74,9 +65,7 @@ def _validate(self) -> None: error_category=ErrorCategory.USER_ERROR, ) if self.instance_type.lower() not in self.instance_type_list: - msg = "Instance type must be specified for the list of {}".format( - ",".join(self.instance_type_list) - ) + msg = "Instance type must be specified for the list of {}".format(",".join(self.instance_type_list)) raise ValidationException( message=msg, no_personal_data_message=msg, @@ -87,10 +76,7 @@ def _validate(self) -> None: def __eq__(self, other: object) -> bool: if not isinstance(other, SparkResourceConfiguration): return NotImplemented - return ( - self.instance_type == other.instance_type - and self.runtime_version == other.runtime_version - ) + return self.instance_type == other.instance_type and self.runtime_version == other.runtime_version def __ne__(self, other: object) -> bool: if not isinstance(other, SparkResourceConfiguration): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py index 8e933453680b..f0efdaefa410 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/early_termination_policy.py @@ -33,27 +33,19 @@ def __init__( self.evaluation_interval = evaluation_interval @classmethod - def _from_rest_object( - cls, obj: RestEarlyTerminationPolicy - ) -> Optional["EarlyTerminationPolicy"]: + def _from_rest_object(cls, obj: RestEarlyTerminationPolicy) -> Optional["EarlyTerminationPolicy"]: if not obj: return None policy: Any = None if obj.policy_type == EarlyTerminationPolicyType.BANDIT: - policy = BanditPolicy._from_rest_object( - obj - ) # pylint: disable=protected-access + policy = BanditPolicy._from_rest_object(obj) # pylint: disable=protected-access if obj.policy_type == EarlyTerminationPolicyType.MEDIAN_STOPPING: - policy = MedianStoppingPolicy._from_rest_object( - obj - ) # pylint: disable=protected-access + policy = MedianStoppingPolicy._from_rest_object(obj) # pylint: disable=protected-access if obj.policy_type == EarlyTerminationPolicyType.TRUNCATION_SELECTION: - policy = TruncationSelectionPolicy._from_rest_object( - obj - ) # pylint: disable=protected-access + policy = TruncationSelectionPolicy._from_rest_object(obj) # pylint: disable=protected-access return cast(Optional["EarlyTerminationPolicy"], policy) @@ -94,9 +86,7 @@ def __init__( slack_amount: float = 0, slack_factor: float = 0, ) -> None: - super().__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval - ) + super().__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval) self.type = EarlyTerminationPolicyType.BANDIT.lower() self.slack_factor = slack_factor self.slack_amount = slack_amount @@ -143,9 +133,7 @@ def __init__( delay_evaluation: int = 0, evaluation_interval: int = 1, ) -> None: - super().__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval - ) + super().__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval) self.type = camel_to_snake(EarlyTerminationPolicyType.MEDIAN_STOPPING) def _to_rest_object(self) -> RestMedianStoppingPolicy: @@ -190,9 +178,7 @@ def __init__( evaluation_interval: int = 0, truncation_percentage: int = 0, ) -> None: - super().__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval - ) + super().__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval) self.type = camel_to_snake(EarlyTerminationPolicyType.TRUNCATION_SELECTION) self.truncation_percentage = truncation_percentage @@ -204,9 +190,7 @@ def _to_rest_object(self) -> RestTruncationSelectionPolicy: ) @classmethod - def _from_rest_object( - cls, obj: RestTruncationSelectionPolicy - ) -> "TruncationSelectionPolicy": + def _from_rest_object(cls, obj: RestTruncationSelectionPolicy) -> "TruncationSelectionPolicy": return cls( delay_evaluation=obj.delay_evaluation, evaluation_interval=obj.evaluation_interval, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py index 53c45e6982aa..c2282941ccef 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/objective.py @@ -26,9 +26,7 @@ class Objective(RestTranslatableMixin): :caption: Assigning an objective to a SweepJob. """ - def __init__( - self, goal: Optional[str], primary_metric: Optional[str] = None - ) -> None: + def __init__(self, goal: Optional[str], primary_metric: Optional[str] = None) -> None: """Optimization objective. :param goal: Defines supported metric goals for hyperparameter tuning. Acceptable values diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py index be85da61cdb3..ced64e7110f3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sampling_algorithm.py @@ -31,27 +31,19 @@ def __init__(self) -> None: self.type = None @classmethod - def _from_rest_object( - cls, obj: RestSamplingAlgorithm - ) -> Optional["SamplingAlgorithm"]: + def _from_rest_object(cls, obj: RestSamplingAlgorithm) -> Optional["SamplingAlgorithm"]: if not obj: return None sampling_algorithm: Any = None if obj.sampling_algorithm_type == SamplingAlgorithmType.RANDOM: - sampling_algorithm = RandomSamplingAlgorithm._from_rest_object( - obj - ) # pylint: disable=protected-access + sampling_algorithm = RandomSamplingAlgorithm._from_rest_object(obj) # pylint: disable=protected-access if obj.sampling_algorithm_type == SamplingAlgorithmType.GRID: - sampling_algorithm = GridSamplingAlgorithm._from_rest_object( - obj - ) # pylint: disable=protected-access + sampling_algorithm = GridSamplingAlgorithm._from_rest_object(obj) # pylint: disable=protected-access if obj.sampling_algorithm_type == SamplingAlgorithmType.BAYESIAN: - sampling_algorithm = BayesianSamplingAlgorithm._from_rest_object( - obj - ) # pylint: disable=protected-access + sampling_algorithm = BayesianSamplingAlgorithm._from_rest_object(obj) # pylint: disable=protected-access return cast(Optional["SamplingAlgorithm"], sampling_algorithm) @@ -102,9 +94,7 @@ def _to_rest_object(self) -> RestRandomSamplingAlgorithm: return rest_obj @classmethod - def _from_rest_object( - cls, obj: RestRandomSamplingAlgorithm - ) -> "RandomSamplingAlgorithm": + def _from_rest_object(cls, obj: RestRandomSamplingAlgorithm) -> "RandomSamplingAlgorithm": # ``logbase`` is not modeled on the shared arm_ml_service RandomSamplingAlgorithm; it is # preserved as an unknown wire key on the hybrid model (a MutableMapping, not a dict subclass), # so read it from the mapping when present, otherwise fall back to attribute access for msrest. @@ -140,9 +130,7 @@ def _to_rest_object(self) -> RestGridSamplingAlgorithm: return RestGridSamplingAlgorithm() @classmethod - def _from_rest_object( - cls, obj: RestGridSamplingAlgorithm - ) -> "GridSamplingAlgorithm": + def _from_rest_object(cls, obj: RestGridSamplingAlgorithm) -> "GridSamplingAlgorithm": return cls() @@ -167,7 +155,5 @@ def _to_rest_object(self) -> RestBayesianSamplingAlgorithm: return RestBayesianSamplingAlgorithm() @classmethod - def _from_rest_object( - cls, obj: RestBayesianSamplingAlgorithm - ) -> "BayesianSamplingAlgorithm": + def _from_rest_object(cls, obj: RestBayesianSamplingAlgorithm) -> "BayesianSamplingAlgorithm": return cls() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py index ec6082f0bede..2da644dddfd2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py @@ -266,16 +266,11 @@ def _to_rest_object(self) -> JobBase: self.trial.command = map_single_brackets_and_warn(self.trial.command) if self.search_space is not None: - search_space = { - param: space._to_rest_object() - for (param, space) in self.search_space.items() - } + search_space = {param: space._to_rest_object() for (param, space) in self.search_space.items()} if self.trial is not None: validate_inputs_for_command(self.trial.command, self.inputs) - for ( - key - ) in search_space.keys(): # pylint: disable=possibly-used-before-assignment + for key in search_space.keys(): # pylint: disable=possibly-used-before-assignment validate_key_contains_allowed_characters(key) if self.trial is not None: @@ -284,8 +279,7 @@ def _to_rest_object(self) -> JobBase: distribution=to_hybrid_rest_model( ( self.trial.distribution._to_rest_object() - if self.trial.distribution - and not isinstance(self.trial.distribution, Dict) + if self.trial.distribution and not isinstance(self.trial.distribution, Dict) else None ), RestDistributionConfiguration, @@ -296,8 +290,7 @@ def _to_rest_object(self) -> JobBase: resources=to_hybrid_rest_model( ( self.trial.resources._to_rest_object() - if self.trial.resources - and not isinstance(self.trial.resources, Dict) + if self.trial.resources and not isinstance(self.trial.resources, Dict) else None ), RestJobResourceConfiguration, @@ -315,11 +308,7 @@ def _to_rest_object(self) -> JobBase: # The shared rest helpers below emit msrest models; convert each nested child to its # arm_ml_service hybrid equivalent so the hybrid SdkJSONEncoder can serialize the body. sampling_algorithm=to_hybrid_rest_model( - ( - self._get_rest_sampling_algorithm() - if self.sampling_algorithm - else None - ), + (self._get_rest_sampling_algorithm() if self.sampling_algorithm else None), RestSamplingAlgorithm, ), limits=to_hybrid_rest_model( @@ -329,8 +318,7 @@ def _to_rest_object(self) -> JobBase: early_termination=to_hybrid_rest_model( ( self.early_termination._to_rest_object() - if self.early_termination - and not isinstance(self.early_termination, str) + if self.early_termination and not isinstance(self.early_termination, str) else None ), RestEarlyTerminationPolicy, @@ -347,9 +335,7 @@ def _to_rest_object(self) -> JobBase: to_rest_dataset_literal_inputs(self.inputs, job_type=self.type), RestJobInput, ), - outputs=to_hybrid_rest_model( - to_rest_data_outputs(self.outputs), RestJobOutput - ), + outputs=to_hybrid_rest_model(to_rest_data_outputs(self.outputs), RestJobOutput), identity=to_hybrid_rest_model( self.identity._to_job_rest_object() if self.identity else None, RestIdentityConfiguration, @@ -362,11 +348,7 @@ def _to_rest_object(self) -> JobBase: # ``resources`` exists on the 2023-08 SweepJob wire contract but was dropped from the # arm_ml_service (2025-12) SweepJob model; assign it via wire-key so it still serializes. sweep_resources = to_hybrid_rest_model( - ( - self.resources._to_rest_object() - if self.resources and not isinstance(self.resources, dict) - else None - ), + (self.resources._to_rest_object() if self.resources and not isinstance(self.resources, dict) else None), RestJobResourceConfiguration, ) if sweep_resources is not None: @@ -389,12 +371,8 @@ def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> NoRetu ) @classmethod - def _load_from_dict( - cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any - ) -> "SweepJob": - loaded_schema = load_from_dict( - SweepJobSchema, data, context, additional_message, **kwargs - ) + def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "SweepJob": + loaded_schema = load_from_dict(SweepJobSchema, data, context, additional_message, **kwargs) loaded_schema["trial"] = ParameterizedCommand(**(loaded_schema["trial"])) sweep_job = SweepJob(base_path=context[BASE_PATH_CONTEXT_KEY], **loaded_schema) return sweep_job @@ -404,14 +382,10 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": properties: RestSweepJob = obj.properties # Unpack termination schema - early_termination = EarlyTerminationPolicy._from_rest_object( - properties.early_termination - ) + early_termination = EarlyTerminationPolicy._from_rest_object(properties.early_termination) # Unpack sampling algorithm - sampling_algorithm = SamplingAlgorithm._from_rest_object( - properties.sampling_algorithm - ) + sampling_algorithm = SamplingAlgorithm._from_rest_object(properties.sampling_algorithm) trial = ParameterizedCommand._load_from_sweep_job(obj.properties) # Compute also appears in both layers of the yaml, but only one of the REST. @@ -431,33 +405,21 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": experiment_name=properties.experiment_name, services=properties.services, status=properties.status, - creation_context=( - SystemData._from_rest_object(obj.system_data) - if obj.system_data - else None - ), + creation_context=(SystemData._from_rest_object(obj.system_data) if obj.system_data else None), trial=trial, # type: ignore[arg-type] compute=properties.compute_id, sampling_algorithm=sampling_algorithm, search_space=_search_space, # type: ignore[arg-type] limits=SweepJobLimits._from_rest_object(properties.limits), early_termination=early_termination, - objective=( - Objective._from_rest_object(properties.objective) - if properties.objective - else None - ), + objective=(Objective._from_rest_object(properties.objective) if properties.objective else None), inputs=from_rest_inputs_to_dataset_literal(properties.inputs), outputs=from_rest_data_outputs(properties.outputs), identity=( - _BaseJobIdentityConfiguration._from_rest_object(properties.identity) - if properties.identity - else None + _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None ), queue_settings=properties.queue_settings, - resources=JobResourceConfiguration._from_rest_object( - properties.get("resources") - ), + resources=JobResourceConfiguration._from_rest_object(properties.get("resources")), ) def _override_missing_properties_from_trial(self) -> None: @@ -473,15 +435,7 @@ def _override_missing_properties_from_trial(self) -> None: has_trial_limits_timeout = self.trial.limits and self.trial.limits.timeout if has_trial_limits_timeout and not self.limits: - time_out = ( - self.trial.limits.timeout if self.trial.limits is not None else None - ) + time_out = self.trial.limits.timeout if self.trial.limits is not None else None self.limits = SweepJobLimits(trial_timeout=time_out) - elif ( - has_trial_limits_timeout - and self.limits is not None - and not self.limits.trial_timeout - ): - self.limits.trial_timeout = ( - self.trial.limits.timeout if self.trial.limits is not None else None - ) + elif has_trial_limits_timeout and self.limits is not None and not self.limits.trial_timeout: + self.limits.trial_timeout = self.trial.limits.timeout if self.trial.limits is not None else None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py index 4dabbc8ebcdc..e12e4780382c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py @@ -130,9 +130,7 @@ def _to_rest_object(self) -> RestTopNFeaturesByAttribution: ) @classmethod - def _from_rest_object( - cls, obj: RestTopNFeaturesByAttribution - ) -> "MonitorFeatureFilter": + def _from_rest_object(cls, obj: RestTopNFeaturesByAttribution) -> "MonitorFeatureFilter": return cls(top_n_feature_importance=obj.top) @@ -302,10 +300,7 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: else "P0D" ), )._to_rest_object() - if ( - self.data_window.window_start is not None - and self.data_window.window_end is not None - ): + if self.data_window.window_start is not None and self.data_window.window_end is not None: return StaticInputData( data_context=self.data_context, target_columns=self.data_column_names, @@ -347,11 +342,7 @@ def _from_rest_object(cls, obj: RestMonitoringInputData) -> "ReferenceData": type=obj["jobInputType"], ), data_context=obj["dataContext"], - pre_processing_component=( - obj.get("preprocessingComponentId") - if input_data_type != "Fixed" - else None - ), + pre_processing_component=(obj.get("preprocessingComponentId") if input_data_type != "Fixed" else None), data_window=data_window, data_column_names=obj.get("columns"), ) @@ -402,9 +393,7 @@ def __init__( self.properties = properties @classmethod - def _from_rest_object( - cls, obj: RestMonitoringSignalBase - ) -> Optional[ # pylint: disable=too-many-return-statements + def _from_rest_object(cls, obj: RestMonitoringSignalBase) -> Optional[ # pylint: disable=too-many-return-statements Union[ "DataDriftSignal", "DataQualitySignal", @@ -468,12 +457,8 @@ def __init__( *, production_data: Optional[ProductionData] = None, reference_data: Optional[ReferenceData] = None, - features: Optional[ - Union[List[str], MonitorFeatureFilter, Literal["all_features"]] - ] = None, - feature_type_override: Optional[ - Dict[str, Union[str, MonitorFeatureDataType]] - ] = None, + features: Optional[Union[List[str], MonitorFeatureFilter, Literal["all_features"]]] = None, + feature_type_override: Optional[Dict[str, Union[str, MonitorFeatureDataType]]] = None, metric_thresholds: Optional[Union[MetricThreshold, List[MetricThreshold]]], alert_enabled: bool = False, properties: Optional[Dict[str, str]] = None, @@ -517,15 +502,9 @@ def __init__( *, production_data: Optional[ProductionData] = None, reference_data: Optional[ReferenceData] = None, - features: Optional[ - Union[List[str], MonitorFeatureFilter, Literal["all_features"]] - ] = None, - feature_type_override: Optional[ - Dict[str, Union[str, MonitorFeatureDataType]] - ] = None, - metric_thresholds: Optional[ - Union[DataDriftMetricThreshold, List[MetricThreshold]] - ] = None, + features: Optional[Union[List[str], MonitorFeatureFilter, Literal["all_features"]]] = None, + feature_type_override: Optional[Dict[str, Union[str, MonitorFeatureDataType]]] = None, + metric_thresholds: Optional[Union[DataDriftMetricThreshold, List[MetricThreshold]]] = None, alert_enabled: bool = False, data_segment: Optional[DataSegment] = None, properties: Optional[Dict[str, str]] = None, @@ -545,19 +524,12 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataDriftSignal: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - if ( - self.production_data is not None - and self.production_data.data_window is None - ): - self.production_data.data_window = BaselineDataRange( - lookback_window_size=default_data_window_size - ) + if self.production_data is not None and self.production_data.data_window is None: + self.production_data.data_window = BaselineDataRange(lookback_window_size=default_data_window_size) rest_features = _to_rest_features(self.features) if self.features else None rest_signal = RestMonitoringDataDriftSignal( production_data=( - self.production_data._to_rest_object( - default_data_window_size=default_data_window_size - ) + self.production_data._to_rest_object(default_data_window_size=default_data_window_size) if self.production_data is not None else None ), @@ -593,13 +565,9 @@ def _from_rest_object(cls, obj: RestMonitoringDataDriftSignal) -> "DataDriftSign reference_data=ReferenceData._from_rest_object(obj.reference_data), features=_from_rest_features(obj.features), feature_type_override=obj.feature_data_type_override, - metric_thresholds=DataDriftMetricThreshold._from_rest_object( - obj.metric_thresholds - ), + metric_thresholds=DataDriftMetricThreshold._from_rest_object(obj.metric_thresholds), alert_enabled=bool(obj.get("mode") == "Enabled"), - data_segment=( - DataSegment._from_rest_object(data_segment) if data_segment else None - ), + data_segment=(DataSegment._from_rest_object(data_segment) if data_segment else None), properties=obj.get("properties"), ) @@ -649,18 +617,11 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestPredictionDriftMonitoringSignal: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - if ( - self.production_data is not None - and self.production_data.data_window is None - ): - self.production_data.data_window = BaselineDataRange( - lookback_window_size=default_data_window_size - ) + if self.production_data is not None and self.production_data.data_window is None: + self.production_data.data_window = BaselineDataRange(lookback_window_size=default_data_window_size) rest_signal = RestPredictionDriftMonitoringSignal( production_data=( - self.production_data._to_rest_object( - default_data_window_size=default_data_window_size - ) + self.production_data._to_rest_object(default_data_window_size=default_data_window_size) if self.production_data is not None else None ), @@ -686,15 +647,11 @@ def _to_rest_object(self, **kwargs: Any) -> RestPredictionDriftMonitoringSignal: return rest_signal @classmethod - def _from_rest_object( - cls, obj: RestPredictionDriftMonitoringSignal - ) -> "PredictionDriftSignal": + def _from_rest_object(cls, obj: RestPredictionDriftMonitoringSignal) -> "PredictionDriftSignal": return cls( production_data=ProductionData._from_rest_object(obj.production_data), reference_data=ReferenceData._from_rest_object(obj.reference_data), - metric_thresholds=PredictionDriftMetricThreshold._from_rest_object( - obj.metric_thresholds - ), + metric_thresholds=PredictionDriftMetricThreshold._from_rest_object(obj.metric_thresholds), alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), ) @@ -732,15 +689,9 @@ def __init__( *, production_data: Optional[ProductionData] = None, reference_data: Optional[ReferenceData] = None, - features: Optional[ - Union[List[str], MonitorFeatureFilter, Literal["all_features"]] - ] = None, - feature_type_override: Optional[ - Dict[str, Union[str, MonitorFeatureDataType]] - ] = None, - metric_thresholds: Optional[ - Union[MetricThreshold, List[MetricThreshold]] - ] = None, + features: Optional[Union[List[str], MonitorFeatureFilter, Literal["all_features"]]] = None, + feature_type_override: Optional[Dict[str, Union[str, MonitorFeatureDataType]]] = None, + metric_thresholds: Optional[Union[MetricThreshold, List[MetricThreshold]]] = None, alert_enabled: bool = False, properties: Optional[Dict[str, str]] = None, ): @@ -758,10 +709,7 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - if ( - self.production_data is not None - and self.production_data.data_window is None - ): + if self.production_data is not None and self.production_data.data_window is None: self.production_data.data_window = BaselineDataRange( lookback_window_size=default_data_window_size, ) @@ -776,9 +724,7 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: ) rest_signal = RestMonitoringDataQualitySignal( production_data=( - self.production_data._to_rest_object( - default_data_window_size=default_data_window_size - ) + self.production_data._to_rest_object(default_data_window_size=default_data_window_size) if self.production_data is not None else None ), @@ -801,17 +747,13 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: return rest_signal @classmethod - def _from_rest_object( - cls, obj: RestMonitoringDataQualitySignal - ) -> "DataQualitySignal": + def _from_rest_object(cls, obj: RestMonitoringDataQualitySignal) -> "DataQualitySignal": return cls( production_data=ProductionData._from_rest_object(obj.production_data), reference_data=ReferenceData._from_rest_object(obj.reference_data), features=_from_rest_features(obj.features), feature_type_override=obj.feature_data_type_override, - metric_thresholds=DataQualityMetricThreshold._from_rest_object( - obj.metric_thresholds - ), + metric_thresholds=DataQualityMetricThreshold._from_rest_object(obj.metric_thresholds), alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), ) @@ -937,17 +879,12 @@ def __init__( self.properties = properties self.type = MonitorSignalType.FEATURE_ATTRIBUTION_DRIFT - def _to_rest_object( - self, **kwargs: Any - ) -> RestFeatureAttributionDriftMonitoringSignal: + def _to_rest_object(self, **kwargs: Any) -> RestFeatureAttributionDriftMonitoringSignal: default_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") rest_signal = RestFeatureAttributionDriftMonitoringSignal( production_data=( - [ - data._to_rest_object(default=default_window_size) - for data in self.production_data - ] + [data._to_rest_object(default=default_window_size) for data in self.production_data] if self.production_data is not None else None ), @@ -964,18 +901,11 @@ def _to_rest_object( return rest_signal @classmethod - def _from_rest_object( - cls, obj: RestFeatureAttributionDriftMonitoringSignal - ) -> "FeatureAttributionDriftSignal": + def _from_rest_object(cls, obj: RestFeatureAttributionDriftMonitoringSignal) -> "FeatureAttributionDriftSignal": return cls( - production_data=[ - FADProductionData._from_rest_object(data) - for data in obj.production_data - ], + production_data=[FADProductionData._from_rest_object(data) for data in obj.production_data], reference_data=ReferenceData._from_rest_object(obj.reference_data), - metric_thresholds=FeatureAttributionDriftMetricThreshold._from_rest_object( - obj.metric_threshold - ), + metric_thresholds=FeatureAttributionDriftMetricThreshold._from_rest_object(obj.metric_threshold), alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), ) @@ -1021,9 +951,7 @@ def _to_rest_object(self, **kwargs: Any) -> dict: ref_data_window_size = kwargs.get("ref_data_window_size") if self.properties is None: self.properties = {} - self.properties["azureml.modelmonitor.model_performance_thresholds"] = ( - self.metric_thresholds._to_str_object() - ) + self.properties["azureml.modelmonitor.model_performance_thresholds"] = self.metric_thresholds._to_str_object() if self.production_data.data_window is None: self.production_data.data_window = BaselineDataRange( lookback_window_size=default_data_window_size, @@ -1031,19 +959,13 @@ def _to_rest_object(self, **kwargs: Any) -> dict: # ``ModelPerformanceSignal`` is not in arm_ml_service; emit the wire dict directly. rest_obj = { "signalType": "ModelPerformance", - "productionData": [ - self.production_data._to_rest_object( - default_data_window_size=default_data_window_size - ) - ], + "productionData": [self.production_data._to_rest_object(default_data_window_size=default_data_window_size)], "referenceData": self.reference_data._to_rest_object( default_data_window_size=default_data_window_size, ref_data_window_size=ref_data_window_size, ), "metricThreshold": self.metric_thresholds._to_rest_object(), - "dataSegment": ( - self.data_segment._to_rest_object() if self.data_segment else None - ), + "dataSegment": (self.data_segment._to_rest_object() if self.data_segment else None), "mode": "Enabled" if self.alert_enabled else "Disabled", "properties": self.properties, } @@ -1055,12 +977,8 @@ def _from_rest_object(cls, obj) -> "ModelPerformanceSignal": return cls( production_data=ProductionData._from_rest_object(obj["productionData"][0]), reference_data=ReferenceData._from_rest_object(obj["referenceData"]), - metric_thresholds=ModelPerformanceMetricThreshold._from_rest_object( - obj["metricThreshold"] - ), - data_segment=( - DataSegment._from_rest_object(data_segment) if data_segment else None - ), + metric_thresholds=ModelPerformanceMetricThreshold._from_rest_object(obj["metricThreshold"]), + data_segment=(DataSegment._from_rest_object(data_segment) if data_segment else None), alert_enabled=bool(obj.get("mode") == "Enabled"), ) @@ -1146,32 +1064,21 @@ def __init__( self.properties = properties self.connection = connection - def _to_rest_object( - self, **kwargs: Any - ) -> RestCustomMonitoringSignal: # pylint:disable=unused-argument + def _to_rest_object(self, **kwargs: Any) -> RestCustomMonitoringSignal: # pylint:disable=unused-argument if self.connection is None: self.connection = Connection() # ``inputs`` come from the shared arm_ml_service dataset-literal helper; emit their camelCase wire # dicts (``as_dict`` on the hybrid model) so they fit inside the arm_ml_service signal envelope # without changing the wire body. - rest_inputs = ( - to_rest_dataset_literal_inputs(self.inputs, job_type=None) - if self.inputs - else None - ) + rest_inputs = to_rest_dataset_literal_inputs(self.inputs, job_type=None) if self.inputs else None if rest_inputs is not None: rest_inputs = {name: value.as_dict() for name, value in rest_inputs.items()} rest_signal = RestCustomMonitoringSignal( component_id=self.component_id, - metric_thresholds=[ - threshold._to_rest_object() for threshold in self.metric_thresholds - ], + metric_thresholds=[threshold._to_rest_object() for threshold in self.metric_thresholds], inputs=rest_inputs, input_assets=( - { - asset_name: asset_value._to_rest_object() - for asset_name, asset_value in self.input_data.items() - } + {asset_name: asset_value._to_rest_object() for asset_name, asset_value in self.input_data.items()} if self.input_data else None ), @@ -1184,30 +1091,18 @@ def _to_rest_object( return rest_signal @classmethod - def _from_rest_object( - cls, obj: RestCustomMonitoringSignal - ) -> "CustomMonitoringSignal": + def _from_rest_object(cls, obj: RestCustomMonitoringSignal) -> "CustomMonitoringSignal": workspace_connection = obj.get("workspaceConnection") return cls( - inputs=( - from_rest_inputs_to_dataset_literal(obj.inputs) if obj.inputs else None - ), - input_data={ - key: ReferenceData._from_rest_object(data) - for key, data in obj.input_assets.items() - }, + inputs=(from_rest_inputs_to_dataset_literal(obj.inputs) if obj.inputs else None), + input_data={key: ReferenceData._from_rest_object(data) for key, data in obj.input_assets.items()}, metric_thresholds=[ - CustomMonitoringMetricThreshold._from_rest_object(metric) - for metric in obj.metric_thresholds + CustomMonitoringMetricThreshold._from_rest_object(metric) for metric in obj.metric_thresholds ], component_id=obj.component_id, alert_enabled=bool(obj.get("mode") == "Enabled"), properties=obj.get("properties"), - connection=( - Connection._from_rest_object(workspace_connection) - if workspace_connection - else None - ), + connection=(Connection._from_rest_object(workspace_connection) if workspace_connection else None), ) @@ -1314,10 +1209,7 @@ def _to_rest_object(self, **kwargs: Any) -> dict: rest_obj = { "signalType": "GenerationSafetyQuality", "productionData": ( - [ - data._to_rest_object(default=data_window_size) - for data in self.production_data - ] + [data._to_rest_object(default=data_window_size) for data in self.production_data] if self.production_data is not None else None ), @@ -1332,9 +1224,7 @@ def _to_rest_object(self, **kwargs: Any) -> dict: @classmethod def _from_rest_object(cls, obj) -> "GenerationSafetyQualitySignal": return cls( - production_data=[ - LlmData._from_rest_object(data) for data in obj["productionData"] - ], + production_data=[LlmData._from_rest_object(data) for data in obj["productionData"]], connection_id=obj.get("workspaceConnectionId"), metric_thresholds=GenerationSafetyQualityMonitoringMetricThreshold._from_rest_object( obj["metricThresholds"] @@ -1377,9 +1267,7 @@ def __init__( self, *, production_data: Optional[LlmData] = None, - metric_thresholds: Optional[ - GenerationTokenStatisticsMonitorMetricThreshold - ] = None, + metric_thresholds: Optional[GenerationTokenStatisticsMonitorMetricThreshold] = None, alert_enabled: bool = False, properties: Optional[Dict[str, str]] = None, sampling_rate: Optional[float] = None, @@ -1471,9 +1359,7 @@ def _to_rest_num_cat_metrics(numerical_metrics: Any, categorical_metrics: Any) - return metrics -def _to_rest_data_quality_metrics( - numerical_metrics: Any, categorical_metrics: Any -) -> List: +def _to_rest_data_quality_metrics(numerical_metrics: Any, categorical_metrics: Any) -> List: metric_thresholds: List = [] if numerical_metrics is not None: metric_thresholds = metric_thresholds + numerical_metrics._to_rest_object() diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py index c0086734d8b6..9023d506853e 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py @@ -47,7 +47,9 @@ def test_create_in_non_ipp_registry(self, mock_component_operation: ComponentOpe return_value=CommandComponent(), ), patch( "azure.ai.ml.operations._component_operations.begin_create_or_update_registry_versioned_asset" - ) as mock_create, patch("azure.ai.ml.operations._component_operations.polling_wait"): + ) as mock_create, patch( + "azure.ai.ml.operations._component_operations.polling_wait" + ): mock_component_operation.create_or_update(component) mock_thing.assert_called_once() @@ -68,7 +70,9 @@ def test_create_in_ipp_registry(self, mock_component_operation: ComponentOperati return_value=CommandComponent(), ), patch( "azure.ai.ml.operations._component_operations.begin_create_or_update_registry_versioned_asset" - ) as mock_create, patch("azure.ai.ml.operations._component_operations.polling_wait"): + ) as mock_create, patch( + "azure.ai.ml.operations._component_operations.polling_wait" + ): mock_component_operation.create_or_update(component) # for IPP components, we need to make sure _resolve_arm_id_or_upload_dependencies is not called mock_thing.assert_not_called() diff --git a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py index 7415292d3fcf..e2f950f2d867 100644 --- a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py +++ b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py @@ -142,9 +142,7 @@ def test_get_in_registry_with_version(self, mock_data_operations_in_registry: Da name_only = "some_name" version = "1" data_asset = Data(name=name_only, version=version) - with patch( - "azure.ai.ml.operations._data_operations.get_registry_versioned_asset" - ) as mock_get, patch( + with patch("azure.ai.ml.operations._data_operations.get_registry_versioned_asset") as mock_get, patch( "azure.ai.ml.operations._data_operations.DataVersionBase._deserialize", return_value=Mock() ), patch.object(Data, "_from_rest_object", return_value=data_asset): mock_data_operations_in_registry.get(name_only, version) diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py index 660696bb454f..68598f641b82 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_controlflow_pipeline.py @@ -83,10 +83,7 @@ def condition_pipeline(): with pytest.raises(ValidationError) as e: pipeline_job = condition_pipeline() pipeline_job._validate(raise_error=True) - assert ( - "True block and false block cannot contain same nodes: {'${{parent.jobs.node1}}'" - in str(e.value) - ) + assert "True block and false block cannot contain same nodes: {'${{parent.jobs.node1}}'" in str(e.value) @pipeline(compute="cpu-cluster") def condition_pipeline(): @@ -94,9 +91,7 @@ def condition_pipeline(): node1 = hello_world_component_no_paths() node2 = hello_world_component_no_paths() # true block and false block has intersection - condition( - condition=result.outputs.output, false_block=[node1], true_block=[node2] - ) + condition(condition=result.outputs.output, false_block=[node1], true_block=[node2]) # no error raise pipeline_job = condition_pipeline() @@ -112,9 +107,7 @@ def test_create_dsl_condition_illegal_cases(self): node = condition(condition=1, true_block=basic_node) node._validate(raise_error=True) - assert f"must be an instance of {str}, {bool} or {InputOutputBase}" in str( - e.value - ) + assert f"must be an instance of {str}, {bool} or {InputOutputBase}" in str(e.value) node = condition(condition=basic_node.outputs.output3, true_block=basic_node) node._validate(raise_error=True) @@ -123,9 +116,7 @@ def test_create_dsl_condition_illegal_cases(self): node = condition(condition="${{parent.jobs.xxx.outputs.output}}") node._validate(raise_error=True) - assert "True block and false block cannot be empty at the same time." in str( - e.value - ) + assert "True block and false block cannot be empty at the same time." in str(e.value) with pytest.raises(ValidationError) as e: node = condition( @@ -191,9 +182,7 @@ def condition_pipeline(): result = basic_component() node1 = hello_world_component_no_paths(component_in_number=1) node2 = hello_world_component_no_paths(component_in_number=2) - condition( - condition=result.outputs.output, false_block=node1, true_block=node2 - ) + condition(condition=result.outputs.output, false_block=node1, true_block=node2) pipeline_job = condition_pipeline() omit_fields = [ @@ -202,9 +191,7 @@ def condition_pipeline(): "properties.jobs.*.componentId", "properties.settings", ] - dsl_pipeline_job_dict = omit_with_wildcard( - as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields - ) + dsl_pipeline_job_dict = omit_with_wildcard(as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields) assert dsl_pipeline_job_dict["properties"]["jobs"] == { "conditionnode": { "_source": "DSL", @@ -215,17 +202,13 @@ def condition_pipeline(): }, "node1": { "_source": "YAML.COMPONENT", - "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "1"} - }, + "inputs": {"component_in_number": {"job_input_type": "literal", "value": "1"}}, "name": "node1", "type": "command", }, "node2": { "_source": "YAML.COMPONENT", - "inputs": { - "component_in_number": {"job_input_type": "literal", "value": "2"} - }, + "inputs": {"component_in_number": {"job_input_type": "literal", "value": "2"}}, "name": "node2", "type": "command", }, @@ -256,18 +239,14 @@ def condition_pipeline(group_input: ParentGroup): node1 = hello_world_component_no_paths(component_in_number=1) condition(condition=group_input.input_group.num < 100, true_block=node1) - pipeline_job = condition_pipeline( - group_input=ParentGroup(input_group=SubGroup(num=10)) - ) + pipeline_job = condition_pipeline(group_input=ParentGroup(input_group=SubGroup(num=10))) omit_fields = [ "name", "properties.display_name", "properties.jobs.*.componentId", "properties.settings", ] - dsl_pipeline_job_dict = omit_with_wildcard( - as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields - ) + dsl_pipeline_job_dict = omit_with_wildcard(as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields) assert dsl_pipeline_job_dict["properties"]["jobs"]["expression_component"] == { "environment_variables": {"AZURE_ML_CLI_PRIVATE_FEATURES_ENABLED": "true"}, "name": "expression_component", @@ -398,12 +377,8 @@ def pipeline_with_do_while( def validate_error_message(expect_errors, validate_errors): for path, msg in expect_errors.items(): - acture_errors = list( - filter(lambda error: error["path"] == path, validate_errors) - ) - assert ( - acture_errors - ), f"Cannot find the error of {path} in validation results." + acture_errors = list(filter(lambda error: error["path"] == path, validate_errors)) + assert acture_errors, f"Cannot find the error of {path} in validation results." for acture_error in acture_errors: assert acture_error["message"] in msg @@ -412,9 +387,7 @@ def validate_error_message(expect_errors, validate_errors): "jobs.out_of_max_iteration_count_range.limit.max_iteration_count": [ "The max iteration count cannot be less than 0 or larger than 1000." ], - "jobs.body_in_other_loop.body": [ - "The body of loop node cannot be promoted as another loop again." - ], + "jobs.body_in_other_loop.body": ["The body of loop node cannot be promoted as another loop again."], "jobs.invalid_mapping.condition": [ "is_number_larger_than_zero is the output of do_while_body_pipeline_1, dowhile only accept output of the body: do_while_body_pipeline_3." ], @@ -463,13 +436,10 @@ def invalid_pipeline(test_path1, test_path2): ) with pytest.raises(ValidationException) as e: - invalid_pipeline( - test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2") - ) + invalid_pipeline(test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2")) assert ( "Expecting (, " - ") for body" - in str(e.value) + ") for body" in str(e.value) ) # items with invalid type @@ -529,13 +499,7 @@ def invalid_pipeline(): ), ( # local file input - [ - { - "component_in_path": Input( - path="./tests/test_configs/components/helloworld_component.yml" - ) - } - ], + [{"component_in_path": Input(path="./tests/test_configs/components/helloworld_component.yml")}], "Local file input", ), ( @@ -550,12 +514,8 @@ def invalid_pipeline(): ), ], ) - def test_dsl_parallel_for_pipeline_illegal_items_content( - self, items, error_message - ): - basic_component = load_component( - source="./tests/test_configs/components/helloworld_component.yml" - ) + def test_dsl_parallel_for_pipeline_illegal_items_content(self, items, error_message): + basic_component = load_component(source="./tests/test_configs/components/helloworld_component.yml") @pipeline def invalid_pipeline(): @@ -578,9 +538,7 @@ def invalid_pipeline(): ), ) def test_dsl_parallel_for_pipeline_legal_items_content(self, items): - basic_component = load_component( - source="./tests/test_configs/components/helloworld_component.yml" - ) + basic_component = load_component(source="./tests/test_configs/components/helloworld_component.yml") @pipeline def valid_pipeline(): @@ -595,12 +553,8 @@ def valid_pipeline(): def test_dsl_parallel_for_pipeline_items(self): # TODO: submit those pipelines - basic_component = load_component( - source="./tests/test_configs/components/helloworld_component.yml" - ) - complex_component = load_component( - source="./tests/test_configs/components/input_types_component.yml" - ) + basic_component = load_component(source="./tests/test_configs/components/helloworld_component.yml") + complex_component = load_component(source="./tests/test_configs/components/input_types_component.yml") # binding in items @@ -615,9 +569,7 @@ def my_pipeline(test_path1, test_path2): ], ) - my_job = my_pipeline( - test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2") - ) + my_job = my_pipeline(test_path1=Input(path="test_path1"), test_path2=Input(path="test_path2")) rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert ( @@ -640,10 +592,7 @@ def my_pipeline(): my_job = my_pipeline() rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] - assert ( - rest_items - == '{"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}}' - ) + assert rest_items == '{"iter1": {"component_in_number": 1}, "iter2": {"component_in_number": 2}}' # binding items @pipeline @@ -651,9 +600,7 @@ def my_pipeline(pipeline_input: str): body = basic_component(component_in_path=Input(path="test_path1")) parallel_for(body=body, items=pipeline_input) - my_job = my_pipeline( - pipeline_input='[{"component_in_number": 1}, {"component_in_number": 2}]' - ) + my_job = my_pipeline(pipeline_input='[{"component_in_number": 1}, {"component_in_number": 2}]') rest_job = as_attribute_dict(my_job._to_rest_object()) rest_items = rest_job["properties"]["jobs"]["parallelfor"]["items"] assert rest_items == "${{parent.inputs.pipeline_input}}" @@ -763,9 +710,7 @@ def my_pipeline(): ({"type": "integer"}, {}, {"type": "string"}, False), ], ) - def test_parallel_for_outputs( - self, output_dict, pipeline_out_dict, component_out_dict, check_pipeline_job - ): + def test_parallel_for_outputs(self, output_dict, pipeline_out_dict, component_out_dict, check_pipeline_job): basic_component = load_component( source="./tests/test_configs/components/helloworld_component.yml", params_override=[{"outputs.component_out_path": output_dict}], @@ -793,9 +738,7 @@ def my_pipeline(): pipeline_component = my_job.component rest_component = pipeline_component._to_rest_object().as_dict() - assert rest_component["properties"]["componentSpec"]["outputs"] == { - "output": component_out_dict - } + assert rest_component["properties"]["componentSpec"]["outputs"] == {"output": component_out_dict} def test_parallel_for_source(self): basic_component = load_component( @@ -837,11 +780,7 @@ def my_pipeline(): ( # asset input with uri { - "silo1": { - "uri": Input( - path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv" - ) - }, + "silo1": {"uri": Input(path="https://dprepdata.blob.core.windows.net/demo/Titanic.csv")}, }, '{"silo1": {"uri": {"uri": "https://dprepdata.blob.core.windows.net/demo/Titanic.csv", ' '"job_input_type": "uri_folder"}}}', @@ -849,11 +788,7 @@ def my_pipeline(): ( # asset input binding { - "silo1": { - "binding": PipelineInput( - name="input1", owner="pipeline", meta=None - ) - }, + "silo1": {"binding": PipelineInput(name="input1", owner="pipeline", meta=None)}, }, '{"silo1": {"binding": "${{parent.inputs.input1}}"}}', ), @@ -889,13 +824,7 @@ def test_to_rest_items(self, items, rest_input_str): ), ( # local file input - [ - { - "component_in_path": Input( - path="./tests/test_configs/components/helloworld_component.yml" - ) - } - ], + [{"component_in_path": Input(path="./tests/test_configs/components/helloworld_component.yml")}], "Local file input", ), ( diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py index 481f7f247fe1..942bf9e82b95 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_samples.py @@ -175,9 +175,7 @@ def get_dataset(*args, **kwargs): return "sampledata1235:2" # change internal assets into arm id - with mock.patch( - "azure.ai.ml._ml_client.DataOperations.get", side_effect=get_dataset - ): + with mock.patch("azure.ai.ml._ml_client.DataOperations.get", side_effect=get_dataset): pipeline = dataset_input(mock_machinelearning_client) job_yaml = str(samples_dir / "dataset_input/pipeline.yml") omit_fields = [ @@ -377,9 +375,7 @@ def test_parallel_components_with_tabular_input( ) pipeline = pipeline_with_parallel_components() - job_yaml = str( - samples_dir / "parallel_component_with_tabular_input/pipeline.yml" - ) + job_yaml = str(samples_dir / "parallel_component_with_tabular_input/pipeline.yml") omit_fields = [ "name", "properties.display_name", @@ -482,9 +478,7 @@ def test_data_transfer_copy_job_in_pipeline(self) -> None: ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline.yml") omit_fields = [ "properties.display_name", "properties.jobs.merge_files.componentId", @@ -499,9 +493,7 @@ def test_data_transfer_copy_inline_job_in_pipeline(self) -> None: ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml") omit_fields = [ "properties.display_name", "properties.jobs.merge_files.componentId", @@ -516,9 +508,7 @@ def test_data_transfer_copy_job_builder_with_inline_job(self) -> None: ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/copy_data/pipeline_inline.yml") omit_fields = [ "properties.display_name", "properties.jobs.merge_files.componentId", @@ -533,10 +523,7 @@ def test_data_transfer_import_database_job_builder_with_inline_job(self) -> None ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir - / "data_transfer_job_in_pipeline/import_database/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/import_database/pipeline_inline.yml") omit_fields = [ "properties.display_name", ] @@ -550,10 +537,7 @@ def test_data_transfer_import_stored_database_job_builder_with_inline_job( ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir - / "data_transfer_job_in_pipeline/import_stored_database/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/import_stored_database/pipeline_inline.yml") omit_fields = [ "properties.display_name", ] @@ -565,10 +549,7 @@ def test_data_transfer_import_file_system_job_builder_with_inline_job(self) -> N ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir - / "data_transfer_job_in_pipeline/import_file_system/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/import_file_system/pipeline_inline.yml") omit_fields = [ "properties.display_name", ] @@ -580,10 +561,7 @@ def test_data_transfer_export_database_job_builder_with_inline_job(self) -> None ) pipeline = data_transfer_job_in_pipeline() - job_yaml = str( - samples_dir - / "data_transfer_job_in_pipeline/export_database/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/export_database/pipeline_inline.yml") omit_fields = [ "properties.display_name", "properties.inputs.cosmos_folder.uri", @@ -596,23 +574,18 @@ def test_data_transfer_export_file_system_job_builder_with_inline_job(self) -> N generate_dsl_pipeline_from_builder as data_transfer_job_in_pipeline, ) - job_yaml = str( - samples_dir - / "data_transfer_job_in_pipeline/export_file_system/pipeline_inline.yml" - ) + job_yaml = str(samples_dir / "data_transfer_job_in_pipeline/export_file_system/pipeline_inline.yml") with pytest.raises(ValidationException) as e: data_transfer_job_in_pipeline() assert ( - "Sink is a required field for export data task and we don't support exporting file system for now." - in e + "Sink is a required field for export data task and we don't support exporting file system for now." in e ) with pytest.raises(ValidationException) as e: load_job(source=job_yaml) assert ( - "Sink is a required field for export data task and we don't support exporting file system for now." - in e + "Sink is a required field for export data task and we don't support exporting file system for now." in e ) def test_data_transfer_multi_job_in_pipeline(self) -> None: diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py index 573abf3c9e4f..390874866a15 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_dsl_pipeline_with_specific_nodes.py @@ -74,12 +74,8 @@ class TestDSLPipelineWithSpecificNodes: def test_dsl_pipeline_sweep_node(self) -> None: yaml_file = "./tests/test_configs/components/helloworld_component.yml" - @dsl.pipeline( - name="train_with_sweep_in_pipeline", default_compute="cpu-cluster" - ) - def train_with_sweep_in_pipeline( - raw_data, primary_metric: str = "AUC", max_total_trials: int = 10 - ): + @dsl.pipeline(name="train_with_sweep_in_pipeline", default_compute="cpu-cluster") + def train_with_sweep_in_pipeline(raw_data, primary_metric: str = "AUC", max_total_trials: int = 10): component_to_sweep: CommandComponent = load_component(source=yaml_file) cmd_node1: Command = component_to_sweep( component_in_number=Choice([2, 3, 4, 5]), component_in_path=raw_data @@ -113,9 +109,7 @@ def train_with_sweep_in_pipeline( max_total_trials=10, ) - component_to_link = load_component( - source=yaml_file, params_override=[{"name": "node_to_link"}] - ) + component_to_link = load_component(source=yaml_file, params_override=[{"name": "node_to_link"}]) link_node = component_to_link( component_in_number=2, component_in_path=sweep_job1.outputs.component_out_path, @@ -133,9 +127,7 @@ def train_with_sweep_in_pipeline( max_total_trials=100, primary_metric="accuracy", ) - assert ( - len(pipeline.jobs) == 4 - ), f"Expect 4 nodes are collected but got {len(pipeline.jobs)}" + assert len(pipeline.jobs) == 4, f"Expect 4 nodes are collected but got {len(pipeline.jobs)}" assert pipeline.component._source == "DSL" assert pipeline.component._job_types == {"sweep": 3, "command": 1} assert pipeline.component._job_sources == {"YAML.COMPONENT": 4} @@ -145,13 +137,9 @@ def train_with_sweep_in_pipeline( sweep_node_dict = sweep_node._to_dict() assert pydash.get(sweep_node_dict, "limits.max_total_trials", None) == 10 sweep_node_rest_obj = sweep_node._to_rest_object() - sweep_node_dict_from_rest = Sweep._from_rest_object( - sweep_node_rest_obj - )._to_dict() + sweep_node_dict_from_rest = Sweep._from_rest_object(sweep_node_rest_obj)._to_dict() omit_fields = ["trial"] - assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit( - sweep_node_dict_from_rest, *omit_fields - ) + assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit(sweep_node_dict_from_rest, *omit_fields) pipeline_dict = pipeline._to_dict() for dot_key, expected_value in [ @@ -175,9 +163,7 @@ def train_with_sweep_in_pipeline( "outputs", # TODO: figure out why outputs can't be regenerated correctly ] # Change float to string to make dict from local and rest compatible - pipeline_dict["inputs"]["max_total_trials"] = str( - pipeline_dict["inputs"]["max_total_trials"] - ) + pipeline_dict["inputs"]["max_total_trials"] = str(pipeline_dict["inputs"]["max_total_trials"]) pipeline_dict["jobs"]["link_node"]["inputs"]["component_in_number"] = str( pipeline_dict["jobs"]["link_node"]["inputs"]["component_in_number"] ) @@ -215,12 +201,8 @@ def train_with_sweep_in_pipeline(): sampling_algorithm="random", ) hello_sweep.compute = "cpu-cluster" - hello_sweep.set_limits( - max_total_trials=2, max_concurrent_trials=3, timeout=600 - ) - hello_sweep.early_termination = BanditPolicy( - evaluation_interval=2, slack_factor=0.1, delay_evaluation=1 - ) + hello_sweep.set_limits(max_total_trials=2, max_concurrent_trials=3, timeout=600) + hello_sweep.early_termination = BanditPolicy(evaluation_interval=2, slack_factor=0.1, delay_evaluation=1) dsl_pipeline: PipelineJob = train_with_sweep_in_pipeline() dsl_pipeline.jobs["hello_sweep"].outputs.trained_model_dir = Output( @@ -234,13 +216,9 @@ def train_with_sweep_in_pipeline(): sweep_node.component._id = "azureml:test_component:1" sweep_node_dict = sweep_node._to_dict() sweep_node_rest_obj = sweep_node._to_rest_object() - sweep_node_dict_from_rest = Sweep._from_rest_object( - sweep_node_rest_obj - )._to_dict() + sweep_node_dict_from_rest = Sweep._from_rest_object(sweep_node_rest_obj)._to_dict() omit_fields = ["trial"] - assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit( - sweep_node_dict_from_rest, *omit_fields - ) + assert pydash.omit(sweep_node_dict, *omit_fields) == pydash.omit(sweep_node_dict_from_rest, *omit_fields) def test_dsl_pipeline_with_sweep_distributed_component_setting_instance_type( self, @@ -250,9 +228,7 @@ def test_dsl_pipeline_with_sweep_distributed_component_setting_instance_type( @dsl.pipeline(force_rerun=True) def train_with_sweep_in_pipeline(raw_data): component_to_sweep: CommandComponent = load_component(source=yaml_file) - cmd_node: Command = component_to_sweep( - component_in_number=Choice([2, 3, 4, 5]), component_in_path=raw_data - ) + cmd_node: Command = component_to_sweep(component_in_number=Choice([2, 3, 4, 5]), component_in_path=raw_data) sweep_job: Sweep = cmd_node.sweep( primary_metric="AUC", # primary_metric, goal="maximize", @@ -262,9 +238,7 @@ def train_with_sweep_in_pipeline(raw_data): sweep_job.compute = "test-aks-large" sweep_job.set_limits(max_total_trials=10) - pipeline: PipelineJob = train_with_sweep_in_pipeline( - raw_data=Input(path="/a/path/on/ds", mode="ro_mount") - ) + pipeline: PipelineJob = train_with_sweep_in_pipeline(raw_data=Input(path="/a/path/on/ds", mode="ro_mount")) pipeline.settings.default_compute = "test-aks-large" pytorch_node = pipeline.jobs["sweep_job"] @@ -275,9 +249,7 @@ def train_with_sweep_in_pipeline(raw_data): "limits": {"max_total_trials": 10}, "sampling_algorithm": "random", "objective": {"goal": "maximize", "primary_metric": "AUC"}, - "search_space": { - "component_in_number": {"values": [2, 3, 4, 5], "type": "choice"} - }, + "search_space": {"component_in_number": {"values": [2, 3, 4, 5], "type": "choice"}}, "name": "sweep_job", "type": "sweep", "computeId": "test-aks-large", @@ -325,9 +297,7 @@ def train_with_parallel_in_pipeline(): regenerated_parallel_node._base_path = Path(yaml_file).parent parallel_node_dict_from_rest = regenerated_parallel_node._to_dict() omit_fields = ["component"] - assert pydash.omit(parallel_node_dict, *omit_fields) == pydash.omit( - parallel_node_dict_from_rest, *omit_fields - ) + assert pydash.omit(parallel_node_dict, *omit_fields) == pydash.omit(parallel_node_dict_from_rest, *omit_fields) def test_dsl_pipeline_with_spark(self) -> None: add_greeting_column_func = load_component( @@ -367,18 +337,14 @@ def spark_pipeline_from_yaml(iris_data): spark_node_dict_from_rest = regenerated_spark_node._to_dict() omit_fields = [] - assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit( - spark_node_dict_from_rest, *omit_fields - ) + assert pydash.omit(spark_node_dict, *omit_fields) == pydash.omit(spark_node_dict_from_rest, *omit_fields) omit_fields = [ "jobs.add_greeting_column.componentId", "jobs.add_greeting_column.properties", "jobs.count_by_row.componentId", "jobs.count_by_row.properties", ] - actual_job = pydash.omit( - as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields - ) + actual_job = pydash.omit(as_attribute_dict(dsl_pipeline._to_rest_object().properties), *omit_fields) assert actual_job == { "description": "submit a pipeline with spark job", "display_name": "spark_pipeline_from_yaml", @@ -421,8 +387,7 @@ def spark_pipeline_from_yaml(iris_data): }, "count_by_row": { "_source": "YAML.COMPONENT", - "args": "--file_input ${{inputs.file_input}} " - "--output ${{outputs.output}}", + "args": "--file_input ${{inputs.file_input}} " "--output ${{outputs.output}}", "computeId": "spark31", "conf": { "spark.driver.cores": 2, @@ -470,9 +435,7 @@ def test_pipeline_with_command_function(self): expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} inputs = { - "component_in_path": Input( - type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount" - ), + "component_in_path": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), "component_in_number": 0.01, } outputs = {"component_out_path": Output(type="mlflow_model", mode="rw_mount")} @@ -677,12 +640,8 @@ def test_pipeline_with_data_transfer_copy_function(self): @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_copy_function") def pipeline(folder1, folder2): node1 = component_func(folder1=folder1, folder2=folder2) - node2 = data_transfer_job_func( - folder1=node1.outputs.output_folder, folder2=node1.outputs.output_folder - ) - node3 = data_transfer_function( - folder1=node2.outputs.output, folder2=node2.outputs.output - ) + node2 = data_transfer_job_func(folder1=node1.outputs.output_folder, folder2=node1.outputs.output_folder) + node3 = data_transfer_function(folder1=node2.outputs.output, folder2=node2.outputs.output) return { "pipeline_output": node3.outputs.output, } @@ -790,15 +749,11 @@ def test_pipeline_with_data_transfer_import_database_function(self): "query": query_source_snowflake, } - @dsl.pipeline( - experiment_name="test_pipeline_with_data_transfer_import_database_function" - ) + @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_import_database_function") def pipeline(query_source_snowflake, connection_target_azuresql): node1 = import_data(source=Database(**source), outputs=outputs) - source_snowflake = Database( - query=query_source_snowflake, connection=connection_target_azuresql - ) + source_snowflake = Database(query=query_source_snowflake, connection=connection_target_azuresql) node2 = import_data(source=source_snowflake, outputs=outputs) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] @@ -857,24 +812,20 @@ def pipeline(query_source_snowflake, connection_target_azuresql): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = ( - data_transfer_import_node._to_rest_object() - ) - regenerated_data_transfer_import_node = ( - DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) + data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() + regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( + data_transfer_import_node_rest_obj ) - data_transfer_import_node_dict_from_rest = ( - regenerated_data_transfer_import_node._to_dict() - ) + data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit( - data_transfer_import_node_dict, *omit_fields - ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) + assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( + data_transfer_import_node_dict_from_rest, *omit_fields + ) def test_pipeline_with_data_transfer_import_stored_database_function(self): stored_procedure = "SelectEmployeeByJobAndDepartment" @@ -888,9 +839,7 @@ def test_pipeline_with_data_transfer_import_stored_database_function(self): "stored_procedure_params": stored_procedure_params, } - @dsl.pipeline( - experiment_name="test_pipeline_with_data_transfer_import_stored_database_function" - ) + @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_import_stored_database_function") def pipeline(): node2 = import_data(source=Database(**source), outputs=outputs) @@ -935,24 +884,20 @@ def pipeline(): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = ( - data_transfer_import_node._to_rest_object() - ) - regenerated_data_transfer_import_node = ( - DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) + data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() + regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( + data_transfer_import_node_rest_obj ) - data_transfer_import_node_dict_from_rest = ( - regenerated_data_transfer_import_node._to_dict() - ) + data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit( - data_transfer_import_node_dict, *omit_fields - ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) + assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( + data_transfer_import_node_dict_from_rest, *omit_fields + ) def test_pipeline_with_data_transfer_import_file_system_function(self): path_source_s3 = "s3://my_bucket/my_folder" @@ -965,15 +910,11 @@ def test_pipeline_with_data_transfer_import_file_system_function(self): } source = {"connection": connection_target, "path": path_source_s3} - @dsl.pipeline( - experiment_name="test_pipeline_with_data_transfer_import_file_system_function" - ) + @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_import_file_system_function") def pipeline(path_source_s3, connection_target): node2 = import_data(source=FileSystem(**source), outputs=outputs) - source_snowflake = FileSystem( - path=path_source_s3, connection=connection_target - ) + source_snowflake = FileSystem(path=path_source_s3, connection=connection_target) node4 = import_data(source=source_snowflake, outputs=outputs) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] @@ -1042,24 +983,20 @@ def pipeline(path_source_s3, connection_target): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = ( - data_transfer_import_node._to_rest_object() - ) - regenerated_data_transfer_import_node = ( - DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) + data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() + regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( + data_transfer_import_node_rest_obj ) - data_transfer_import_node_dict_from_rest = ( - regenerated_data_transfer_import_node._to_dict() - ) + data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit( - data_transfer_import_node_dict, *omit_fields - ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) + assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( + data_transfer_import_node_dict_from_rest, *omit_fields + ) def test_pipeline_with_data_transfer_export_database_function(self): connection_target_azuresql = "azureml:my_azuresql_connection" @@ -1075,15 +1012,11 @@ def test_pipeline_with_data_transfer_export_database_function(self): "table_name": table_name, } - @dsl.pipeline( - experiment_name="test_pipeline_with_data_transfer_export_database_function" - ) + @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_export_database_function") def pipeline(table_name, connection_target_azuresql): node2 = export_data(inputs={"source": cosmos_folder}, sink=sink) - source_snowflake = Database( - table_name=table_name, connection=connection_target_azuresql - ) + source_snowflake = Database(table_name=table_name, connection=connection_target_azuresql) node4 = export_data(inputs={"source": cosmos_folder}, sink=source_snowflake) omit_fields = ["properties.jobs.*.componentId", "properties.experiment_name"] @@ -1152,24 +1085,20 @@ def pipeline(table_name, connection_target_azuresql): data_transfer_import_node = pipeline1.jobs[key] data_transfer_import_node_dict = data_transfer_import_node._to_dict() - data_transfer_import_node_rest_obj = ( - data_transfer_import_node._to_rest_object() - ) - regenerated_data_transfer_import_node = ( - DataTransferImport._from_rest_object(data_transfer_import_node_rest_obj) + data_transfer_import_node_rest_obj = data_transfer_import_node._to_rest_object() + regenerated_data_transfer_import_node = DataTransferImport._from_rest_object( + data_transfer_import_node_rest_obj ) - data_transfer_import_node_dict_from_rest = ( - regenerated_data_transfer_import_node._to_dict() - ) + data_transfer_import_node_dict_from_rest = regenerated_data_transfer_import_node._to_dict() # data_transfer_import_node_dict will dump to component dict according to schema, but # regenerated_data_transfer_import_node will only keep component id when call _to_rest_object() omit_fields = ["component"] - assert pydash.omit( - data_transfer_import_node_dict, *omit_fields - ) == pydash.omit(data_transfer_import_node_dict_from_rest, *omit_fields) + assert pydash.omit(data_transfer_import_node_dict, *omit_fields) == pydash.omit( + data_transfer_import_node_dict_from_rest, *omit_fields + ) def test_pipeline_with_spark_function(self): # component func @@ -1228,13 +1157,9 @@ def test_pipeline_with_spark_function(self): def pipeline(iris_data, sample_rate): node1 = component_func(input1=iris_data, sample_rate=sample_rate) node1.compute = synapse_compute_name - node2 = spark_job_func( - input1=node1.outputs.output1, sample_rate=sample_rate - ) + node2 = spark_job_func(input1=node1.outputs.output1, sample_rate=sample_rate) node2.compute = synapse_compute_name - node3 = spark_function( - input1=node2.outputs.output1, sample_rate=sample_rate - ) + node3 = spark_function(input1=node2.outputs.output1, sample_rate=sample_rate) return { "pipeline_output1": node1.outputs.output1, "pipeline_output2": node2.outputs.output1, @@ -1462,13 +1387,9 @@ def test_pipeline_with_spark_function_by_setting_conf(self, client): def pipeline(iris_data, sample_rate): node1 = component_func(input1=iris_data, sample_rate=sample_rate) node1.compute = synapse_compute_name - node2 = spark_job_func( - input1=node1.outputs.output1, sample_rate=sample_rate - ) + node2 = spark_job_func(input1=node1.outputs.output1, sample_rate=sample_rate) node2.compute = synapse_compute_name - node3 = spark_function( - input1=node2.outputs.output1, sample_rate=sample_rate - ) + node3 = spark_function(input1=node2.outputs.output1, sample_rate=sample_rate) return { "pipeline_output1": node1.outputs.output1, "pipeline_output2": node2.outputs.output1, @@ -1739,9 +1660,7 @@ def pipeline(iris_data, sample_rate): pipeline1_dict = pipeline1._to_dict() # Change float to string to make dict from local and rest compatible - pipeline1_dict["inputs"]["sample_rate"] = str( - pipeline1_dict["inputs"]["sample_rate"] - ) + pipeline1_dict["inputs"]["sample_rate"] = str(pipeline1_dict["inputs"]["sample_rate"]) assert pydash.omit(pipeline1_dict, *omit_field) == pydash.omit( pipeline_regenerated_from_rest._to_dict(), *omit_field ) @@ -1842,9 +1761,7 @@ def test_pipeline_with_data_transfer_copy_job(self): @dsl.pipeline(experiment_name="test_pipeline_with_data_transfer_copy_job") def pipeline(folder1, folder2): - data_transfer_node = data_transfer_job_func( - folder1=folder1, folder2=folder2 - ) + data_transfer_node = data_transfer_job_func(folder1=folder1, folder2=folder2) return { "pipeline_output": data_transfer_node.outputs.output, } @@ -1919,9 +1836,7 @@ def test_pipeline_with_parallel_job(self): mode="eval_mount", ), } - outputs = { - "job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount") - } + outputs = {"job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount")} expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} @@ -2027,8 +1942,7 @@ def pipeline(job_data_path): ), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " - "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2053,9 +1967,7 @@ def test_pipeline_with_parallel_function_inside(self): ), } input_data = "${{inputs.job_data_path}}" - outputs = { - "job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount") - } + outputs = {"job_output_path": Output(type=AssetTypes.URI_FOLDER, mode="rw_mount")} task = RunFunction( code="./tests/test_configs/dsl_pipeline/parallel_component_with_file_input/src/", entry_script="score.py", @@ -2088,11 +2000,7 @@ def pipeline(path): environment_variables=expected_environment_variables, ) node1 = parallel_function(job_data_path=path) - node2 = parallel_function( - job_data_path=Input( - type=AssetTypes.MLTABLE, path="new_path", mode="eval_mount" - ) - ) + node2 = parallel_function(job_data_path=Input(type=AssetTypes.MLTABLE, path="new_path", mode="eval_mount")) return { "pipeline_output1": node1.outputs.job_output_path, @@ -2156,8 +2064,7 @@ def pipeline(path): ), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " - "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2194,8 +2101,7 @@ def pipeline(path): ), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " - "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2222,9 +2128,7 @@ def test_pipeline_with_command_function_inside(self): expected_resources = {"instance_count": 2} expected_environment_variables = {"key": "val"} inputs = { - "component_in_path": Input( - type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount" - ), + "component_in_path": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), "component_in_number": 0.01, } outputs = {"component_out_path": Output(type="mlflow_model", mode="rw_mount")} @@ -2243,9 +2147,7 @@ def pipeline(number, path): outputs=outputs, ) node1 = command_function(component_in_number=number, component_in_path=path) - node2 = command_function( - component_in_number=1, component_in_path=Input(path="new_path") - ) + node2 = command_function(component_in_number=1, component_in_path=Input(path="new_path")) return { "pipeline_output1": node1.outputs.component_out_path, @@ -2349,10 +2251,7 @@ def pipeline(number, path): } def test_multi_parallel_components_with_file_input_pipeline_output(self) -> None: - components_dir = ( - tests_root_dir - / "test_configs/dsl_pipeline/parallel_component_with_file_input" - ) + components_dir = tests_root_dir / "test_configs/dsl_pipeline/parallel_component_with_file_input" batch_inference1 = load_component(source=str(components_dir / "score.yml")) batch_inference2 = load_component(source=str(components_dir / "score.yml")) convert_data = load_component(source=str(components_dir / "convert_data.yml")) @@ -2361,16 +2260,10 @@ def test_multi_parallel_components_with_file_input_pipeline_output(self) -> None @dsl.pipeline(default_compute="cpu-cluster", experiment_name="sdk-cli-v2") def parallel_in_pipeline(job_data_path): batch_inference_node1 = batch_inference1(job_data_path=job_data_path) - convert_data_node = convert_data( - input_data=batch_inference_node1.outputs.job_output_path - ) + convert_data_node = convert_data(input_data=batch_inference_node1.outputs.job_output_path) convert_data_node.outputs.file_output_data.type = AssetTypes.MLTABLE - batch_inference_node2 = batch_inference2( - job_data_path=convert_data_node.outputs.file_output_data - ) - batch_inference_node2.inputs.job_data_path.mode = ( - InputOutputModes.EVAL_MOUNT - ) + batch_inference_node2 = batch_inference2(job_data_path=convert_data_node.outputs.file_output_data) + batch_inference_node2.inputs.job_data_path.mode = InputOutputModes.EVAL_MOUNT return {"job_out_data": batch_inference_node2.outputs.job_output_path} @@ -2390,9 +2283,7 @@ def parallel_in_pipeline(job_data_path): "jobs.batch_inference_node2.componentId", "jobs.batch_inference_node2.properties", ] - actual_job = pydash.omit( - as_attribute_dict(pipeline._to_rest_object().properties), *omit_fields - ) + actual_job = pydash.omit(as_attribute_dict(pipeline._to_rest_object().properties), *omit_fields) assert actual_job == { "display_name": "parallel_in_pipeline", "experiment_name": "sdk-cli-v2", @@ -2424,8 +2315,7 @@ def parallel_in_pipeline(job_data_path): "code": parse_local_path("./src", batch_inference1.base_path), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " - "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2455,8 +2345,7 @@ def parallel_in_pipeline(job_data_path): "code": parse_local_path("./src", batch_inference2.base_path), "entry_script": "score.py", "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - "program_arguments": "--job_output_path " - "${{outputs.job_output_path}}", + "program_arguments": "--job_output_path " "${{outputs.job_output_path}}", "type": "run_function", }, "type": "parallel", @@ -2474,9 +2363,7 @@ def parallel_in_pipeline(job_data_path): "type": "command", }, }, - "outputs": { - "job_out_data": {"job_output_type": "uri_folder", "mode": "Upload"} - }, + "outputs": {"job_out_data": {"job_output_type": "uri_folder", "mode": "Upload"}}, "properties": {}, "settings": {"_source": "DSL", "default_compute": "cpu-cluster"}, "tags": {}, @@ -2484,9 +2371,7 @@ def parallel_in_pipeline(job_data_path): def test_automl_node_in_pipeline(self) -> None: # create ClassificationJob with classification func inside pipeline is also supported - @dsl.pipeline( - name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster" - ) + @dsl.pipeline(name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster") def train_with_automl_in_pipeline( main_data_input, target_column_name_input: str, @@ -2514,9 +2399,7 @@ def train_with_automl_in_pipeline( type=AssetTypes.MLTABLE, path="fake_path", ) - pipeline1: PipelineJob = train_with_automl_in_pipeline( - job_input, "target", 10, 0.2 - ) + pipeline1: PipelineJob = train_with_automl_in_pipeline(job_input, "target", 10, 0.2) pipeline_dict1 = as_attribute_dict(pipeline1._to_rest_object()) pipeline_dict1 = pydash.omit( @@ -2570,9 +2453,7 @@ def train_with_automl_in_pipeline( assert pipeline_dict1 == expected_dict # create ClassificationJob inside pipeline is NOT supported - @dsl.pipeline( - name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster" - ) + @dsl.pipeline(name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster") def train_with_automl_in_pipeline( main_data_input, target_column_name_input: str, @@ -2598,9 +2479,7 @@ def test_automl_node_with_command_node(self): component_func1 = load_component(source=path) @dsl.pipeline(name="train_with_automl_in_pipeline", force_rerun=False) - def train_with_automl_in_pipeline( - component_in_number, component_in_path, target_column_name_input: str - ): + def train_with_automl_in_pipeline(component_in_number, component_in_path, target_column_name_input: str): node1 = component_func1( component_in_number=component_in_number, component_in_path=component_in_path, @@ -2690,9 +2569,7 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): enable_model_explainability=True, outputs=dict(best_model=Output(type="mlflow_model")), ) - return { - "pipeline_job_out_best_model": classification_node.outputs.best_model - } + return {"pipeline_job_out_best_model": classification_node.outputs.best_model} job_input = Input( type=AssetTypes.MLTABLE, @@ -2741,9 +2618,7 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): } }, # pipeline level will copy node level type - "outputs": { - "pipeline_job_out_best_model": {"job_output_type": "mlflow_model"} - }, + "outputs": {"pipeline_job_out_best_model": {"job_output_type": "mlflow_model"}}, "properties": {}, "settings": {"_source": "DSL"}, "tags": {}, @@ -2773,9 +2648,7 @@ def train_with_automl_in_pipeline(training_data, target_column_name_input: str): assert pipeline_dict2 == expected_dict def test_automl_node_without_variable_name(self) -> None: - @dsl.pipeline( - name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster" - ) + @dsl.pipeline(name="train_with_automl_in_pipeline", default_compute_target="cpu-cluster") def train_with_automl_in_pipeline(training_data, target_column_name_input: str): classification( training_data=training_data, diff --git a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py index 803bdb4a760c..2ccd56ad43d6 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/unittests/test_io_builder.py @@ -89,9 +89,7 @@ def my_pipeline(job_in_number, job_in_path): assert isinstance(job_in_path, PipelineInput) assert isinstance(job_in_number.result(), int) assert isinstance(job_in_path.result(), Input) - node1 = component_func( - component_in_number=job_in_number, component_in_path=job_in_path - ) + node1 = component_func(component_in_number=job_in_number, component_in_path=job_in_path) # calling result() will convert pipeline input to actual value node2 = component_func( component_in_number=job_in_number.result(), @@ -102,13 +100,10 @@ def my_pipeline(job_in_number, job_in_path): "output2": node2.outputs.component_out_path, } - pipeline_job1 = my_pipeline( - job_in_number=1, job_in_path=Input(path="fake_path1") - ) + pipeline_job1 = my_pipeline(job_in_number=1, job_in_path=Input(path="fake_path1")) rest_pipeline_job = omit_with_wildcard( - _rest_props_snake(pipeline_job1._to_rest_object().properties), - *common_omit_fields + _rest_props_snake(pipeline_job1._to_rest_object().properties), *common_omit_fields ) expected_pipeline_job1 = { "node1": { @@ -151,13 +146,10 @@ def my_pipeline(job_in_number, job_in_path): } assert rest_pipeline_job["jobs"] == expected_pipeline_job1 - pipeline_job2 = my_pipeline( - job_in_number=2, job_in_path=Input(path="fake_path2") - ) + pipeline_job2 = my_pipeline(job_in_number=2, job_in_path=Input(path="fake_path2")) rest_pipeline_job = omit_with_wildcard( - _rest_props_snake(pipeline_job2._to_rest_object().properties), - *common_omit_fields + _rest_props_snake(pipeline_job2._to_rest_object().properties), *common_omit_fields ) expected_pipeline_job2 = { @@ -206,8 +198,7 @@ def my_pipeline(job_in_number, job_in_path): pipeline_job1.jobs["node2"].inputs["component_in_path"].path == "fake_path1" rest_pipeline_job = omit_with_wildcard( - _rest_props_snake(pipeline_job1._to_rest_object().properties), - *common_omit_fields + _rest_props_snake(pipeline_job1._to_rest_object().properties), *common_omit_fields ) assert rest_pipeline_job["jobs"] == expected_pipeline_job1 @@ -222,9 +213,7 @@ def my_pipeline_level_1(job_in_number, job_in_path): # Note: call result will get actual value assert isinstance(job_in_number.result(), int) assert isinstance(job_in_path.result(), Input) - component_func( - component_in_number=job_in_number, component_in_path=job_in_path - ) + component_func(component_in_number=job_in_number, component_in_path=job_in_path) @pipeline def my_pipeline_level_2(job_in_number, job_in_path): @@ -233,17 +222,12 @@ def my_pipeline_level_2(job_in_number, job_in_path): assert isinstance(job_in_number.result(), int) assert isinstance(job_in_path.result(), Input) my_pipeline_level_1(job_in_number=job_in_number, job_in_path=job_in_path) - component_func( - component_in_number=job_in_number, component_in_path=job_in_path - ) + component_func(component_in_number=job_in_number, component_in_path=job_in_path) - pipeline_job2 = my_pipeline_level_2( - job_in_number=2, job_in_path=Input(path="fake_path2") - ) + pipeline_job2 = my_pipeline_level_2(job_in_number=2, job_in_path=Input(path="fake_path2")) rest_pipeline_job = omit_with_wildcard( - _rest_props_snake(pipeline_job2._to_rest_object().properties), - *common_omit_fields + _rest_props_snake(pipeline_job2._to_rest_object().properties), *common_omit_fields ) expected_pipeline_job = { @@ -284,9 +268,7 @@ def test_pipeline_expression_bool_test(self) -> None: if input1: pass else: - assert ( - False - ), "bool test for PipelineInput in non-pipeline scenario should always return True." + assert False, "bool test for PipelineInput in non-pipeline scenario should always return True." # pipeline scenario, should raise UserErrorException @pipeline @@ -308,9 +290,7 @@ def test_input_get_data_owner(self): # case1: node input from another node's output @pipeline def another_nodes_output(): - node1 = component_func1( - component_in_number=1, component_in_path=Input(path="test_path") - ) + node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) node1.name = "node1" node2 = component_func1( component_in_number=2, @@ -328,16 +308,12 @@ def another_nodes_output(): # case2.1: node input from pipeline input, which has literal value @pipeline def literal_pipeline_val(component_in_path: Input): - node2 = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + node2 = component_func1(component_in_number=2, component_in_path=component_in_path) node2.name = "node2" assert node2.inputs.component_in_path._get_data_owner() == None assert_node_owners_expected( - pipeline_job=literal_pipeline_val( - component_in_path=Input(path="test_path") - ), + pipeline_job=literal_pipeline_val(component_in_path=Input(path="test_path")), expected_owners={"node2": None}, input_name="component_in_path", ) @@ -345,17 +321,13 @@ def literal_pipeline_val(component_in_path: Input): # case2.2: node input from pipeline input, which is from another node's output @pipeline def sub_pipeline(component_in_path: Input): - node2 = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + node2 = component_func1(component_in_number=2, component_in_path=component_in_path) node2.name = "node2" assert node2.inputs.component_in_path._get_data_owner().name == "node1" @pipeline def parent_pipeline(): - node1 = component_func1( - component_in_number=1, component_in_path=Input(path="test_path") - ) + node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) node1.name = "node1" sub_pipeline(component_in_path=node1.outputs.component_out_path) @@ -368,23 +340,17 @@ def parent_pipeline(): # case2.3: node input from pipeline input, which is from subgraph's output @pipeline def sub_pipeline1(component_in_path: Input): - node1 = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + node1 = component_func1(component_in_number=2, component_in_path=component_in_path) return node1.outputs @pipeline def sub_pipeline2(component_in_path: Input): - node2 = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + node2 = component_func1(component_in_number=2, component_in_path=component_in_path) assert node2.inputs.component_in_path._get_data_owner().name == "node1" @pipeline def parent_pipeline(): - src = component_func1( - component_in_number=1, component_in_path=Input(path="test_path") - ) + src = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) sub1 = sub_pipeline1(component_in_path=src) sub_pipeline2(component_in_path=sub1.outputs.component_out_path) @@ -397,9 +363,7 @@ def parent_pipeline(): # case3.1: node input from subgraph's output, which is from a normal node @pipeline def sub_pipeline(component_in_path: Input): - sub_node = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + sub_node = component_func1(component_in_number=2, component_in_path=component_in_path) return sub_node.outputs @pipeline @@ -421,9 +385,7 @@ def parent_pipeline(): # case3.2: node input from subgraph's output, which is from another subgraph @pipeline def sub_pipeline_1(component_in_path: Input): - sub_node_1 = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + sub_node_1 = component_func1(component_in_number=2, component_in_path=component_in_path) return sub_node_1.outputs @pipeline @@ -453,25 +415,19 @@ def test_input_get_data_owner_multiple_subgraph(self): @pipeline def sub_pipeline(component_in_path: Input): - inner_node = component_func1( - component_in_number=2, component_in_path=component_in_path - ) + inner_node = component_func1(component_in_number=2, component_in_path=component_in_path) return inner_node.outputs @pipeline def parent_pipeline(): - node1 = component_func1( - component_in_number=1, component_in_path=Input(path="test_path1") - ) + node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path1")) node1.name = "node1" sub1 = sub_pipeline(component_in_path=node1.outputs.component_out_path) after1 = component_func1(component_in_path=sub1.outputs.component_out_path) source_of_branch_1 = after1.inputs.component_in_path._get_data_owner() assert source_of_branch_1.name == "inner_node" - node2 = component_func1( - component_in_number=3, component_in_path=Input(path="test_path2") - ) + node2 = component_func1(component_in_number=3, component_in_path=Input(path="test_path2")) node2.name = "node2" sub2 = sub_pipeline(component_in_path=node2.outputs.component_out_path) after2 = component_func1(component_in_path=sub2.outputs.component_out_path) @@ -481,14 +437,8 @@ def parent_pipeline(): # subgraph called twice, source for each branch should not be the same assert source_of_branch_1._instance_id != source_of_branch_2._instance_id # one is from node1, the other is from node2 - assert ( - source_of_branch_1.inputs.component_in_path._get_data_owner().name - == "node1" - ) - assert ( - source_of_branch_2.inputs.component_in_path._get_data_owner().name - == "node2" - ) + assert source_of_branch_1.inputs.component_in_path._get_data_owner().name == "node1" + assert source_of_branch_2.inputs.component_in_path._get_data_owner().name == "node2" parent_pipeline() @@ -562,9 +512,7 @@ def sub_pipeline(component_in_path: Input): @pipeline def my_pipeline(): - node1 = component_func1( - component_in_number=1, component_in_path=Input(path="test_path") - ) + node1 = component_func1(component_in_number=1, component_in_path=Input(path="test_path")) node1.name = "node1" # node input literal value, don't have owner assert node1.inputs.component_in_number._get_data_owner() is None diff --git a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py index 9440b5cfe61f..fcb286c97bdb 100644 --- a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py +++ b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py @@ -59,7 +59,9 @@ def test_create_or_update_sas_uri_success(self, mock_environment_operation: Envi "azure.ai.ml.operations._environment_operations._check_and_upload_env_build_context" ) as check_upload, patch( "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset" - ), patch.object(EnvironmentVersionData, "_deserialize", return_value=Mock()): + ), patch.object( + EnvironmentVersionData, "_deserialize", return_value=Mock() + ): mock_environment_operation.create_or_update(env) check_upload.assert_called_once() @@ -73,6 +75,8 @@ def test_create_or_update_sas_uri_failure(self, mock_environment_operation: Envi "azure.ai.ml.operations._environment_operations._check_and_upload_env_build_context" ) as check_upload, patch( "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset" - ), patch.object(EnvironmentVersionData, "_deserialize", return_value=Mock()): + ), patch.object( + EnvironmentVersionData, "_deserialize", return_value=Mock() + ): mock_environment_operation.create_or_update(env) check_upload.assert_not_called() diff --git a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py index 790169da73d6..542f1d500d36 100644 --- a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py +++ b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py @@ -42,12 +42,8 @@ def test_custom_model_finetuning_job_conversion(self, task: str): custom_model_finetuning_job = self._get_custom_model_finetuning_job( task=task, display_name="llama-display-name", - training_data=Input( - type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv" - ), - validation_data=Input( - type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv" - ), + training_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv"), + validation_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv"), hyperparameters={"foo": "bar"}, model=Input( type=AssetTypes.MLFLOW_MODEL, @@ -57,11 +53,7 @@ def test_custom_model_finetuning_job_conversion(self, task: str): experiment_name="foo_exp", tags={"foo_tag": "bar"}, properties={"my_property": "True"}, - outputs={ - "registered_model": Output( - type="mlflow_model", name="llama-finetune-registered" - ) - }, + outputs={"registered_model": Output(type="mlflow_model", name="llama-finetune-registered")}, ) rest_obj = custom_model_finetuning_job._to_rest_object() assert isinstance( @@ -75,60 +67,31 @@ def test_custom_model_finetuning_job_conversion(self, task: str): ), "Validation data is not UriFileJobInput" original_obj = CustomModelFineTuningJob._from_rest_object(rest_obj) - assert ( - custom_model_finetuning_job == original_obj - ), "Conversion to/from rest object failed" + assert custom_model_finetuning_job == original_obj, "Conversion to/from rest object failed" assert original_obj.task.lower() == task.lower(), "Task not set correctly" - assert ( - original_obj.display_name == "llama-display-name" - ), "Display name not set correctly" + assert original_obj.display_name == "llama-display-name", "Display name not set correctly" assert original_obj.name == "llama-finetuning", "Name not set correctly" - assert ( - original_obj.experiment_name == "foo_exp" - ), "Experiment name not set correctly" + assert original_obj.experiment_name == "foo_exp", "Experiment name not set correctly" assert original_obj.tags == {"foo_tag": "bar"}, "Tags not set correctly" - assert original_obj.properties == { - "my_property": "True" - }, "Properties not set correctly" + assert original_obj.properties == {"my_property": "True"}, "Properties not set correctly" # check if the original job inputs were restored - assert isinstance( - original_obj.training_data, Input - ), "Training data is not Input" - assert ( - original_obj.training_data.type == AssetTypes.URI_FILE - ), "Training data type not set correctly" - assert ( - original_obj.training_data.path == "https://foo/bar/train.csv" - ), "Training data path not set correctly" + assert isinstance(original_obj.training_data, Input), "Training data is not Input" + assert original_obj.training_data.type == AssetTypes.URI_FILE, "Training data type not set correctly" + assert original_obj.training_data.path == "https://foo/bar/train.csv", "Training data path not set correctly" assert isinstance(original_obj.validation_data, Input), "Test data is not Input" - assert ( - original_obj.validation_data.type == AssetTypes.URI_FILE - ), "Test data type not set correctly" - assert ( - original_obj.validation_data.path == "https://foo/bar/test.csv" - ), "Test data path not set correctly" - assert original_obj.hyperparameters == { - "foo": "bar" - }, "Hyperparameters not set correctly" + assert original_obj.validation_data.type == AssetTypes.URI_FILE, "Test data type not set correctly" + assert original_obj.validation_data.path == "https://foo/bar/test.csv", "Test data path not set correctly" + assert original_obj.hyperparameters == {"foo": "bar"}, "Hyperparameters not set correctly" assert isinstance(original_obj.model, Input), "Model is not Input" + assert original_obj.model.type == AssetTypes.MLFLOW_MODEL, "Model type not set correctly" assert ( - original_obj.model.type == AssetTypes.MLFLOW_MODEL - ), "Model type not set correctly" - assert ( - original_obj.model.path - == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" + original_obj.model.path == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" ), "Model path not set correctly" - assert isinstance( - original_obj.outputs["registered_model"], Output - ), "Output is not Output" + assert isinstance(original_obj.outputs["registered_model"], Output), "Output is not Output" mlflow_model_output = original_obj.outputs["registered_model"] - assert ( - mlflow_model_output.type == "mlflow_model" - ), "Output type not set correctly" - assert ( - mlflow_model_output.name == "llama-finetune-registered" - ), "Output name not set correctly" + assert mlflow_model_output.type == "mlflow_model", "Output type not set correctly" + assert mlflow_model_output.name == "llama-finetune-registered", "Output name not set correctly" @pytest.mark.parametrize( "task", @@ -150,12 +113,8 @@ def test_custom_model_finetuning_job_read_from_wire(self, task: str): custom_model_finetuning_job = self._get_custom_model_finetuning_job( task=task, display_name="llama-display-name", - training_data=Input( - type=AssetTypes.URI_FILE, path="./samsum_dataset/small_train.jsonl" - ), - validation_data=Input( - type=AssetTypes.URI_FILE, path="./samsum_dataset/small_validation.jsonl" - ), + training_data=Input(type=AssetTypes.URI_FILE, path="./samsum_dataset/small_train.jsonl"), + validation_data=Input(type=AssetTypes.URI_FILE, path="./samsum_dataset/small_validation.jsonl"), hyperparameters={"foo": "bar"}, model=Input( type=AssetTypes.MLFLOW_MODEL, @@ -165,49 +124,28 @@ def test_custom_model_finetuning_job_read_from_wire(self, task: str): experiment_name="foo_exp", tags={"foo_tag": "bar"}, properties={"my_property": True}, - outputs={ - "registered_model": Output( - type="mlflow_model", name="llama-finetune-registered" - ) - }, + outputs={"registered_model": Output(type="mlflow_model", name="llama-finetune-registered")}, ) dict_obj = custom_model_finetuning_job._to_dict() assert dict_obj["task"].lower() == task.lower(), "Task not set correctly" - assert ( - dict_obj["display_name"] == "llama-display-name" - ), "Display name not set correctly" + assert dict_obj["display_name"] == "llama-display-name", "Display name not set correctly" assert dict_obj["name"] == "llama-finetuning", "Name not set correctly" - assert ( - dict_obj["experiment_name"] == "foo_exp" - ), "Experiment name not set correctly" + assert dict_obj["experiment_name"] == "foo_exp", "Experiment name not set correctly" assert dict_obj["tags"] == {"foo_tag": "bar"}, "Tags not set correctly" - assert ( - dict_obj["properties"]["my_property"] == "True" - ), "Properties not set correctly" + assert dict_obj["properties"]["my_property"] == "True", "Properties not set correctly" # check if the original job inputs were restored + assert dict_obj["training_data"]["type"] == AssetTypes.URI_FILE, "Training data type not set correctly" assert ( - dict_obj["training_data"]["type"] == AssetTypes.URI_FILE - ), "Training data type not set correctly" - assert ( - dict_obj["training_data"]["path"] - == "azureml:./samsum_dataset/small_train.jsonl" + dict_obj["training_data"]["path"] == "azureml:./samsum_dataset/small_train.jsonl" ), "Training data path not set correctly" + assert dict_obj["validation_data"]["type"] == AssetTypes.URI_FILE, "validation data type not set correctly" assert ( - dict_obj["validation_data"]["type"] == AssetTypes.URI_FILE - ), "validation data type not set correctly" - assert ( - dict_obj["validation_data"]["path"] - == "azureml:./samsum_dataset/small_validation.jsonl" + dict_obj["validation_data"]["path"] == "azureml:./samsum_dataset/small_validation.jsonl" ), "Validation data path not set correctly" - assert dict_obj["hyperparameters"] == { - "foo": "bar" - }, "Hyperparameters not set correctly" - assert ( - dict_obj["model"]["type"] == AssetTypes.MLFLOW_MODEL - ), "Model type not set correctly" + assert dict_obj["hyperparameters"] == {"foo": "bar"}, "Hyperparameters not set correctly" + assert dict_obj["model"]["type"] == AssetTypes.MLFLOW_MODEL, "Model type not set correctly" assert ( - dict_obj["model"]["path"] - == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" + dict_obj["model"]["path"] == "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" ), "Model path not set correctly" @pytest.mark.parametrize( @@ -230,15 +168,9 @@ def test_azure_openai_finetuning_job_conversion(self, task: str): # Create Custom Model FineTuning Job custom_model_finetuning_job = self._get_azure_openai_finetuning_job( task=task, - training_data=Input( - type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv" - ), - validation_data=Input( - type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv" - ), - hyperparameters=AzureOpenAIHyperparameters( - batch_size=2, n_epochs=3, learning_rate_multiplier=0.5 - ), + training_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv"), + validation_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/test.csv"), + hyperparameters=AzureOpenAIHyperparameters(batch_size=2, n_epochs=3, learning_rate_multiplier=0.5), model=Input( type=AssetTypes.MLFLOW_MODEL, path="azureml://registries/azure-openai-v2/models/gpt-4/versions/1", @@ -260,49 +192,28 @@ def test_azure_openai_finetuning_job_conversion(self, task: str): ), "Validation data is not UriFileJobInput" original_obj = AzureOpenAIFineTuningJob._from_rest_object(rest_obj) - assert ( - custom_model_finetuning_job == original_obj - ), "Conversion to/from rest object failed" + assert custom_model_finetuning_job == original_obj, "Conversion to/from rest object failed" assert original_obj.task.lower() == task.lower(), "Task not set correctly" assert original_obj.name == "gpt4-finetuning", "Name not set correctly" - assert ( - original_obj.experiment_name == "foo_exp" - ), "Experiment name not set correctly" + assert original_obj.experiment_name == "foo_exp", "Experiment name not set correctly" assert original_obj.tags == {"foo_tag": "bar"}, "Tags not set correctly" - assert original_obj.properties == { - "my_property": "True" - }, "Properties not set correctly" + assert original_obj.properties == {"my_property": "True"}, "Properties not set correctly" # check if the original job inputs were restored - assert isinstance( - original_obj.training_data, Input - ), "Training data is not Input" - assert ( - original_obj.training_data.type == AssetTypes.URI_FILE - ), "Training data type not set correctly" - assert ( - original_obj.training_data.path == "https://foo/bar/train.csv" - ), "Training data path not set correctly" + assert isinstance(original_obj.training_data, Input), "Training data is not Input" + assert original_obj.training_data.type == AssetTypes.URI_FILE, "Training data type not set correctly" + assert original_obj.training_data.path == "https://foo/bar/train.csv", "Training data path not set correctly" assert isinstance(original_obj.validation_data, Input), "Test data is not Input" - assert ( - original_obj.validation_data.type == AssetTypes.URI_FILE - ), "Test data type not set correctly" - assert ( - original_obj.validation_data.path == "https://foo/bar/test.csv" - ), "Test data path not set correctly" - assert ( - original_obj.hyperparameters.batch_size == 2 - ), "Batch size not set correctly" + assert original_obj.validation_data.type == AssetTypes.URI_FILE, "Test data type not set correctly" + assert original_obj.validation_data.path == "https://foo/bar/test.csv", "Test data path not set correctly" + assert original_obj.hyperparameters.batch_size == 2, "Batch size not set correctly" assert original_obj.hyperparameters.n_epochs == 3, "n_epochs not set correctly" assert ( original_obj.hyperparameters.learning_rate_multiplier == 0.5 ), "learning_rate_multiplier not set correctly" assert isinstance(original_obj.model, Input), "Model is not Input" + assert original_obj.model.type == AssetTypes.MLFLOW_MODEL, "Model type not set correctly" assert ( - original_obj.model.type == AssetTypes.MLFLOW_MODEL - ), "Model type not set correctly" - assert ( - original_obj.model.path - == "azureml://registries/azure-openai-v2/models/gpt-4/versions/1" + original_obj.model.path == "azureml://registries/azure-openai-v2/models/gpt-4/versions/1" ), "Model path not set correctly" def _get_custom_model_finetuning_job( diff --git a/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py b/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py index 803b8582ca8f..30fbfd07ee53 100644 --- a/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py +++ b/sdk/ml/azure-ai-ml/tests/internal/unittests/test_pipeline_job.py @@ -56,9 +56,7 @@ ) -@pytest.mark.usefixtures( - "enable_internal_components", "enable_pipeline_private_preview_features" -) +@pytest.mark.usefixtures("enable_internal_components", "enable_pipeline_private_preview_features") @pytest.mark.unittest @pytest.mark.pipeline_test class TestPipelineJob: @@ -107,17 +105,13 @@ def pipeline_func(): # check if node's runsettings are set correctly node_rest_dict = dsl_pipeline._to_rest_object().properties.jobs["node"] - del node_rest_dict[ - "componentId" - ] # delete component spec to make it a pure dict + del node_rest_dict["componentId"] # delete component spec to make it a pure dict mismatched_runsettings = {} for dot_key, expected_value in get_expected_runsettings_items(runsettings_dict): value = pydash.get(node_rest_dict, dot_key) if value != expected_value: mismatched_runsettings[dot_key] = (value, expected_value) - assert ( - not mismatched_runsettings - ), "Current value:\n{}\nMismatched fields:\n{}".format( + assert not mismatched_runsettings, "Current value:\n{}\nMismatched fields:\n{}".format( json.dumps(node_rest_dict, indent=2), json.dumps(mismatched_runsettings, indent=2), ) @@ -130,9 +124,7 @@ def pipeline_func(): "yaml_path,inputs,runsettings_dict,pipeline_runsettings_dict", PARAMETERS_TO_TEST, ) - def test_data_as_node_inputs( - self, yaml_path, inputs, runsettings_dict, pipeline_runsettings_dict - ): + def test_data_as_node_inputs(self, yaml_path, inputs, runsettings_dict, pipeline_runsettings_dict): node_func: InternalComponent = load_component(yaml_path) input_data_names = {} @@ -142,9 +134,7 @@ def test_data_as_node_inputs( if "spark" in yaml_path: input_data_names[input_name] = input_obj else: - inputs[input_name] = Data( - name=data_name, version=DATA_VERSION, type=AssetTypes.MLTABLE - ) + inputs[input_name] = Data(name=data_name, version=DATA_VERSION, type=AssetTypes.MLTABLE) input_data_names[input_name] = data_name if len(input_data_names) == 0: return @@ -179,14 +169,11 @@ def pipeline_func(): [ "test:" + DATA_VERSION, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/" - "Microsoft.MachineLearningServices/workspaces/ws/datasets/test/versions/" - + DATA_VERSION, + "Microsoft.MachineLearningServices/workspaces/ws/datasets/test/versions/" + DATA_VERSION, ], ) def test_data_as_pipeline_inputs(self, input_path): - yaml_path = ( - "./tests/test_configs/internal/distribution-component/component_spec.yaml" - ) + yaml_path = "./tests/test_configs/internal/distribution-component/component_spec.yaml" node_func: InternalComponent = load_component(yaml_path) @pipeline() @@ -194,14 +181,10 @@ def pipeline_func(pipeline_input): node = node_func(input_path=pipeline_input) node.compute = "cpu-cluster" - dsl_pipeline: PipelineJob = pipeline_func( - pipeline_input=Input(path=input_path, type=AssetTypes.MLTABLE) - ) + dsl_pipeline: PipelineJob = pipeline_func(pipeline_input=Input(path=input_path, type=AssetTypes.MLTABLE)) if input_path.startswith("test:"): dsl_pipeline_with_data_input: PipelineJob = pipeline_func( - pipeline_input=Data( - name="test", version=DATA_VERSION, type=AssetTypes.MLTABLE - ) + pipeline_input=Data(name="test", version=DATA_VERSION, type=AssetTypes.MLTABLE) ) else: dsl_pipeline_with_data_input: PipelineJob = pipeline_func( @@ -221,18 +204,13 @@ def pipeline_func(pipeline_input): "job_input_type": AssetTypes.MLTABLE, "uri": input_path, } - assert ( - as_attribute_dict(pipeline_rest_dict.inputs["pipeline_input"]) - == expected_rest_obj - ) + assert as_attribute_dict(pipeline_rest_dict.inputs["pipeline_input"]) == expected_rest_obj expected_rest_obj = { "job_input_type": "literal", "value": "${{parent.inputs.pipeline_input}}", } - assert ( - pipeline_rest_dict.jobs["node"]["inputs"]["input_path"] == expected_rest_obj - ) + assert pipeline_rest_dict.jobs["node"]["inputs"]["input_path"] == expected_rest_obj def test_internal_component_node_output_type(self): from azure.ai.ml._utils.utils import try_enable_internal_components @@ -285,9 +263,7 @@ def pipeline_func(): assert dsl_pipeline._validate().passed dsl_pipeline._to_rest_object() pipeline_component = dsl_pipeline.jobs["sub_pipeline_func"].component - assert pipeline_component._to_rest_object().properties.component_spec[ - "outputs" - ] == { + assert pipeline_component._to_rest_object().properties.component_spec["outputs"] == { "data_any_directory": {"type": "uri_folder"}, "data_any_file": {"type": "uri_file"}, # AnyFile => uri_file "data_azureml_dataset": {"type": "uri_folder"}, @@ -324,9 +300,7 @@ def test_gjd_internal_component_in_pipeline(self): ts = TargetSelector( compute_type="AMLK8s", # runsettings.target_selector.compute_type - instance_types=[ - "STANDARD_D2_V2" - ], # runsettings.target_selector.instance_types + instance_types=["STANDARD_D2_V2"], # runsettings.target_selector.instance_types regions=["eastus2euap"], # runsettings.target_selector.regions my_resource_only=True, # runsettings.target_selector.my_resource_only allow_spot_vm=True, # runsettings.target_selector.allow_spot_vm @@ -430,9 +404,7 @@ def test_singularity_component_in_pipeline(self): user_alias="user_alias", ) # what if key is not in lower case? - node.resources.properties[JobComputePropertyFields.SINGULARITY.lower()] = ( - configuration - ) + node.resources.properties[JobComputePropertyFields.SINGULARITY.lower()] = configuration properties_rest_dict = node._to_rest_object()["resources"]["properties"] assert properties_rest_dict == { JobComputePropertyFields.AISUPERCOMPUTER: { @@ -464,26 +436,18 @@ def test_singularity_component_in_pipeline(self): } def test_load_pipeline_job_with_internal_components_as_node(self): - yaml_path = Path( - "./tests/test_configs/internal/helloworld/helloworld_component_scope.yml" - ) + yaml_path = Path("./tests/test_configs/internal/helloworld/helloworld_component_scope.yml") scope_internal_func = load_component(source=yaml_path) with open(yaml_path, encoding="utf-8") as yaml_file: yaml_dict = yaml.safe_load(yaml_file) - yaml_dict["code"] = parse_local_path( - yaml_dict["code"], scope_internal_func.base_path - ) + yaml_dict["code"] = parse_local_path(yaml_dict["code"], scope_internal_func.base_path) - command_func = load_component( - "./tests/test_configs/components/helloworld_component.yml" - ) + command_func = load_component("./tests/test_configs/components/helloworld_component.yml") @pipeline() def pipeline_func(): - node = command_func( - component_in_path=Input(path="./tests/test_configs/data") - ) + node = command_func(component_in_path=Input(path="./tests/test_configs/data")) node.compute = "cpu-cluster" node_internal: Scope = scope_internal_func( @@ -558,18 +522,12 @@ def pipeline_func(): } def test_components_in_registry(self): - command_func = load_component( - "./tests/test_configs/components/helloworld_component.yml" - ) - registry_code_id = ( - "azureml://feeds/testFeed/codes/hello_component/versions/0.0.1" - ) + command_func = load_component("./tests/test_configs/components/helloworld_component.yml") + registry_code_id = "azureml://feeds/testFeed/codes/hello_component/versions/0.0.1" @pipeline() def pipeline_func(): - node = command_func( - component_in_path=Input(path="./tests/test_configs/data") - ) + node = command_func(component_in_path=Input(path="./tests/test_configs/data")) # can't create a component from azureml-components in ci workspace # so just use a local test @@ -578,9 +536,7 @@ def pipeline_func(): dsl_pipeline: PipelineJob = pipeline_func() assert dsl_pipeline._validate().passed - regenerated_pipeline_job = PipelineJob._from_rest_object( - dsl_pipeline._to_rest_object() - ) + regenerated_pipeline_job = PipelineJob._from_rest_object(dsl_pipeline._to_rest_object()) assert dsl_pipeline._to_dict() == regenerated_pipeline_job._to_dict() def test_components_input_output(self): @@ -644,9 +600,7 @@ def pipeline_func(): assert rest_obj.properties.jobs["node"]["inputs"] == expected_inputs def test_data_binding_on_node_runsettings(self): - test_path = ( - "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" - ) + test_path = "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" component: InternalComponent = load_component(test_path) @pipeline() @@ -668,12 +622,7 @@ def pipeline_func( assert str(rest_object["environment"]) == "${{parent.inputs.environment_name}}" def test_pipeline_with_setting_node_output_directly(self) -> None: - component_dir = ( - Path(__file__).parent.parent.parent - / "test_configs" - / "internal" - / "command-component" - ) + component_dir = Path(__file__).parent.parent.parent / "test_configs" / "internal" / "command-component" copy_func = load_component(component_dir / "command-linux/copy/component.yaml") copy_file = copy_func( @@ -691,9 +640,7 @@ def test_job_properties(self): ) pipeline_dict = pipeline_job._to_dict() rest_pipeline_dict = pipeline_job._to_rest_object().as_dict()["properties"] - assert pipeline_dict["properties"] == { - "AZURE_ML_PathOnCompute_input_data": "/tmp/test" - } + assert pipeline_dict["properties"] == {"AZURE_ML_PathOnCompute_input_data": "/tmp/test"} assert rest_pipeline_dict["properties"] == pipeline_dict["properties"] for name, node_dict in pipeline_dict["jobs"].items(): rest_node_dict = rest_pipeline_dict["jobs"][name] @@ -707,9 +654,7 @@ def test_job_properties(self): pytest.param( "./tests/test_configs/internal/command-component-ls/ls_command_component.yaml", { - "resources.instance_count": JobResourceConfiguration( - instance_count=1 - ), + "resources.instance_count": JobResourceConfiguration(instance_count=1), "limits.timeout": CommandJobLimits(timeout=100), }, {}, @@ -718,27 +663,19 @@ def test_job_properties(self): pytest.param( "./tests/test_configs/internal/batch_inference/batch_score.yaml", { - "resources.instance_count": JobResourceConfiguration( - instance_count=1 - ), + "resources.instance_count": JobResourceConfiguration(instance_count=1), "limits.timeout": CommandJobLimits(timeout=100), }, { - "model_path": Input( - type=AssetTypes.MLTABLE, path="mltable_mnist_model@latest" - ), - "images_to_score": Input( - type=AssetTypes.MLTABLE, path="mltable_mnist@latest" - ), + "model_path": Input(type=AssetTypes.MLTABLE, path="mltable_mnist_model@latest"), + "images_to_score": Input(type=AssetTypes.MLTABLE, path="mltable_mnist@latest"), }, id="parallel.resources", ), pytest.param( "tests/test_configs/internal/spark-component/spec.yaml", { - "resources.runtime_version": SparkResourceConfiguration( - runtime_version="2.4" - ), + "resources.runtime_version": SparkResourceConfiguration(runtime_version="2.4"), }, { "file_input1": Input( @@ -790,9 +727,7 @@ def pipeline_func(param: str = "2"): pipeline_job.component._get_anonymous_hash() def test_node_output_type_promotion(self): - test_path = ( - "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" - ) + test_path = "./tests/test_configs/internal/helloworld/helloworld_component_command.yml" component: InternalComponent = load_component(test_path) @pipeline() diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index c6a15ff2f5ff..52dbb263dc67 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -67,7 +67,9 @@ def _rest_job_from_dict(job_dict): ck = snake_to_camel(k) if k in ("inputs", "outputs") and isinstance(v, dict): new_props[ck] = { - name: ({snake_to_camel(fk): fv for fk, fv in fields.items()} if isinstance(fields, dict) else fields) + name: ( + {snake_to_camel(fk): fv for fk, fv in fields.items()} if isinstance(fields, dict) else fields + ) for name, fields in v.items() } else: diff --git a/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py b/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py index c85f83f60dc4..27c91717df6b 100644 --- a/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py +++ b/sdk/ml/azure-ai-ml/tests/test_utilities/utils.py @@ -28,9 +28,7 @@ from azure.ai.ml.operations._job_ops_helper import _wait_before_polling from azure.ai.ml.operations._run_history_constants import JobStatus, RunHistoryConstants -_PYTEST_TIMEOUT_METHOD = ( - "signal" if hasattr(signal, "SIGALRM") else "thread" -) # use signal when os support SIGALRM +_PYTEST_TIMEOUT_METHOD = "signal" if hasattr(signal, "SIGALRM") else "thread" # use signal when os support SIGALRM DEFAULT_TASK_TIMEOUT = 30 * 60 # 30mins THREAD_WAIT_TIME_BEFORE_POLL = 60 # 1min @@ -44,9 +42,7 @@ def write_script(script_path: str, content: str) -> str: return script_path -def get_arm_id( - ws_scope: OperationScope, entity_name: str, entity_version: str, entity_type -) -> str: +def get_arm_id(ws_scope: OperationScope, entity_name: str, entity_version: str, entity_type) -> str: arm_id = ( "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.MachineLearningServices/workspaces/{" "}/{}/{}/versions/{}".format( @@ -106,14 +102,10 @@ def prepare_dsl_curated( # round-trip with ``default=str`` stringifies any residual data-binding expression objects # (as the legacy msrest ``serialize`` did) so the two dicts compare cleanly. dsl_pipeline_job_dict = json.loads( - json.dumps( - pipeline._to_rest_object().as_dict(), default=str - ) # pylint: disable=protected-access + json.dumps(pipeline._to_rest_object().as_dict(), default=str) # pylint: disable=protected-access ) pipeline_job_dict = json.loads( - json.dumps( - pipeline_from_yaml._to_rest_object().as_dict(), default=str - ) # pylint: disable=protected-access + json.dumps(pipeline_from_yaml._to_rest_object().as_dict(), default=str) # pylint: disable=protected-access ) if enable_default_omit_fields: @@ -144,9 +136,7 @@ def prepare_dsl_curated( ) else: dsl_pipeline_job_dict = pipeline._to_dict() # pylint: disable=protected-access - pipeline_job_dict = ( - pipeline_from_yaml._to_dict() - ) # pylint: disable=protected-access + pipeline_job_dict = pipeline_from_yaml._to_dict() # pylint: disable=protected-access if enable_default_omit_fields: omit_fields.extend( [ @@ -164,9 +154,7 @@ def prepare_dsl_curated( return dsl_pipeline_job_dict, pipeline_job_dict -def submit_and_wait( - ml_client, pipeline_job: PipelineJob, expected_state: str = "Completed" -) -> PipelineJob: +def submit_and_wait(ml_client, pipeline_job: PipelineJob, expected_state: str = "Completed") -> PipelineJob: created_job = ml_client.jobs.create_or_update(pipeline_job) terminal_states = ["Completed", "Failed", "Canceled", "NotResponding"] assert created_job is not None @@ -195,9 +183,7 @@ def assert_final_job_status( assert isinstance(job, job_type) poll_start_time = time.time() - while job.status not in RunHistoryConstants.TERMINAL_STATUSES and time.time() < ( - poll_start_time + deadline - ): + while job.status not in RunHistoryConstants.TERMINAL_STATUSES and time.time() < (poll_start_time + deadline): sleep_if_live(THREAD_WAIT_TIME_BEFORE_POLL) job = client.jobs.get(job.name) @@ -206,9 +192,7 @@ def assert_final_job_status( assert isinstance(cancel_poller, LROPoller) assert cancel_poller.result() is None - assert ( - job.status == expected_terminal_status - ), f"Job status mismatch. Job created: {job}" + assert job.status == expected_terminal_status, f"Job status mismatch. Job created: {job}" def get_automl_job_properties() -> Dict: @@ -257,9 +241,7 @@ def verify_entity_load_and_dump( with StringIO() as stream: stream.write(file_contents) stream.seek(0) - stream_entity = load_function( - source=stream, relative_origin=test_load_file_path, **load_kwargs - ) + stream_entity = load_function(source=stream, relative_origin=test_load_file_path, **load_kwargs) assert file_entity is not None assert stream_entity is not None @@ -346,15 +328,12 @@ def assert_job_cancel( cancel_job(client, created_job) elif wait_for_completion is True: assert wait_until_done(client, created_job) == JobStatus.COMPLETED, ( - "Job failed. Please check it on studio for more details: %s" - % created_job.studio_url + "Job failed. Please check it on studio for more details: %s" % created_job.studio_url ) return created_job -def submit_and_cancel_new_dsl_pipeline( - pipeline_func, client, default_compute="cpu-cluster", **kwargs -): +def submit_and_cancel_new_dsl_pipeline(pipeline_func, client, default_compute="cpu-cluster", **kwargs): pipeline_job: PipelineJob = pipeline_func(**kwargs) pipeline_job.settings.default_compute = default_compute return assert_job_cancel(pipeline_job, client) @@ -467,9 +446,7 @@ def reload_schema_for_nodes_in_pipeline_job(*, revert_after_yield: bool = True): # Update the node types in pipeline jobs to include the private preview node types from azure.ai.ml._schema.pipeline import pipeline_job - declared_fields = ( - pipeline_job.PipelineJobSchema._declared_fields - ) # pylint: disable=protected-access, no-member + declared_fields = pipeline_job.PipelineJobSchema._declared_fields # pylint: disable=protected-access, no-member original_jobs = declared_fields["jobs"] declared_fields["jobs"] = pipeline_job.PipelineJobsField() From cddcc16079ebf4477d1928eddb822a8acc0d72ea Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 14 Jul 2026 13:05:57 +0530 Subject: [PATCH 112/146] Fix pylint: add missing Any import, resolve unused/reimported imports, doc types, targeted disables --- sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py | 6 ++++++ sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py | 1 + sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py | 8 ++++++-- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py | 2 +- .../azure-ai-ml/azure/ai/ml/entities/_job/distribution.py | 2 +- .../_job/finetuning/azure_openai_finetuning_job.py | 2 -- .../azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py | 2 +- .../azure/ai/ml/entities/_job/pipeline/_io/mixin.py | 4 ++++ .../azure/ai/ml/entities/_job/pipeline/pipeline_job.py | 2 +- .../azure/ai/ml/entities/_job/to_rest_functions.py | 2 +- .../ml/operations/_azure_openai_deployment_operations.py | 1 + .../azure/ai/ml/operations/_batch_endpoint_operations.py | 2 +- .../azure/ai/ml/operations/_compute_operations.py | 2 +- .../azure/ai/ml/operations/_data_operations.py | 2 +- .../azure/ai/ml/operations/_environment_operations.py | 2 +- .../azure/ai/ml/operations/_feature_set_operations.py | 2 +- .../azure-ai-ml/azure/ai/ml/operations/_job_operations.py | 2 +- .../azure/ai/ml/operations/_model_operations.py | 2 +- 18 files changed, 30 insertions(+), 16 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py index 0b5e25de311b..843a20c93b58 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py @@ -903,6 +903,12 @@ def _get_latest( :type registry_name: Optional[str] :param order_by: Specifies how to order the results. Defaults to :attr:`OrderString.CREATED_AT_DESC` :type order_by: Literal[OrderString.CREATED_AT, OrderString.CREATED_AT_DESC] + :param registry_service_client: The registry data-plane service client (registry scenario only). + :type registry_service_client: Any + :param asset_plural: The plural asset segment used in the registry URL (registry scenario only). + :type asset_plural: str + :param arm_cls: The arm model class used to deserialize the registry response (registry scenario only). + :type arm_cls: Any :return: The latest version of the requested asset :rtype: Union[ModelVersionData, DataVersionBaseData] """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py index 239f8da829f8..906c04f52cd9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_package_utils.py @@ -5,6 +5,7 @@ # pylint: disable=try-except-raise import logging +from typing import Any from azure.ai.ml.entities import BatchDeployment, OnlineDeployment, Deployment diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py index 4addfcffdc01..9935c38740a4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_registry_utils.py @@ -2,6 +2,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# This module replicates the generated arm_ml_service client's LRO/paging machinery against the registry +# data-plane (MFE) endpoint, so it intentionally reaches into client internals (``_config``/``_client``/ +# ``_serialize``) and uses long, descriptive helper names. +# pylint: disable=protected-access,docstring-missing-type,docstring-missing-param,name-too-long + +import json import logging from typing import Optional, Tuple @@ -20,8 +26,6 @@ from azure.core.rest import HttpRequest from azure.mgmt.core.polling.arm_polling import ARMPolling -import json - module_logger = logging.getLogger(__name__) MFE_PATH_PREFIX = "mferp/managementfrontend" 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 0d4a3e35d5fd..0a55a80ea1fb 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 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access,redefined-builtin +# pylint: disable=protected-access,redefined-builtin,reimported from abc import ABC from typing import Any, Dict, List, Optional, Type, Union diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py index d72045093e11..958fb640e98a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distribution.py @@ -228,7 +228,7 @@ def _to_rest_object(self) -> RestDistributionConfiguration: wire["headNodeAdditionalArgs"] = self.head_node_additional_args if self.worker_node_additional_args is not None: wire["workerNodeAdditionalArgs"] = self.worker_node_additional_args - return RestDistributionConfiguration._deserialize(wire, []) + return RestDistributionConfiguration._deserialize(wire, []) # pylint: disable=protected-access DISTRIBUTION_TYPE_MAP = { diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py index 2584bc377f14..2857bdcdc585 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py @@ -12,9 +12,7 @@ FineTuningJob as RestFineTuningJob, JobBase as RestJobBase, JobOutput as RestJobOutput, - JobResourceConfiguration as RestJobResourceConfiguration, MLFlowModelJobInput, - QueueSettings as RestQueueSettings, UriFileJobInput, ) from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py index f5af19be4267..1a405f9677df 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_limits.py @@ -77,7 +77,7 @@ def _from_rest_object(cls, obj: Union[RestCommandJobLimits, dict]) -> Optional[" if is_data_binding_expression(timeout_value): return cls(timeout=timeout_value) # if response timeout is a normal iso date string - obj = RestCommandJobLimits._deserialize(obj, []) + obj = RestCommandJobLimits._deserialize(obj, []) # pylint: disable=protected-access return cls(timeout=from_iso_duration_format(obj.timeout)) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 569bffa193e3..3859e0707fb5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -2,6 +2,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# The imports below the module-level helper are intentionally deferred to break a circular import. +# pylint: disable=wrong-import-position + import copy from typing import Any, Dict, List, Optional, Tuple, Type, Union @@ -25,6 +28,7 @@ def _rest_io_to_snake_dict(rest_io: Any) -> Dict: keys back so downstream name/version handling still finds them. :param rest_io: A msrest or arm_ml_service rest input/output model. + :type rest_io: Any :return: The snake_case dict view. :rtype: Dict """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py index 5d230bcabc80..b32d9afc8ad8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/pipeline_job.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,too-many-statements import itertools import logging import typing diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py index 7c1a1c5ce3c4..fa87f375ddc6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,reimported from functools import singledispatch from pathlib import Path diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py index 1915acfef07b..e029afa67ddf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py @@ -37,6 +37,7 @@ def __init__( self._service_client = service_client self._workspace_connections_operations = connections_operations + # pylint: disable-next=unused-argument def list(self, connection_name: str, **kwargs: Any) -> Iterable[AzureOpenAIDeployment]: """List Azure OpenAI deployments of the workspace. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py index 9ca034de010a..2829675afdd8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,too-many-locals,too-many-branches import json import os diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py index 83c6e77a98ca..d582a8f4dd62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,reimported from typing import Any, Dict, Iterable, Optional, cast diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 3c7e3cf5a3bb..7f1368661033 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -9,7 +9,7 @@ import uuid from contextlib import contextmanager from pathlib import Path -from typing import Any, Dict, Generator, Iterable, List, Optional, Union, cast +from typing import Any, Dict, Generator, Iterable, List, Optional, cast from urllib.parse import quote from marshmallow.exceptions import ValidationError as SchemaValidationError diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index 6d8c52caae84..118b9209aa1c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -5,7 +5,7 @@ # pylint: disable=protected-access from contextlib import contextmanager -from typing import Any, Generator, Iterable, Optional, Union, cast +from typing import Any, Generator, Iterable, Optional, cast from marshmallow.exceptions import ValidationError as SchemaValidationError diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py index 03ddbb1c0a06..4d7a10d73a1e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_set_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,reimported import json import os diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index 24e5589e7358..5bd1ae962184 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access, too-many-instance-attributes, too-many-statements, too-many-lines +# pylint: disable=protected-access, too-many-instance-attributes, too-many-statements, too-many-lines, reimported import json import os.path from os import PathLike diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 15d8d3797fa9..419e2528729c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access,disable=docstring-missing-return,docstring-missing-param,docstring-missing-rtype,line-too-long,too-many-statements +# pylint: disable=protected-access,docstring-missing-return,docstring-missing-param,docstring-missing-rtype,line-too-long,too-many-statements,reimported,too-many-branches import re from contextlib import contextmanager From a633d9f64e59197f99c191f4b8d2f8edc85b6715 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 14 Jul 2026 14:57:09 +0530 Subject: [PATCH 113/146] Fix mypy: type annotations, Optional guards, and targeted ignores for arm-model Any types --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 4 +-- .../_package/base_environment_source.py | 3 ++- .../_artifacts/_package/model_package.py | 4 +-- .../ml/entities/_data_import/data_import.py | 4 +-- .../ai/ml/entities/_data_import/schedule.py | 4 ++- .../_job/automl/nlp/automl_nlp_job.py | 2 +- .../_job/automl/search_space_utils.py | 6 +++-- .../ai/ml/entities/_job/spark_job_entry.py | 4 +-- .../_azure_openai_deployment_operations.py | 2 +- .../_batch_deployment_operations.py | 2 +- .../operations/_batch_endpoint_operations.py | 2 +- .../ai/ml/operations/_model_operations.py | 26 +++++++++---------- 12 files changed, 34 insertions(+), 29 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index a738600f696c..e227029d10e5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -588,7 +588,7 @@ def __init__( self._operation_config, (self._service_client_registry_arm if registry_name else self._service_client_04_2023), self._datastores, - registry_service_client=getattr(self, "_service_client_registry_arm", None), + registry_service_client=getattr(self, "_service_client_registry_arm", None), # type: ignore[arg-type] **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.CODE, self._code) @@ -671,7 +671,7 @@ def __init__( (self._service_client_registry_arm if registry_name else self._service_client_01_2024_preview_arm), self._operation_container, self._preflight, - registry_service_client=getattr(self, "_service_client_registry_arm", None), + registry_service_client=getattr(self, "_service_client_registry_arm", None), # type: ignore[arg-type] **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.COMPONENT, self._components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py index c3d154c57d11..674eeeb38a69 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py @@ -40,7 +40,8 @@ def __init__(self, type: str, resource_id: Optional[str] = None): def _from_rest_object(cls, rest_obj: Any) -> "BaseEnvironment": if isinstance(rest_obj, dict): return BaseEnvironment( - type=rest_obj.get("baseEnvironmentSourceType"), resource_id=rest_obj.get("resourceId") + type=rest_obj.get("baseEnvironmentSourceType"), # type: ignore[arg-type] + resource_id=rest_obj.get("resourceId"), ) return BaseEnvironment(type=rest_obj.base_environment_source_type, resource_id=rest_obj.resource_id) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py index 580438a8ecc9..dd2bbfd53cfd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py @@ -350,12 +350,12 @@ def _to_rest_object(self) -> Dict[str, Any]: code_id = ( self.inferencing_server.code_configuration.code if isinstance(self.inferencing_server.code_configuration.code, str) - else self.inferencing_server.code_configuration.code.id + else self.inferencing_server.code_configuration.code.id # type: ignore[union-attr] ) code = {"codeId": code_id} if self.inferencing_server.code_configuration.scoring_script is not None: code["scoringScript"] = self.inferencing_server.code_configuration.scoring_script - self.inferencing_server.code_configuration = code + self.inferencing_server.code_configuration = code # type: ignore[assignment] package_request: Dict[str, Any] = {} if self.target_environment_id is not None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py index 95a9ff4c8da7..e0a5e0be89ce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py @@ -130,8 +130,8 @@ def _from_rest_object(cls, data_rest_object: Dict[str, Any]) -> "DataImport": data_type = AssetTypes.URI_FOLDER data_import = cls( - name=data_rest_object.get("assetName"), - path=data_rest_object.get("dataUri"), + name=data_rest_object.get("assetName"), # type: ignore[arg-type] + path=data_rest_object.get("dataUri"), # type: ignore[arg-type] source=source, description=data_rest_object.get("description"), tags=data_rest_object.get("tags"), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py index b881f02aff15..b7233edcdd7b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py @@ -95,7 +95,9 @@ def _from_rest_object(cls, obj: RestSchedule) -> "ImportDataSchedule": return cls( trigger=TriggerBase._from_rest_object(obj.properties.trigger), import_data=( - DataImport._from_rest_object(data_import_definition) if data_import_definition is not None else None + DataImport._from_rest_object(data_import_definition) # type: ignore[arg-type] + if data_import_definition is not None + else None ), name=obj.name, display_name=obj.properties.display_name, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py index e41d5dee6ffc..7c30c16b9cd6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/automl_nlp_job.py @@ -432,7 +432,7 @@ def extend_search_space(self, value: Union[SearchSpace, List[SearchSpace]]) -> N ) @classmethod - def _get_search_space_from_str(cls, search_space_str: Optional[str]) -> Optional[List]: + def _get_search_space_from_str(cls, search_space_str: Optional[List]) -> Optional[List]: if search_space_str is not None: return [NlpSearchSpace._from_rest_object(entry) for entry in search_space_str if entry is not None] return None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/search_space_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/search_space_utils.py index 732030d4ed8e..5c5f6f16b54c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/search_space_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/search_space_utils.py @@ -5,7 +5,7 @@ # pylint: disable=protected-access import re -from typing import Any, List, Union +from typing import Any, List, Optional, Union from marshmallow import fields @@ -138,10 +138,12 @@ def _get_type_inferred_value(value: str) -> Union[bool, int, float, str]: def _convert_from_rest_object( - sweep_distribution_str: str, + sweep_distribution_str: Optional[str], ) -> Any: # sweep_distribution_str can be a distribution like "choice('vitb16r224', 'vits16r224')" or # a single value like "True", "1", "1.0567", "vitb16r224" + if sweep_distribution_str is None: + return None sweep_distribution_str = sweep_distribution_str.strip() # Filter by the delimiters and remove splits that are empty strings diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py index 65b82695075e..a9e2af2e67d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job_entry.py @@ -53,11 +53,11 @@ def _from_rest_object(cls, obj: Union[SparkJobPythonEntry, SparkJobScalaEntry]) entry_type = obj.get("spark_job_entry_type") or obj.get("sparkJobEntryType") if entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: return SparkJobEntry( - entry=obj.get("file", None), + entry=obj.get("file", None), # type: ignore[arg-type] type=SparkJobEntryType.SPARK_JOB_FILE_ENTRY, ) return SparkJobEntry( - entry=obj.get("class_name", None), + entry=obj.get("class_name", None), # type: ignore[arg-type] type=SparkJobEntryType.SPARK_JOB_CLASS_ENTRY, ) if obj.spark_job_entry_type == SparkJobEntryType.SPARK_JOB_FILE_ENTRY: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py index e029afa67ddf..98fa34019b15 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_azure_openai_deployment_operations.py @@ -49,7 +49,7 @@ def list(self, connection_name: str, **kwargs: Any) -> Iterable[AzureOpenAIDeplo connection = self._workspace_connections_operations.get(connection_name) def _from_rest_add_connection_name(obj: Any) -> AzureOpenAIDeployment: - from_rest_deployment = AzureOpenAIDeployment._from_rest_object(obj) + from_rest_deployment = AzureOpenAIDeployment._from_rest_object(obj) # type: ignore[attr-defined] from_rest_deployment.connection_name = connection_name from_rest_deployment.target_url = connection.target return from_rest_deployment diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py index b7f702db1896..1562bc317554 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py @@ -316,7 +316,7 @@ def list_jobs(self, endpoint_name: str, *, name: Optional[str] = None) -> ItemPa token = self._credentials.get_token(*ml_audience_scopes).token if self._credentials is not None else "" headers["Authorization"] = f"Bearer {token}" - jobs = [] + jobs: list[BatchJob] = [] next_link: Optional[str] = list_url while next_link: response = self._requests_pipeline.get(next_link, headers=headers) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py index 2829675afdd8..7a837ebc3609 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py @@ -445,7 +445,7 @@ def list_jobs(self, endpoint_name: str) -> ItemPaged[BatchJob]: token = self._credentials.get_token(*ml_audience_scopes).token if self._credentials is not None else "" headers[EndpointInvokeFields.AUTHORIZATION] = f"Bearer {token}" - jobs = [] + jobs: list[BatchJob] = [] next_link: Optional[str] = list_url while next_link: response = self._requests_pipeline.get(next_link, headers=headers) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 419e2528729c..65a5ca71d522 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -790,13 +790,13 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar package_request.inferencing_server.code_configuration.code, AzureMLResourceType.CODE, ): - if package_request.inferencing_server.code_configuration.code.startswith(ARM_ID_PREFIX): - package_request.inferencing_server.code_configuration.code = orchestrators.get_asset_arm_id( - package_request.inferencing_server.code_configuration.code[len(ARM_ID_PREFIX) :], + if package_request.inferencing_server.code_configuration.code.startswith(ARM_ID_PREFIX): # type: ignore[union-attr] + package_request.inferencing_server.code_configuration.code = orchestrators.get_asset_arm_id( # type: ignore[assignment] + package_request.inferencing_server.code_configuration.code[len(ARM_ID_PREFIX) :], # type: ignore[index] azureml_type=AzureMLResourceType.CODE, ) else: - package_request.inferencing_server.code_configuration.code = orchestrators.get_asset_arm_id( + package_request.inferencing_server.code_configuration.code = orchestrators.get_asset_arm_id( # type: ignore[assignment] Code( base_path=package_request._base_path, path=package_request.inferencing_server.code_configuration.code, @@ -807,21 +807,21 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar package_request.inferencing_server.code_configuration, "code" ): package_request.inferencing_server.code_configuration.code = ( - "azureml:/" + package_request.inferencing_server.code_configuration.code + "azureml:/" + package_request.inferencing_server.code_configuration.code # type: ignore[operator] ) if package_request.base_environment_source and hasattr( package_request.base_environment_source, "resource_id" ): - if not package_request.base_environment_source.resource_id.startswith(REGISTRY_URI_FORMAT): - package_request.base_environment_source.resource_id = orchestrators.get_asset_arm_id( + if not package_request.base_environment_source.resource_id.startswith(REGISTRY_URI_FORMAT): # type: ignore[union-attr] + package_request.base_environment_source.resource_id = orchestrators.get_asset_arm_id( # type: ignore[assignment] package_request.base_environment_source.resource_id, azureml_type=AzureMLResourceType.ENVIRONMENT, ) package_request.base_environment_source.resource_id = ( - "azureml:/" + package_request.base_environment_source.resource_id - if not package_request.base_environment_source.resource_id.startswith(ARM_ID_PREFIX) + "azureml:/" + package_request.base_environment_source.resource_id # type: ignore[operator] + if not package_request.base_environment_source.resource_id.startswith(ARM_ID_PREFIX) # type: ignore[union-attr] else package_request.base_environment_source.resource_id ) @@ -842,13 +842,13 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar package_request.target_environment_id = ( package_request.target_environment_id + f"/versions/{package_request.environment_version}" ) - package_request = package_request._to_rest_object() + package_request = package_request._to_rest_object() # type: ignore[assignment] if self._registry_reference: - package_request["targetEnvironmentId"] = ( + package_request["targetEnvironmentId"] = ( # type: ignore[index] f"azureml://locations/{self._operation_scope._workspace_location}" f"/workspaces/{self._operation_scope._workspace_id}/environments/" - f"{package_request.get('targetEnvironmentId')}" + f"{package_request.get('targetEnvironmentId')}" # type: ignore[attr-defined] ) if self._registry_name or self._registry_reference: # Byte-identical to the legacy v2021_10 registry ``begin_package`` (same MFE endpoint + api-version + wire body). @@ -880,7 +880,7 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar environment_id = package_out.additional_properties["targetEnvironmentId"] pattern = r"azureml://locations/(\w+)/workspaces/([\w-]+)/environments/([\w.-]+)/versions/(\d+)" - parsed_id: Any = re.search(pattern, environment_id) + parsed_id: Any = re.search(pattern, environment_id) # type: ignore[arg-type] if parsed_id: environment_name = parsed_id.group(3) From ab4acce57942c796dcfe2a9de7727c16fe095a61 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 14 Jul 2026 16:34:57 +0530 Subject: [PATCH 114/146] fix(assets): byte-identical archive/restore PUT body (prune None props + drop stage) --- .../azure/ai/ml/_utils/_asset_utils.py | 37 ++++++++++++++++--- .../ai/ml/_utils/_feature_store_utils.py | 6 ++- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py index 843a20c93b58..56595ba30eda 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py @@ -10,6 +10,7 @@ import os import uuid import warnings +from collections.abc import MutableMapping from concurrent.futures import ThreadPoolExecutor, as_completed from contextlib import suppress from multiprocessing import cpu_count @@ -965,6 +966,32 @@ def _get_latest( return latest +def _archive_restore_body(resource: Any, drop_stage: bool) -> Any: + """Prune an arm asset model in place so its archive/restore PUT body is byte-identical to the legacy client. + + The wire recordings were captured with the legacy msrest client, which omitted ``None``-valued properties and, for + versioned assets, dropped ``stage`` (the old code set ``properties.stage = None``). The hybrid ``SdkJSONEncoder`` + instead emits untyped ``None`` keys as explicit ``null`` and retains the untyped ``stage`` key. This removes those + keys from the model's ``properties`` mapping in place (``is_archived`` must already be set) so serialization matches + the original request body. The same model object is returned so callers keep passing one ``body`` reference. + + :param resource: The arm hybrid version/container model (with ``is_archived`` already set). + :type resource: Any + :param drop_stage: When ``True`` (version assets) the ``stage`` property is removed to match the legacy behavior of + setting it to ``None``; containers have no ``stage`` and pass ``False``. + :type drop_stage: bool + :return: The same ``resource`` with its properties pruned. + :rtype: Any + """ + props = getattr(resource, "properties", None) + if isinstance(props, MutableMapping): + for key in [k for k, v in list(props.items()) if v is None]: + del props[key] + if drop_stage and "stage" in props: + del props["stage"] + return resource + + def _archive_or_restore( asset_operations: Union[ "DataOperations", @@ -1023,7 +1050,6 @@ def _archive_or_restore( [], ) version_resource.properties.is_archived = is_archived - version_resource.properties.stage = None begin_create_or_update_registry_versioned_asset( registry_service_client, asset_plural, @@ -1031,7 +1057,7 @@ def _archive_or_restore( version, resource_group_name, registry_name, - version_resource, + _archive_restore_body(version_resource, drop_stage=True), ) else: version_resource = version_operation.get( @@ -1041,13 +1067,12 @@ def _archive_or_restore( workspace_name=workspace_name, ) version_resource.properties.is_archived = is_archived - version_resource.properties.stage = None version_operation.create_or_update( name=name, version=version, resource_group_name=resource_group_name, workspace_name=workspace_name, - body=version_resource, + body=_archive_restore_body(version_resource, drop_stage=True), ) else: if registry_name: @@ -1069,7 +1094,7 @@ def _archive_or_restore( name, resource_group_name, registry_name, - container_resource, + _archive_restore_body(container_resource, drop_stage=False), ) else: container_resource = container_operation.get( @@ -1082,7 +1107,7 @@ def _archive_or_restore( name=name, resource_group_name=resource_group_name, workspace_name=workspace_name, - body=container_resource, + body=_archive_restore_body(container_resource, drop_stage=False), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_feature_store_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_feature_store_utils.py index 6629086676b3..8d7a485ebd5a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_feature_store_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_feature_store_utils.py @@ -94,12 +94,16 @@ def _archive_or_restore( version_resource.properties.is_archived = is_archived version_resource.properties.stage = "Archived" if is_archived else "Development" + # Prune None-valued properties to match the legacy msrest wire body (SdkJSONEncoder would otherwise emit them as + # explicit null); stage is intentionally set to a real value above and preserved. + from ._asset_utils import _archive_restore_body + poller = version_operation.begin_create_or_update( name=name, version=version, resource_group_name=resource_group_name, workspace_name=workspace_name, - body=version_resource, + body=_archive_restore_body(version_resource, drop_stage=False), **kwargs, ) poller.result() From 0a7b848f7c58d43d0b07937ec83216130b3b585c Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 14 Jul 2026 20:52:39 +0530 Subject: [PATCH 115/146] fix(data): read untyped autoDeleteSetting wire key on _from_rest_object --- .../azure/ai/ml/entities/_assets/_artifacts/data.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py index 498aaf365960..30adc0caf3b8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py @@ -26,6 +26,7 @@ from azure.ai.ml._utils.utils import is_url from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, SHORT_URI_FORMAT, AssetTypes from azure.ai.ml.entities._assets import Artifact +from azure.ai.ml.entities._assets.auto_delete_setting import AutoDeleteSetting from azure.ai.ml.entities._system_data import SystemData from azure.ai.ml.entities._util import load_from_dict from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException @@ -207,6 +208,16 @@ def _from_rest_object(cls, data_rest_object: DataVersionBase) -> "Data": data_rest_object_details: DataVersionBaseProperties = data_rest_object.properties arm_id_object = get_arm_id_object_from_id(data_rest_object.id) path = data_rest_object_details.data_uri + # ``autoDeleteSetting`` was dropped from the arm_ml_service (2025-12) model, so it is an + # untyped wire key on the hybrid model rather than a typed attribute; read it directly. + raw_auto_delete = ( + data_rest_object_details.get("autoDeleteSetting") if hasattr(data_rest_object_details, "get") else None + ) + if raw_auto_delete is None: + raw_auto_delete = getattr(data_rest_object_details, "auto_delete_setting", None) + auto_delete_setting = ( + AutoDeleteSetting._from_rest_object(raw_auto_delete) if raw_auto_delete is not None else None + ) data = Data( id=data_rest_object.id, name=arm_id_object.asset_name, @@ -219,7 +230,7 @@ def _from_rest_object(cls, data_rest_object: DataVersionBase) -> "Data": creation_context=SystemData._from_rest_object(data_rest_object.system_data), is_anonymous=data_rest_object_details.is_anonymous, referenced_uris=getattr(data_rest_object_details, "referenced_uris", None), - auto_delete_setting=getattr(data_rest_object_details, "auto_delete_setting", None), + auto_delete_setting=auto_delete_setting, ) return data From 9ff179594c768b2f577358b98eae6d198f9b0082 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 10:15:53 +0530 Subject: [PATCH 116/146] fix(validation,tests): serialize arm properties as object for remote validate + component e2e casing --- .../azure/ai/ml/entities/_validation/remote.py | 10 +++++++++- .../tests/component/e2etests/test_component.py | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_validation/remote.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_validation/remote.py index 06f022a06f94..7d554241ca66 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_validation/remote.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_validation/remote.py @@ -2,11 +2,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +import json import logging import typing import msrest +from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder from azure.ai.ml._vendor.azure_resources.models import ( Deployment, DeploymentProperties, @@ -117,11 +119,17 @@ def _to_preflight_resource(self, location: str, workspace_name: str) -> Prefligh :rtype: PreflightResource """ name, version = self._get_resource_name_version() + rest_properties = self._to_rest_object().properties + # The arm_ml_service hybrid models are MutableMappings, not dicts. msrest's ``object`` serializer stringifies + # them (``str(model)``) instead of emitting a JSON object, which breaks the deployment-validate body. Convert + # to the plain wire dict so it serializes as an object, byte-identical to the legacy msrest client. + if not isinstance(rest_properties, dict): + rest_properties = json.loads(json.dumps(rest_properties, cls=SdkJSONEncoder, exclude_readonly=True)) return PreflightResource( type=self._get_resource_type(), name=f"{workspace_name}/{name}/{version}", location=location, - properties=self._to_rest_object().properties, + properties=rest_properties, api_version="2023-03-01-preview", ) diff --git a/sdk/ml/azure-ai-ml/tests/component/e2etests/test_component.py b/sdk/ml/azure-ai-ml/tests/component/e2etests/test_component.py index 801bbc8d6115..c9b96e292eb1 100644 --- a/sdk/ml/azure-ai-ml/tests/component/e2etests/test_component.py +++ b/sdk/ml/azure-ai-ml/tests/component/e2etests/test_component.py @@ -27,6 +27,7 @@ from azure.ai.ml.entities._load_functions import load_code, load_job from azure.core.exceptions import HttpResponseError from azure.core.paging import ItemPaged +from azure.core.serialization import as_attribute_dict from .._util import _COMPONENT_TIMEOUT_SECOND from ..unittests.test_component_schema import load_component_entity_from_rest_json @@ -612,9 +613,9 @@ def test_pytorch_component( # additional fields added_property in distribution and resources are removed. torch_resources = {"instance_count": 2, "properties": {}} assert component_entity.distribution.__dict__ == torch_distribution() - assert component_entity.resources._to_rest_object().as_dict() == torch_resources + assert as_attribute_dict(component_entity.resources._to_rest_object()) == torch_resources torch_component_resource = client.components.create_or_update(component_entity) - assert torch_component_resource.resources._to_rest_object().as_dict() == torch_resources + assert as_attribute_dict(torch_component_resource.resources._to_rest_object()) == torch_resources assert torch_component_resource.distribution.__dict__ == torch_distribution(has_strs=True) def test_tensorflow_component( @@ -996,7 +997,7 @@ def test_command_component_with_properties_e2e_flow(self, client: MLClient, rand } omit_fields = ["name", "creation_context", "id", "code", "environment", "version"] rest_component = pydash.omit( - command_component._to_rest_object().as_dict()["properties"]["component_spec"], + command_component._to_rest_object().as_dict()["properties"]["componentSpec"], omit_fields, ) From 5b5ae08130c31fc185e2604be896c376f498abac Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 10:27:26 +0530 Subject: [PATCH 117/146] fix(model,tests): str-coerce model tags/properties + ignore query-param ordering in playback --- .../azure/ai/ml/entities/_assets/_artifacts/model.py | 11 +++++++++-- sdk/ml/azure-ai-ml/tests/conftest.py | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index e171620fd77e..103fd7dfe41c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -238,10 +238,17 @@ def _to_rest_object(self) -> ModelVersion: # ``ModelVersionDetails`` had NO ``stage`` field, so models WITH deployment templates dropped ``stage`` on the # wire; that quirk is preserved by omitting ``stage`` when a deployment template is present. has_deployment_template = bool(self.default_deployment_template or self.allowed_deployment_templates) + # The legacy v2021_10 ``ModelVersionDetails`` typed tags/properties as ``{str}``; msrest coerced every value to + # a string on the wire (e.g. YAML ``abc: 123`` -> ``"123"``). The arm hybrid model keeps the native type, so + # coerce here to stay byte-identical. + tags = {k: str(v) for k, v in self.tags.items() if v is not None} if self.tags else self.tags + properties = ( + {k: str(v) for k, v in self.properties.items() if v is not None} if self.properties else self.properties + ) model_version = ModelVersionProperties( description=self.description, - tags=self.tags, - properties=self.properties, + tags=tags, + properties=properties, flavors=( {key: FlavorData(data=dict(value)) for key, value in self.flavors.items()} if self.flavors else None ), # flatten OrderedDict to dict diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index a1f18300fe0d..1c6dd80d429e 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -95,6 +95,7 @@ def add_sanitizers(test_proxy, fake_datastore_key): compare_bodies=True, excluded_headers="x-ms-meta-name, x-ms-meta-version,x-ms-blob-type,If-None-Match,Content-Type,Content-MD5,Content-Length,Accept", ignored_query_parameters="api-version", + ignore_query_ordering=True, ) subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") From 030a9d96a9269074d32fb32ba6ba75c888417e3c Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 10:43:52 +0530 Subject: [PATCH 118/146] fix(sweep): deserialize untyped resources dict on read so instance_count survives round-trip --- .../azure/ai/ml/entities/_job/sweep/sweep_job.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py index 2da644dddfd2..77be6bb7b749 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py @@ -395,6 +395,13 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": for param, dist in properties.search_space.items(): _search_space[param] = SweepDistribution._from_rest_object(dist) + # ``resources`` was dropped as a typed field from the shared arm_ml_service SweepJob (2025-01), so the response + # carries it as an untyped camelCase dict. Deserialize into the arm model so ``_from_rest_object`` reads the + # camelCase wire keys (e.g. instanceCount) instead of treating them as snake_case ctor kwargs. + rest_resources = properties.get("resources") + if isinstance(rest_resources, dict): + rest_resources = RestJobResourceConfiguration._deserialize(rest_resources, []) + return SweepJob( name=obj.name, id=obj.id, @@ -419,7 +426,7 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None ), queue_settings=properties.queue_settings, - resources=JobResourceConfiguration._from_rest_object(properties.get("resources")), + resources=JobResourceConfiguration._from_rest_object(rest_resources), ) def _override_missing_properties_from_trial(self) -> None: From 9f40f74b83fa231c6725156a538e339696507f7b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 12:01:59 +0530 Subject: [PATCH 119/146] fix(pipeline): read snake_case queue_settings on node round-trip + as_attribute_dict in pipeline e2e casing asserts --- .../azure/ai/ml/entities/_job/queue_settings.py | 5 +++++ .../tests/pipeline_job/e2etests/test_pipeline_job.py | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py index 8617de8723e0..b9f530b626f0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/queue_settings.py @@ -62,6 +62,11 @@ def _from_rest_object(cls, obj: Union[Dict[str, Any], RestQueueSettings, None]) if obj is None: return None if isinstance(obj, dict): + # Pipeline node rest objects are snake_case dicts (``job_tier``) while arm job responses use the + # camelCase wire key (``jobTier``). Normalize so ``RestQueueSettings._deserialize`` (which reads the + # camelCase wire key) picks up the value regardless of which form the caller passes. + if "job_tier" in obj and "jobTier" not in obj: + obj = {**obj, "jobTier": obj["job_tier"]} queue_settings = RestQueueSettings._deserialize(obj, []) # pylint: disable=protected-access return cls._from_rest_object(queue_settings) job_tier = JobTierNames.REST_TO_ENTITY.get(obj.job_tier, None) if obj.job_tier else None diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/e2etests/test_pipeline_job.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/e2etests/test_pipeline_job.py index 64e33febb4ed..8cc900e10e1c 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/e2etests/test_pipeline_job.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/e2etests/test_pipeline_job.py @@ -18,6 +18,7 @@ from azure.ai.ml.entities._builders.spark import Spark from azure.ai.ml.exceptions import JobException from azure.core.exceptions import HttpResponseError +from azure.core.serialization import as_attribute_dict from .._util import ( _PIPELINE_JOB_LONG_RUNNING_TIMEOUT_SECOND, @@ -513,7 +514,7 @@ def test_pipeline_job_with_command_job( # assert on the number of converted jobs to make sure we didn't drop the command job assert len(created_job.jobs.items()) == converted_jobs - pipeline_dict = created_job._to_rest_object().as_dict() + pipeline_dict = as_attribute_dict(created_job._to_rest_object()) actual_dict = pydash.omit(pipeline_dict["properties"], *fields_to_omit) assert actual_dict == expected_dict @@ -1352,7 +1353,7 @@ def test_pipeline_component_job(self, client: MLClient): test_path = "./tests/test_configs/pipeline_jobs/pipeline_component_job.yml" job: PipelineJob = load_job(source=test_path) rest_job = assert_job_cancel(job, client) - pipeline_dict = rest_job._to_rest_object().as_dict()["properties"] + pipeline_dict = as_attribute_dict(rest_job._to_rest_object())["properties"] assert pipeline_dict["component_id"] assert pipeline_dict["inputs"] == { "component_in_number": {"job_input_type": "literal", "value": "10"}, @@ -1376,7 +1377,7 @@ def test_remote_pipeline_component_job(self, client: MLClient, randstr: Callable ) pipeline_node.settings.default_compute = "cpu-cluster" rest_job = assert_job_cancel(pipeline_node, client) - pipeline_dict = rest_job._to_rest_object().as_dict()["properties"] + pipeline_dict = as_attribute_dict(rest_job._to_rest_object())["properties"] assert pipeline_dict["component_id"] assert pipeline_dict["inputs"] == { "component_in_number": {"job_input_type": "literal", "value": "10"}, From 8707997a8073c53f207e4ab24bf2d425a5d2a78d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 12:14:32 +0530 Subject: [PATCH 120/146] fix(pipeline-io): drop stray camelCase assetVersion from node IO so registered outputs match legacy wire --- .../azure/ai/ml/entities/_job/pipeline/_io/mixin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py index 3859e0707fb5..1a22b9814016 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_io/mixin.py @@ -37,6 +37,10 @@ def _rest_io_to_snake_dict(rest_io: Any) -> Dict: asset_version = rest_io.get("assetVersion") if asset_version is not None: result["asset_version"] = asset_version + # ``as_attribute_dict`` passes the untyped ``assetVersion`` wire key through unchanged; drop it so the node + # carries only the snake ``version`` key (matching the legacy msrest node wire format; the camelCase + # ``assetVersion`` would otherwise be an extra field on the pipeline-node output/input). + result.pop("assetVersion", None) return result return rest_io.as_dict() From 05a715327f237f70eb35103530d94d9a7469e92d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 15:27:50 +0530 Subject: [PATCH 121/146] fix(dsl): resolve arbitrary-attr data bindings for arm encoder + as_attribute_dict in dsl e2e casing asserts --- .../ai/ml/entities/_builders/base_node.py | 9 ++- .../dsl/e2etests/test_automl_dsl_pipeline.py | 5 +- .../dsl/e2etests/test_controlflow_pipeline.py | 3 +- .../tests/dsl/e2etests/test_dsl_pipeline.py | 69 +++++++++++++------ .../dsl/e2etests/test_dsl_pipeline_samples.py | 5 +- 5 files changed, 65 insertions(+), 26 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/base_node.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/base_node.py index b1379345dd7c..6ba1ebdfd05d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/base_node.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/base_node.py @@ -452,6 +452,13 @@ def _to_rest_object(self, **kwargs: Any) -> dict: # pylint: disable=unused-argu if key in base_dict: rest_obj[key] = base_dict.get(key) + # Resolve any embedded data-binding objects (PipelineInput/NodeInput/PipelineExpression) in arbitrary + # user-set attributes to their binding strings. The legacy msrest encoder tolerated raw objects here, but + # the shared arm_ml_service ``SdkJSONEncoder`` raises on them (e.g. ``node.unknown_field = pipeline_input``). + from azure.ai.ml.entities._util import get_rest_dict_for_node_attrs + + arbitrary_attrs = {key: get_rest_dict_for_node_attrs(value) for key, value in self._get_attrs().items()} + rest_obj.update( dict( # pylint: disable=use-dict-literal name=self.name, @@ -464,7 +471,7 @@ def _to_rest_object(self, **kwargs: Any) -> dict: # pylint: disable=unused-argu properties=self.properties, _source=self._source, # add all arbitrary attributes to support setting unknown attributes - **self._get_attrs(), + **arbitrary_attrs, ) ) # only add comment in REST object when it is set diff --git a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_automl_dsl_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_automl_dsl_pipeline.py index bdb34e5c2a87..79b149bec1a5 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_automl_dsl_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_automl_dsl_pipeline.py @@ -4,6 +4,7 @@ import pytest from devtools_testutils import AzureRecordedTestCase from test_utilities.utils import cancel_job, get_automl_job_properties +from azure.core.serialization import as_attribute_dict from azure.ai.ml import Input, MLClient, automl, dsl, Output from azure.ai.ml.automl import ( @@ -143,7 +144,7 @@ def train_automl_classification_in_pipeline( from_rest_pipeline_job = client.jobs.create_or_update(pipeline_job) cancel_job(client, from_rest_pipeline_job) - actual_dict = from_rest_pipeline_job._to_rest_object().as_dict() + actual_dict = as_attribute_dict(from_rest_pipeline_job._to_rest_object()) fields_to_omit = ["name", "display_name", "experiment_name", "properties"] classification_dict = pydash.omit(actual_dict["properties"]["jobs"]["classification_node"], fields_to_omit) @@ -170,7 +171,7 @@ def train_automl_classification_in_pipeline( ) assert classification_dict == { "asset_name": "classification_output_name", - "asset_version": "2", + "assetVersion": "2", "job_output_type": "mlflow_model", "mode": "ReadWriteMount", } diff --git a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_controlflow_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_controlflow_pipeline.py index 74bbf8959277..331f14f4fdda 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_controlflow_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_controlflow_pipeline.py @@ -3,6 +3,7 @@ import pytest from devtools_testutils import AzureRecordedTestCase, is_live from test_utilities.utils import _PYTEST_TIMEOUT_METHOD, assert_job_cancel, omit_with_wildcard +from azure.core.serialization import as_attribute_dict from azure.ai.ml import Input, MLClient, Output, load_component from azure.ai.ml.dsl import pipeline @@ -808,7 +809,7 @@ def parallel_for_pipeline(): with include_private_preview_nodes_in_pipeline(): pipeline_job = assert_job_cancel(pipeline_job, client) - dsl_pipeline_job_dict = omit_with_wildcard(pipeline_job._to_rest_object().as_dict(), *omit_fields) + dsl_pipeline_job_dict = omit_with_wildcard(as_attribute_dict(pipeline_job._to_rest_object()), *omit_fields) assert dsl_pipeline_job_dict["properties"]["jobs"] == { "parallel_body": { "_source": "YAML.COMPONENT", diff --git a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py index b12432c84eda..ebfeba98da45 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py @@ -35,6 +35,7 @@ from azure.ai.ml.entities import Data, JobResourceConfiguration, PipelineJob, QueueSettings from azure.ai.ml.exceptions import UnexpectedKeywordError, ValidationException from azure.ai.ml.parallel import ParallelJob, RunFunction, parallel_run_function +from azure.core.serialization import as_attribute_dict from .._util import _DSL_TIMEOUT_SECOND @@ -499,7 +500,9 @@ def mixed_pipeline(job_in_number, job_in_path): pipeline, experiment_name="mixed_pipeline", ) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "tags": {"owner": "sdkteam", "tag": "tagvalue"}, "compute_id": "cpu-cluster", @@ -621,7 +624,9 @@ def sample_pipeline(job_in_file): ) pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "The command node with optional inputs", "tags": {"owner": "sdkteam", "tag": "tagvalue"}, @@ -691,7 +696,9 @@ def sample_pipeline(job_in_file, sample_rate): pipeline.outputs.pipeline_output.mode = InputOutputModes.DIRECT pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "The spark node with optional inputs", "tags": {"owner": "sdkteam", "tag": "tagvalue"}, @@ -764,7 +771,9 @@ def pipeline(job_in_number, job_in_other_number, job_in_path): experiment_name="dsl_exp", ) pipeline_job.settings.force_rerun = False - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "tags": {"owner": "sdkteam", "tag": "tagvalue"}, "description": "The hello world pipeline job", @@ -1727,7 +1736,9 @@ def test_parallel_run_function(self, client: MLClient): pipeline_job = client.create_or_update(pipeline) # submit pipeline job - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "tags": {}, "is_archived": False, @@ -1787,7 +1798,9 @@ def test_parallel_run_function_run_settings_bind_to_literal_input(self, client: pipeline_job = client.create_or_update(pipeline) # submit pipeline job - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "tags": {}, "is_archived": False, @@ -1902,7 +1915,7 @@ def parallel_in_pipeline(job_data_path): "jobs.parallel_node.task.code", "jobs.parallel_node.task.environment", ] + common_omit_fields - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = omit_with_wildcard(as_attribute_dict(pipeline_job._to_rest_object().properties), *omit_fields) expected_job = { "tags": {"owner": "sdkteam", "tag": "tagvalue"}, "description": "The pipeline job with parallel function", @@ -1981,7 +1994,7 @@ def parallel_in_pipeline(job_data_path): "jobs.*.task.code", "jobs.*.task.environment", ] + common_omit_fields - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *omit_fields) + actual_job = omit_with_wildcard(as_attribute_dict(pipeline_job._to_rest_object().properties), *omit_fields) expected_job = { "tags": {}, "is_archived": False, @@ -2079,7 +2092,9 @@ def test_dsl_pipeline_without_setting_binding_node(self, client: MLClient) -> No pipeline = pipeline_without_setting_binding_node() pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "E2E dummy pipeline with components defined via yaml.", "tags": {}, @@ -2124,7 +2139,9 @@ def test_dsl_pipeline_with_only_setting_pipeline_level(self, client: MLClient): pipeline = pipeline_with_only_setting_pipeline_level() pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "E2E dummy pipeline with components defined via yaml.", "tags": {}, @@ -2171,7 +2188,9 @@ def test_dsl_pipeline_with_only_setting_binding_node(self, client: MLClient): pipeline = pipeline_with_only_setting_binding_node() pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "E2E dummy pipeline with components defined via yaml.", "tags": {}, @@ -2228,7 +2247,9 @@ def test_dsl_pipeline_with_setting_binding_node_and_pipeline_level(self, client: pipeline = pipeline_with_setting_binding_node_and_pipeline_level() pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "E2E dummy pipeline with components defined via yaml.", "tags": {}, @@ -2284,7 +2305,9 @@ def test_dsl_pipeline_with_command_builder_setting_binding_node_and_pipeline_lev pipeline = pipeline_with_command_builder_setting_binding_node_and_pipeline_level() pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "E2E dummy pipeline with components defined via yaml.", @@ -2403,7 +2426,9 @@ def pipeline_with_group(group: ParamClass): pipeline_job = pipeline_with_group(default_param) pipeline_job = client.jobs.create_or_update(pipeline_job) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job_inputs = { "group.int_param": {"job_input_type": "literal", "value": "2"}, "group.enum_param": {"job_input_type": "literal", "value": "hello"}, @@ -2603,7 +2628,7 @@ def my_pipeline() -> Outputs: # overwrite group outputs mode will appear in pipeline job&component level expected_outputs = {"output1": {"description": "new description", "type": "uri_folder"}} expected_job_outputs = {"output1": {"description": "new description", "job_output_type": "uri_folder"}} - rest_job_dict = pipeline_job._to_rest_object().as_dict() + rest_job_dict = as_attribute_dict(pipeline_job._to_rest_object()) # assert pipeline job level mode overwrite assert rest_job_dict["properties"]["outputs"] == expected_job_outputs @@ -2611,7 +2636,7 @@ def my_pipeline() -> Outputs: assert pipeline_job.component._to_dict()["outputs"] == expected_outputs rest_job = assert_job_cancel(pipeline_job, client) - rest_job_dict = rest_job._to_rest_object().as_dict() + rest_job_dict = as_attribute_dict(rest_job._to_rest_object()) assert rest_job_dict["properties"]["outputs"]["output1"]["description"] == "new description" component = client.components.create_or_update(pipeline_job.component, _is_anonymous=True) @@ -2637,14 +2662,14 @@ def my_pipeline() -> Outputs: # overwrite group outputs mode will appear in pipeline job&component level expected_job_outputs = {"output1": {"mode": "Upload", "job_output_type": "uri_folder"}} expected_outputs = {"output1": {"mode": "upload", "type": "uri_folder"}} - rest_job_dict = pipeline_job._to_rest_object().as_dict() + rest_job_dict = as_attribute_dict(pipeline_job._to_rest_object()) # assert pipeline job level mode overwrite assert rest_job_dict["properties"]["outputs"] == expected_job_outputs # assert pipeline component level mode overwrite assert pipeline_job.component._to_dict()["outputs"] == expected_outputs rest_job = assert_job_cancel(pipeline_job, client) - rest_job_dict = rest_job._to_rest_object().as_dict() + rest_job_dict = as_attribute_dict(rest_job._to_rest_object()) assert rest_job_dict["properties"]["outputs"] == expected_job_outputs component = client.components.create_or_update(pipeline_job.component, _is_anonymous=True) @@ -2793,7 +2818,9 @@ def test_dsl_pipeline_with_data_transfer_copy_2urifolder(self, client: MLClient) pipeline_job = client.jobs.create_or_update(pipeline) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) expected_job = { "description": "submit a pipeline with data transfer copy job", @@ -3104,7 +3131,9 @@ def pipeline_with_user_defined_nodes_1(): pipeline_job = pipeline_with_user_defined_nodes_1() pipeline_job.settings.default_compute = "cpu-cluster" pipeline_job = assert_job_cancel(pipeline_job, client) - actual_job = omit_with_wildcard(pipeline_job._to_rest_object().properties.as_dict(), *common_omit_fields) + actual_job = omit_with_wildcard( + as_attribute_dict(pipeline_job._to_rest_object().properties), *common_omit_fields + ) assert actual_job["jobs"] == { "another_0": { "inputs": { diff --git a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline_samples.py b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline_samples.py index 93791e8ddb86..fe186f408ce6 100644 --- a/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline_samples.py +++ b/sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline_samples.py @@ -12,6 +12,7 @@ import pytest from devtools_testutils import AzureRecordedTestCase, is_live from test_utilities.utils import _PYTEST_TIMEOUT_METHOD, assert_job_cancel +from azure.core.serialization import as_attribute_dict from azure.ai.ml import MLClient, load_job from azure.ai.ml.entities import Component as ComponentEntity @@ -32,8 +33,8 @@ def assert_job_completed(pipeline, client: MLClient): def assert_dsl_curated(pipeline: PipelineJob, job_yaml, omit_fields): - dsl_pipeline_job_dict = pipeline._to_rest_object().as_dict() - pipeline_job_dict = load_job(source=job_yaml)._to_rest_object().as_dict() + dsl_pipeline_job_dict = as_attribute_dict(pipeline._to_rest_object()) + pipeline_job_dict = as_attribute_dict(load_job(source=job_yaml)._to_rest_object()) dsl_pipeline_job_dict = pydash.omit(dsl_pipeline_job_dict, omit_fields) pipeline_job_dict = pydash.omit(pipeline_job_dict, omit_fields) From 00a6f1eac7d1264fe0397fd4d076935ec2fc086a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 16:08:09 +0530 Subject: [PATCH 122/146] fix(model-package): omit None mountPath and empty tags to match legacy package wire body --- .../_assets/_artifacts/_package/model_configuration.py | 10 ++++++++-- .../_assets/_artifacts/_package/model_package.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py index 14f2eea7eb5c..b165152fbd9b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_configuration.py @@ -41,9 +41,15 @@ def _from_rest_object(cls, rest_obj: Any) -> "ModelConfiguration": def _to_rest_object(self) -> Dict[str, Any]: # ``ModelConfiguration`` was dropped from the arm_ml_service (2025-12) model; build the - # 2023-04 wire body directly as a dict (JSON-direct). + # 2023-04 wire body directly as a dict (JSON-direct). The legacy msrest model omitted ``None`` + # fields on the wire, so only include values that are set. self._validate() - return {"mode": self.mode, "mountPath": self.mount_path} + rest_obj: Dict[str, Any] = {} + if self.mode is not None: + rest_obj["mode"] = self.mode + if self.mount_path is not None: + rest_obj["mountPath"] = self.mount_path + return rest_obj def _validate(self) -> None: if self.mode is not None and self.mode.lower() not in ["copy", "download"]: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py index dd2bbfd53cfd..21debd346247 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py @@ -368,7 +368,7 @@ def _to_rest_object(self) -> Dict[str, Any]: package_request["modelConfiguration"] = self.model_configuration._to_rest_object() if self.inputs: package_request["inputs"] = [model_input._to_rest_object() for model_input in self.inputs] - if self.tags is not None: + if self.tags: package_request["tags"] = self.tags if self.environment_variables is not None: package_request["environmentVariables"] = self.environment_variables From 4a5a72c655ec0634d91b7a60f78ecb267128bcb4 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 16:15:17 +0530 Subject: [PATCH 123/146] fix(resources): normalize camelCase keys in JobResourceConfiguration._from_rest_object (handles arm response + snake dicts) --- .../ml/entities/_job/job_resource_configuration.py | 13 ++++++++++++- .../azure/ai/ml/entities/_job/sweep/sweep_job.py | 9 +-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py index e20d3f998b96..e7a6c33854f8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py @@ -196,7 +196,18 @@ def _from_rest_object( if obj is None: return None if isinstance(obj, dict): - return cls(**obj) + # Node dicts / unit tests provide snake_case keys, while the shared arm_ml_service response carries the + # ``resources`` bag as an untyped camelCase dict (e.g. ``instanceCount``). Normalize the known camelCase + # wire keys to their snake_case constructor kwargs so the value survives either way. + camel_to_snake = { + "instanceCount": "instance_count", + "instanceType": "instance_type", + "maxInstanceCount": "max_instance_count", + "dockerArgs": "docker_args", + "shmSize": "shm_size", + } + normalized = {camel_to_snake.get(key, key): value for key, value in obj.items()} + return cls(**normalized) return JobResourceConfiguration( # ``locations`` is on the v2023_04 msrest model but not the shared arm_ml_service model # (2025-01 path). It is still carried on the wire via dict assignment, so fall back to dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py index 77be6bb7b749..2da644dddfd2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py @@ -395,13 +395,6 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": for param, dist in properties.search_space.items(): _search_space[param] = SweepDistribution._from_rest_object(dist) - # ``resources`` was dropped as a typed field from the shared arm_ml_service SweepJob (2025-01), so the response - # carries it as an untyped camelCase dict. Deserialize into the arm model so ``_from_rest_object`` reads the - # camelCase wire keys (e.g. instanceCount) instead of treating them as snake_case ctor kwargs. - rest_resources = properties.get("resources") - if isinstance(rest_resources, dict): - rest_resources = RestJobResourceConfiguration._deserialize(rest_resources, []) - return SweepJob( name=obj.name, id=obj.id, @@ -426,7 +419,7 @@ def _load_from_rest(cls, obj: JobBase) -> "SweepJob": _BaseJobIdentityConfiguration._from_rest_object(properties.identity) if properties.identity else None ), queue_settings=properties.queue_settings, - resources=JobResourceConfiguration._from_rest_object(rest_resources), + resources=JobResourceConfiguration._from_rest_object(properties.get("resources")), ) def _override_missing_properties_from_trial(self) -> None: From f0937ca7557e46c5dad0e07c6f7d1d56d6e5d198 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 19:00:44 +0530 Subject: [PATCH 124/146] fix(mypy): ensure str keys in JobResourceConfiguration dict normalization --- .../azure/ai/ml/entities/_job/job_resource_configuration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py index e7a6c33854f8..03f28d98c318 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py @@ -206,7 +206,9 @@ def _from_rest_object( "dockerArgs": "docker_args", "shmSize": "shm_size", } - normalized = {camel_to_snake.get(key, key): value for key, value in obj.items()} + normalized: Dict[str, Any] = { + camel_to_snake.get(str(key), str(key)): value for key, value in obj.items() + } return cls(**normalized) return JobResourceConfiguration( # ``locations`` is on the v2023_04 msrest model but not the shared arm_ml_service model From 75ac45058d74729558130a4831f954f5c8b03a6b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Wed, 15 Jul 2026 19:56:30 +0530 Subject: [PATCH 125/146] style: black-format job_resource_configuration.py --- .../azure/ai/ml/entities/_job/job_resource_configuration.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py index 03f28d98c318..1d88893df880 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py @@ -206,9 +206,7 @@ def _from_rest_object( "dockerArgs": "docker_args", "shmSize": "shm_size", } - normalized: Dict[str, Any] = { - camel_to_snake.get(str(key), str(key)): value for key, value in obj.items() - } + normalized: Dict[str, Any] = {camel_to_snake.get(str(key), str(key)): value for key, value in obj.items()} return cls(**normalized) return JobResourceConfiguration( # ``locations`` is on the v2023_04 msrest model but not the shared arm_ml_service model From a278bdf2b7c0728678bb8e3b8f6dbcd0be1e630e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 16 Jul 2026 10:28:27 +0530 Subject: [PATCH 126/146] fix(test): give build_data_asset_uri a str return so mount test doesn't OOM test_mount_persistent patched build_data_asset_uri as a bare Mock. The migrated mount() now JSON-encodes the uri into an HttpRequest body via SdkJSONEncoder, which recurses unboundedly on a Mock -> OOM/SIGKILL in CI (Build Test 3.10). Return a real str (production always returns str) so the body serializes. --- .../tests/dataset/unittests/test_data_operations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py index e2f950f2d867..673489569475 100644 --- a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py +++ b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py @@ -587,6 +587,10 @@ def test_mount_persistent( with patch("uuid.uuid4", return_value="random_uuid"), patch( "azureml.dataprep.rslex_fuse_subprocess_wrapper.build_data_asset_uri" ) as mock_build_uri, patch.dict(os.environ, {"CI_NAME": "random_ci"}): + # build_data_asset_uri returns a str in production; the mount request now JSON-encodes this + # value into the HttpRequest body, so the mock must return a real string (a bare Mock would be + # fed to SdkJSONEncoder and recurse unboundedly). + mock_build_uri.return_value = "azureml://datastores/workspaceblobstore/paths/random_name/random_version" mock_data_operations.mount( path="azureml:random_name:random_version", mount_point="/tmp/mount/random-local-path-for-data/", From 6910301bca1328588e9c72f6aac6bdbb01426a92 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 16 Jul 2026 10:37:24 +0530 Subject: [PATCH 127/146] fix(test): give build_datastore_uri a str return so datastore mount test doesn't OOM Twin of the data mount fix: migrated DatastoreOperations.mount() JSON-encodes the uri into an HttpRequest body; a bare Mock uri recurses in SdkJSONEncoder -> OOM. Pre-empts the next Build Test 3.10 OOM (datastore sorts after dataset). --- .../tests/datastore/unittests/test_datastore_operations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py index 373e7d2a6c58..b7cd643b6513 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py @@ -121,6 +121,10 @@ def test_mount_persistent( with patch("uuid.uuid4", return_value="random_uuid"), patch( "azureml.dataprep.rslex_fuse_subprocess_wrapper.build_datastore_uri" ) as mock_build_uri, patch.dict(os.environ, {"CI_NAME": "random_ci"}): + # build_datastore_uri returns a str in production; the mount request now JSON-encodes this value + # into the HttpRequest body, so the mock must return a real string (a bare Mock would be fed to + # SdkJSONEncoder and recurse unboundedly). + mock_build_uri.return_value = "azureml://datastores/random_name/paths/random" mock_datastore_operation.mount( path="azureml://datastores/random_name", mount_point="/tmp/mount/random-local-path-for-datastore/", From 83cf427765029f40210a208b2f7b0774d699f9d6 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 16 Jul 2026 12:24:42 +0530 Subject: [PATCH 128/146] fix(jobs): strip None-valued fields from job PUT body to match msrest wire The arm_ml_service hybrid SdkJSONEncoder serializes present-but-None fields as explicit JSON null, whereas the msrest clients it replaced omitted them. On the local-run re-submit (which re-PUTs a previously fetched job), the round-tripped body carried 22 null keys never sent on the wire before, breaking test_command_job_local playback. Serialize + strip None recursively so the wire stays byte-identical. --- .../azure/ai/ml/operations/_job_operations.py | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index 5bd1ae962184..fe69d6abf963 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -24,6 +24,7 @@ ) from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022023Preview +from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType from azure.ai.ml._restclient.arm_ml_service.models import ListViewType @@ -146,6 +147,26 @@ _FINE_TUNING_JOB_TYPE = "FineTuning" +def _strip_none_values(obj: Any) -> None: + """Recursively remove keys whose value is ``None`` from a JSON-like structure in place. + + The arm_ml_service hybrid models serialize present-but-``None`` fields as explicit JSON + ``null``, whereas the msrest clients they replaced omitted such fields entirely. Stripping + ``None`` values reproduces the msrest wire so re-PUT bodies remain byte-identical. + + :param obj: A JSON-like structure (``dict``/``list``) to prune in place. + :type obj: Any + """ + if isinstance(obj, dict): + for key in [k for k, v in obj.items() if v is None]: + del obj[key] + for value in obj.values(): + _strip_none_values(value) + elif isinstance(obj, list): + for item in obj: + _strip_none_values(item) + + class JobOperations(_ScopeDependentOperations): """Initiates an instance of JobOperations @@ -835,11 +856,19 @@ def _create_or_update_with_different_version_api(self, rest_job_resource: JobBas if rest_job_resource.properties.job_type == RestJobType.COMMAND: service_client_operation = self.service_client_01_2025_preview.jobs + # The migrated arm_ml_service models serialize present-but-None fields as + # explicit JSON ``null`` whereas the previous msrest clients omitted them. + # For round-tripped bodies (e.g. the local-run re-submit that re-PUTs a + # previously fetched job) this would emit ``null`` keys that were never on + # the wire before. Serialize and drop None values to keep the wire identical. + body = json.loads(json.dumps(rest_job_resource, cls=SdkJSONEncoder, exclude_readonly=True)) + _strip_none_values(body) + result = service_client_operation.create_or_update( id=rest_job_resource.name, resource_group_name=self._operation_scope.resource_group_name, workspace_name=self._workspace_name, - body=rest_job_resource, + body=body, **kwargs, ) From bb634e6cc27bc680ae83405a78d5405139619b0e Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 16 Jul 2026 15:27:43 +0530 Subject: [PATCH 129/146] fix(jobs): only strip None from local-run re-PUT body, not fresh creates The previous commit eagerly serialized every job create body, which crashed when the body contained an unresolved entity (e.g. an inline Environment) since the mocked/real client had not serialized it yet. Gate the serialize+strip-None behind strip_none_body, used only by the local-run re-submit whose body is a fully-resolved server response. Fresh creates pass the model unchanged as before. --- .../azure/ai/ml/operations/_job_operations.py | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index fe69d6abf963..57ca5699adec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -839,11 +839,15 @@ def create_or_update( # pylint: disable=too-many-branches if snapshot_id is not None: job_object.properties.properties["ContentSnapshotId"] = snapshot_id - result = self._create_or_update_with_different_version_api(rest_job_resource=job_object, **kwargs) + result = self._create_or_update_with_different_version_api( + rest_job_resource=job_object, strip_none_body=True, **kwargs + ) return self._resolve_azureml_id(Job._from_rest_object(result)) - def _create_or_update_with_different_version_api(self, rest_job_resource: JobBase, **kwargs: Any) -> JobBase: + def _create_or_update_with_different_version_api( + self, rest_job_resource: JobBase, strip_none_body: bool = False, **kwargs: Any + ) -> JobBase: service_client_operation = self._operation_2023_02_preview if rest_job_resource.properties.job_type == _FINE_TUNING_JOB_TYPE: service_client_operation = self.service_client_10_2024_preview.jobs @@ -856,13 +860,17 @@ def _create_or_update_with_different_version_api(self, rest_job_resource: JobBas if rest_job_resource.properties.job_type == RestJobType.COMMAND: service_client_operation = self.service_client_01_2025_preview.jobs - # The migrated arm_ml_service models serialize present-but-None fields as - # explicit JSON ``null`` whereas the previous msrest clients omitted them. - # For round-tripped bodies (e.g. the local-run re-submit that re-PUTs a - # previously fetched job) this would emit ``null`` keys that were never on - # the wire before. Serialize and drop None values to keep the wire identical. - body = json.loads(json.dumps(rest_job_resource, cls=SdkJSONEncoder, exclude_readonly=True)) - _strip_none_values(body) + # ``body`` is normally the arm model, which the client serializes on send. + # For round-tripped bodies (the local-run re-submit that re-PUTs a previously + # fetched, fully-resolved job) the migrated arm SdkJSONEncoder emits + # present-but-None fields as explicit JSON ``null`` whereas the msrest client + # it replaced omitted them. In that case only, pre-serialize and drop None + # values so the wire stays byte-identical. The fresh-create path keeps passing + # the model unchanged (it may contain unresolved entities not yet wire-ready). + body: Any = rest_job_resource + if strip_none_body: + body = json.loads(json.dumps(rest_job_resource, cls=SdkJSONEncoder, exclude_readonly=True)) + _strip_none_values(body) result = service_client_operation.create_or_update( id=rest_job_resource.name, From 3be248f4e990f08ab25a495156550753fd4965e8 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 21 Jul 2026 14:09:36 +0530 Subject: [PATCH 130/146] chore: remove leftover _tmp_inspect.py debug scratch file --- sdk/ml/azure-ai-ml/_tmp_inspect.py | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/_tmp_inspect.py diff --git a/sdk/ml/azure-ai-ml/_tmp_inspect.py b/sdk/ml/azure-ai-ml/_tmp_inspect.py deleted file mode 100644 index ff2b9067adfa..000000000000 --- a/sdk/ml/azure-ai-ml/_tmp_inspect.py +++ /dev/null @@ -1,4 +0,0 @@ -import inspect -import azure.ai.ml._restclient.v2023_08_01_preview.operations as o - -print(inspect.getsource(o.ModelVersionsOperations._package_initial)) From d11398a4eaa741574e47f498e03fb72867f25227 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Tue, 21 Jul 2026 15:10:43 +0530 Subject: [PATCH 131/146] test(smoke): add model_package, connection, deployment + round-trip wire coverage Extends the offline golden-wire smoke suite (baseline 48c329c3f3, released 1.34.0) with: model_package and workspace-connection write-path wire equivalence; a branch-only deployment serialization guard (baseline can't serialize the pre-migration mixed tree offline); and a new read-path round-trip layer (entity->rest->entity->rest vs baseline) covering datastores, connections, computes, automl, sweep, workspace, registry, schedule. Documents two benign findings: ModelPackage now honors tags (latent bug-fix via dropping the PackageRequest base) and 4 arm-vs-msrest deserialization-default round-trip diffs. --- .../_builders_connection.py | 85 +++++++++++++ .../_builders_deployment.py | 118 ++++++++++++++++++ .../_builders_model_package.py | 71 +++++++++++ .../connection_azure_ai_search.json | 12 ++ .../connection_azure_ai_services.json | 14 +++ .../connection_azure_blob_store.json | 15 +++ .../connection_azure_open_ai_api_key.json | 16 +++ .../connection_azure_open_ai_entra.json | 13 ++ .../model_package_batch_minimal.json | 6 + .../expected_wire/model_package_online.json | 33 +++++ .../roundtrip_adls_gen1_datastore.json | 19 +++ .../roundtrip_adls_gen2_datastore.json | 20 +++ .../roundtrip_automl_forecasting.json | 42 +++++++ ...roundtrip_automl_image_classification.json | 30 +++++ .../roundtrip_automl_text_classification.json | 30 +++++ .../roundtrip_automl_text_ner.json | 28 +++++ .../roundtrip_blob_datastore_account_key.json | 20 +++ .../roundtrip_blob_datastore_sas.json | 17 +++ .../roundtrip_command_component.json | 49 ++++++++ .../roundtrip_compute_instance_full.json | 38 ++++++ .../roundtrip_compute_instance_minimal.json | 16 +++ .../roundtrip_connection_azure_ai_search.json | 12 ++ ...oundtrip_connection_azure_ai_services.json | 14 +++ ...roundtrip_connection_azure_blob_store.json | 15 +++ ...trip_connection_azure_open_ai_api_key.json | 16 +++ ...ndtrip_connection_azure_open_ai_entra.json | 13 ++ .../roundtrip_data_import_database.json | 17 +++ .../roundtrip_file_datastore.json | 19 +++ ...undtrip_import_data_schedule_database.json | 31 +++++ ...trip_import_data_schedule_file_system.json | 43 +++++++ .../roundtrip_kubernetes_compute_full.json | 14 +++ .../roundtrip_one_lake_datastore.json | 22 ++++ .../roundtrip_registry_full.json | 22 ++++ .../roundtrip_schedule_pipeline.json | 43 +++++++ .../roundtrip_sweep_job_median_policy.json | 45 +++++++ ...roundtrip_sweep_job_truncation_policy.json | 58 +++++++++ ...oundtrip_virtual_machine_compute_full.json | 17 +++ .../roundtrip_workspace_minimal.json | 9 ++ .../test_connection_wire.py | 25 ++++ .../test_deployment_wire.py | 33 +++++ .../test_model_package_wire.py | 25 ++++ .../test_roundtrip_wire.py | 112 +++++++++++++++++ 42 files changed, 1297 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_deployment.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_model_package.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_search.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_services.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_blob_store.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_api_key.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_entra.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_batch_minimal.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_online.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen1_datastore.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen2_datastore.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_forecasting.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_image_classification.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_classification.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_ner.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_account_key.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_sas.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_command_component.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_full.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_minimal.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_search.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_services.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_blob_store.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_api_key.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_entra.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_file_datastore.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_database.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_file_system.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_kubernetes_compute_full.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_one_lake_datastore.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_registry_full.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_schedule_pipeline.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_median_policy.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_truncation_policy.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_virtual_machine_compute_full.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_minimal.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_connection_wire.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_deployment_wire.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_model_package_wire.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_roundtrip_wire.py diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py new file mode 100644 index 000000000000..721981bd3abe --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py @@ -0,0 +1,85 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for workspace-connection entities (smoke serialization suite). + +Connections were migrated off the v2024_04 msrest client: ``ConnectionCategory`` / ``ConnectionAuthType`` +enums now come from ``arm_ml_service`` and ``WorkspaceConnection._to_rest_object()`` returns an +``arm_ml_service`` hybrid ``RestWorkspaceConnection`` (was a v2024_04 msrest model). The auth-type and +category enum VALUES must stay byte-identical on the wire, so these builders pin the exact request body +for the common connection subtypes across the client swap. + +``_to_rest_object()`` is a no-arg method returning the rest model, matching the suite's uniform contract. +""" +from azure.ai.ml.entities import ( + AzureOpenAIConnection, + AzureAISearchConnection, + AzureAIServicesConnection, +) +from azure.ai.ml.entities._credentials import AccountKeyConfiguration +from azure.ai.ml.entities._workspace.connections.connection_subtypes import AzureBlobStoreConnection + + +def build_azure_open_ai_connection_api_key(): + """AzureOpenAIConnection authenticated with an API key.""" + return AzureOpenAIConnection( + name="smoke-aoai-conn", + azure_endpoint="https://smoke-aoai.openai.azure.com/", + api_key="smoke-aoai-api-key", + api_version="2024-02-01", + open_ai_resource_id=( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg" + "/providers/Microsoft.CognitiveServices/accounts/smoke-aoai" + ), + ) + + +def build_azure_open_ai_connection_entra(): + """AzureOpenAIConnection with no API key (Entra ID / AAD auth).""" + return AzureOpenAIConnection( + name="smoke-aoai-conn-entra", + azure_endpoint="https://smoke-aoai-entra.openai.azure.com/", + api_version="2024-02-01", + ) + + +def build_azure_ai_search_connection(): + """AzureAISearchConnection authenticated with an API key.""" + return AzureAISearchConnection( + name="smoke-search-conn", + endpoint="https://smoke-search.search.windows.net/", + api_key="smoke-search-api-key", + ) + + +def build_azure_ai_services_connection(): + """AzureAIServicesConnection authenticated with an API key.""" + return AzureAIServicesConnection( + name="smoke-aiservices-conn", + endpoint="https://smoke-aiservices.cognitiveservices.azure.com/", + api_key="smoke-aiservices-api-key", + ai_services_resource_id=( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg" + "/providers/Microsoft.CognitiveServices/accounts/smoke-aiservices" + ), + ) + + +def build_azure_blob_store_connection(): + """AzureBlobStoreConnection authenticated with an account key.""" + return AzureBlobStoreConnection( + name="smoke-blob-conn", + url="https://smokeaccount.blob.core.windows.net/smoke-container", + container_name="smoke-container", + account_name="smokeaccount", + credentials=AccountKeyConfiguration(account_key="smoke-account-key"), + ) + + +CONNECTION_BUILDERS = { + "connection_azure_open_ai_api_key": build_azure_open_ai_connection_api_key, + "connection_azure_open_ai_entra": build_azure_open_ai_connection_entra, + "connection_azure_ai_search": build_azure_ai_search_connection, + "connection_azure_ai_services": build_azure_ai_services_connection, + "connection_azure_blob_store": build_azure_blob_store_connection, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_deployment.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_deployment.py new file mode 100644 index 000000000000..a7b79fad1e21 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_deployment.py @@ -0,0 +1,118 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for online/batch DEPLOYMENT entities (smoke serialization suite). + +Deployments serialize via a location-bound ``_to_rest_object(location)`` returning a rest deployment +model, so each builder returns a ``_RestAdapter`` exposing the suite's uniform no-arg +``_to_rest_object()`` contract (same pattern as ``_builders_endpoint.py``). + +Deployments were the trickiest part of the client migration: pre-#47554 the online/batch deployment +envelope was a per-version msrest model while nested children (probes, scale settings) were already +``arm_ml_service`` hybrids -- a mixed tree the operations layer resolved at send time. That mixed tree +means the PRE-MIGRATION baseline cannot serialize a deployment offline at all (msrest ``.serialize()`` +raises ``'ProbeSettings' has no _attribute_map``), so there is no baseline wire to pin against. The +migration unifies the whole tree on ``arm_ml_service``, so the branch now DOES serialize cleanly -- +which is exactly what these builders assert via a serialization guard (``test_deployment_wire.py``). + +Because no baseline golden is possible, these registries are named ``*_CASES`` (not ``*_BUILDERS``) so +the baseline capture in ``regenerate_expected_wire.py`` and the round-trip discovery do NOT pick them +up; the deployment test references them directly. +""" +from azure.ai.ml.entities import ( + BatchRetrySettings, + CodeConfiguration, + DefaultScaleSettings, + ManagedOnlineDeployment, + ModelBatchDeployment, + ModelBatchDeploymentSettings, + OnlineRequestSettings, + ProbeSettings, +) + +_LOCATION = "westus" + + +class _RestAdapter: + """Expose a location-bound rest method as the suite's no-arg ``_to_rest_object()`` contract. + + :param entity: The deployment entity. + :param location: The location string to pass to ``_to_rest_object``. + """ + + def __init__(self, entity, location=_LOCATION): + self._entity = entity + self._location = location + + def _to_rest_object(self): + """Call the entity's location-taking rest method with the fixed location. + + :return: The rest object for the deployment. + :rtype: Any + """ + return self._entity._to_rest_object(location=self._location) + + +def build_managed_online_deployment(): + """ManagedOnlineDeployment with model, env, code, scale/request settings and probes.""" + deployment = ManagedOnlineDeployment( + name="smoke-blue", + endpoint_name="smoke-online-endpoint", + description="smoke managed online deployment", + model="azureml:smoke-model:1", + environment="azureml:smoke-env:1", + code_configuration=CodeConfiguration(code="azureml:smoke-code:1", scoring_script="score.py"), + instance_type="Standard_DS2_v2", + instance_count=2, + app_insights_enabled=True, + scale_settings=DefaultScaleSettings(), + request_settings=OnlineRequestSettings( + request_timeout_ms=3000, + max_concurrent_requests_per_instance=1, + max_queue_wait_ms=500, + ), + liveness_probe=ProbeSettings( + failure_threshold=30, + success_threshold=1, + timeout=2, + period=10, + initial_delay=10, + ), + environment_variables={"WORKER_COUNT": "1"}, + tags={"tag1": "value1"}, + ) + return _RestAdapter(deployment) + + +def build_model_batch_deployment(): + """ModelBatchDeployment with model, env, compute and batch settings.""" + deployment = ModelBatchDeployment( + name="smoke-batch-dep", + endpoint_name="smoke-batch-endpoint", + description="smoke model batch deployment", + model="azureml:smoke-model:1", + environment="azureml:smoke-env:1", + compute="azureml:smoke-cluster", + code_configuration=CodeConfiguration(code="azureml:smoke-code:1", scoring_script="score.py"), + settings=ModelBatchDeploymentSettings( + instance_count=2, + max_concurrency_per_instance=1, + mini_batch_size=10, + output_action="append_row", + output_file_name="predictions.csv", + retry_settings=BatchRetrySettings(max_retries=3, timeout=30), + error_threshold=-1, + logging_level="info", + ), + tags={"tag1": "value1"}, + ) + return _RestAdapter(deployment) + + +ONLINE_DEPLOYMENT_CASES = { + "managed_online_deployment": build_managed_online_deployment, +} + +BATCH_DEPLOYMENT_CASES = { + "model_batch_deployment": build_model_batch_deployment, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_model_package.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_model_package.py new file mode 100644 index 000000000000..b08701736dca --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_model_package.py @@ -0,0 +1,71 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for model-package entities (smoke serialization suite). + +``ModelPackage`` is the ``@experimental`` model-packaging request entity. The migration rewrote this +tree off the msrest ``PackageRequest`` base class (``ModelPackage(Resource, PackageRequest)`` -> +``ModelPackage(Resource)``) so that ``_to_rest_object()`` now hand-builds the camelCase wire ``dict`` +directly instead of relying on msrest ``.serialize()``. That makes it exactly the kind of entity whose +wire must be pinned byte-for-byte against the pre-migration baseline. + +``_to_rest_object()`` here already returns a plain ``dict`` (both on baseline via msrest +``.serialize()`` and on the branch via the hand-built dict), which ``serialize_wire`` handles. + +NOTE: ``tags`` are intentionally NOT set on these builders. Pre-migration, ``ModelPackage(Resource, +PackageRequest)`` silently swallowed the ``tags`` kwarg through its diamond MRO (``entity.tags`` stayed +``None``), so tags were never sent. The migration's ``ModelPackage(Resource)`` now honors ``tags`` -- a +latent bug-fix, not a wire regression -- but it does change the wire *when* tags are set. These +builders pin the substantive package wire (which is preserved byte-for-byte); the tags behaviour +change is deliberately excluded so the guard stays focused on real wire preservation. +""" +from azure.ai.ml.entities import CodeConfiguration +from azure.ai.ml.entities._assets._artifacts._package.base_environment_source import BaseEnvironment +from azure.ai.ml.entities._assets._artifacts._package.inferencing_server import ( + AzureMLBatchInferencingServer, + AzureMLOnlineInferencingServer, +) +from azure.ai.ml.entities._assets._artifacts._package.model_configuration import ModelConfiguration +from azure.ai.ml.entities._assets._artifacts._package.model_package import ( + ModelPackage, + ModelPackageInput, + PackageInputPathId, +) + + +def build_model_package_online(): + """ModelPackage with an AzureML online inferencing server, base env, model config and inputs.""" + return ModelPackage( + target_environment="azureml:smoke-packaged-env:3", + base_environment_source=BaseEnvironment( + type="EnvironmentAsset", + resource_id="azureml:smoke-base-env:1", + ), + inferencing_server=AzureMLOnlineInferencingServer( + code_configuration=CodeConfiguration(code="azureml:smoke-code:1", scoring_script="score.py"), + ), + model_configuration=ModelConfiguration(mode="download", mount_path="/var/azureml-model"), + inputs=[ + ModelPackageInput( + type="uri_folder", + path=PackageInputPathId(resource_id="azureml:smoke-model:1"), + mode="download", + mount_path="/var/inputs/model", + ), + ], + environment_variables={"WORKER_COUNT": "2", "LOG_LEVEL": "INFO"}, + ) + + +def build_model_package_batch_minimal(): + """Minimal ModelPackage with an AzureML batch inferencing server and no optional children.""" + return ModelPackage( + target_environment="smoke-batch-packaged-env", + inferencing_server=AzureMLBatchInferencingServer(), + ) + + +MODEL_PACKAGE_BUILDERS = { + "model_package_online": build_model_package_online, + "model_package_batch_minimal": build_model_package_batch_minimal, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_search.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_search.json new file mode 100644 index 000000000000..319e1135e02c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_search.json @@ -0,0 +1,12 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "CognitiveSearch", + "credentials": { + "key": "smoke-search-api-key" + }, + "isSharedToAll": true, + "metadata": {}, + "target": "https://smoke-search.search.windows.net/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_services.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_services.json new file mode 100644 index 000000000000..40a0741d67a0 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_ai_services.json @@ -0,0 +1,14 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "AIServices", + "credentials": { + "key": "smoke-aiservices-api-key" + }, + "isSharedToAll": true, + "metadata": { + "ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.CognitiveServices/accounts/smoke-aiservices" + }, + "target": "https://smoke-aiservices.cognitiveservices.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_blob_store.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_blob_store.json new file mode 100644 index 000000000000..3dafa8f37629 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_blob_store.json @@ -0,0 +1,15 @@ +{ + "properties": { + "authType": "AccountKey", + "category": "AzureBlob", + "credentials": { + "sas": "smoke-account-key" + }, + "isSharedToAll": true, + "metadata": { + "AccountName": "smokeaccount", + "ContainerName": "smoke-container" + }, + "target": "https://smokeaccount.blob.core.windows.net/smoke-container" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_api_key.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_api_key.json new file mode 100644 index 000000000000..a9a197cc045e --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_api_key.json @@ -0,0 +1,16 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "AzureOpenAi", + "credentials": { + "key": "smoke-aoai-api-key" + }, + "isSharedToAll": true, + "metadata": { + "ApiType": "Azure", + "ApiVersion": "2024-02-01", + "ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.CognitiveServices/accounts/smoke-aoai" + }, + "target": "https://smoke-aoai.openai.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_entra.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_entra.json new file mode 100644 index 000000000000..bbe35c3a40ab --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_azure_open_ai_entra.json @@ -0,0 +1,13 @@ +{ + "properties": { + "authType": "AAD", + "category": "AzureOpenAi", + "isSharedToAll": true, + "metadata": { + "ApiType": "Azure", + "ApiVersion": "2024-02-01", + "ResourceId": null + }, + "target": "https://smoke-aoai-entra.openai.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_batch_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_batch_minimal.json new file mode 100644 index 000000000000..86730cba4dce --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_batch_minimal.json @@ -0,0 +1,6 @@ +{ + "inferencingServer": { + "serverType": "AzureMLBatch" + }, + "targetEnvironmentId": "smoke-batch-packaged-env" +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_online.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_online.json new file mode 100644 index 000000000000..dcd537344c55 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_package_online.json @@ -0,0 +1,33 @@ +{ + "baseEnvironmentSource": { + "baseEnvironmentSourceType": "EnvironmentAsset", + "resourceId": "azureml:smoke-base-env:1" + }, + "environmentVariables": { + "LOG_LEVEL": "INFO", + "WORKER_COUNT": "2" + }, + "inferencingServer": { + "codeConfiguration": { + "codeId": "azureml:smoke-code:1", + "scoringScript": "score.py" + }, + "serverType": "AzureMLOnline" + }, + "inputs": [ + { + "inputType": "UriFolder", + "mode": "Download", + "mountPath": "/var/inputs/model", + "path": { + "inputPathType": "PathId", + "resourceId": "azureml:smoke-model:1" + } + } + ], + "modelConfiguration": { + "mode": "download", + "mountPath": "/var/azureml-model" + }, + "targetEnvironmentId": "azureml:smoke-packaged-env:3" +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen1_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen1_datastore.json new file mode 100644 index 000000000000..0826d304b60c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen1_datastore.json @@ -0,0 +1,19 @@ +{ + "properties": { + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "ServicePrincipal", + "secrets": { + "clientSecret": "smoke-secret", + "secretsType": "ServicePrincipal" + }, + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "datastoreType": "AzureDataLakeGen1", + "storeName": "smoke-store", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen2_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen2_datastore.json new file mode 100644 index 000000000000..16449150fc66 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_adls_gen2_datastore.json @@ -0,0 +1,20 @@ +{ + "properties": { + "accountName": "smokeaccount", + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "ServicePrincipal", + "secrets": { + "clientSecret": "smoke-secret", + "secretsType": "ServicePrincipal" + }, + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "datastoreType": "AzureDataLakeGen2", + "endpoint": "core.windows.net", + "filesystem": "smoke-filesystem", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_forecasting.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_forecasting.json new file mode 100644 index 000000000000..de63de5ae955 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_forecasting.json @@ -0,0 +1,42 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "forecastingSettings": { + "forecastHorizon": { + "mode": "Custom", + "value": 12 + }, + "timeColumnName": "timestamp" + }, + "limitSettings": { + "maxConcurrentTrials": 2, + "maxTrials": 10, + "sweepConcurrentTrials": 0, + "sweepTrials": 0, + "timeout": "PT1H" + }, + "logVerbosity": "Info", + "primaryMetric": "NormalizedRootMeanSquaredError", + "targetColumnName": "target", + "taskType": "Forecasting", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "trainingSettings": { + "enableStackEnsemble": false + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_image_classification.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_image_classification.json new file mode 100644 index 000000000000..d85cf8e81a54 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_image_classification.json @@ -0,0 +1,30 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 1, + "maxTrials": 2, + "timeout": "PT1H" + }, + "logVerbosity": "Info", + "primaryMetric": "Accuracy", + "targetColumnName": "label", + "taskType": "ImageClassification", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_classification.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_classification.json new file mode 100644 index 000000000000..71537639322a --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_classification.json @@ -0,0 +1,30 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 1, + "maxNodes": 1, + "maxTrials": 2, + "timeout": "PT1H" + }, + "primaryMetric": "Accuracy", + "targetColumnName": "target", + "taskType": "TextClassification", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_ner.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_ner.json new file mode 100644 index 000000000000..18cf29af28e6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_automl_text_ner.json @@ -0,0 +1,28 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 1, + "maxNodes": 1, + "maxTrials": 2, + "timeout": "PT1H" + }, + "taskType": "TextNER", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_account_key.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_account_key.json new file mode 100644 index 000000000000..2567503c0526 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_account_key.json @@ -0,0 +1,20 @@ +{ + "properties": { + "accountName": "smokeaccount", + "containerName": "smoke-container", + "credentials": { + "credentialsType": "AccountKey", + "secrets": { + "key": "smoke-account-key", + "secretsType": "AccountKey" + } + }, + "datastoreType": "AzureBlob", + "description": "smoke blob datastore", + "endpoint": "core.windows.net", + "protocol": "https", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_sas.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_sas.json new file mode 100644 index 000000000000..11bed5645f70 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_sas.json @@ -0,0 +1,17 @@ +{ + "properties": { + "accountName": "smokeaccount", + "containerName": "smoke-container", + "credentials": { + "credentialsType": "Sas", + "secrets": { + "sasToken": "?sv=smoke-sas-token", + "secretsType": "Sas" + } + }, + "datastoreType": "AzureBlob", + "endpoint": "core.windows.net", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_command_component.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_command_component.json new file mode 100644 index 000000000000..82a21078a832 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_command_component.json @@ -0,0 +1,49 @@ +{ + "properties": { + "componentSpec": { + "_source": "CLASS", + "command": "echo ${{inputs.learning_rate}} ${{inputs.data}} && echo ${{outputs.model}}", + "description": "smoke command component", + "display_name": "smoke command component", + "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "inputs": { + "data": { + "type": "uri_folder" + }, + "epochs": { + "default": "10", + "type": "integer" + }, + "flag": { + "default": "True", + "type": "boolean" + }, + "learning_rate": { + "default": "0.01", + "type": "number" + } + }, + "is_deterministic": true, + "name": "smoke_command_component", + "outputs": { + "model": { + "type": "uri_folder" + } + }, + "tags": { + "tag1": "value1" + }, + "type": "command", + "version": "1" + }, + "description": "smoke command component", + "isAnonymous": false, + "isArchived": false, + "properties": { + "client_component_hash": "9b70ca37-beee-f8b9-277e-8bf14a5eedd6" + }, + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_full.json new file mode 100644 index 000000000000..f7ec0e220346 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_full.json @@ -0,0 +1,38 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "computeType": "ComputeInstance", + "description": "smoke compute instance", + "disableLocalAuth": false, + "properties": { + "applicationSharingPolicy": "Shared", + "computeInstanceAuthorizationType": "personal", + "enableNodePublicIp": true, + "enableOSPatching": false, + "enableRootAccess": true, + "enableSSO": true, + "idleTimeBeforeShutdown": "PT30M", + "releaseQuotaOnStop": false, + "setupScripts": { + "scripts": { + "startupScript": { + "scriptArguments": "bash setup.sh", + "scriptData": "setup.sh", + "scriptSource": "workspaceStorage", + "timeout": "10m" + } + } + }, + "sshSettings": { + "adminPublicKey": "ssh-rsa AAAAB3Nz smoke", + "sshPublicAccess": "Enabled" + }, + "vmSize": "STANDARD_DS3_V2" + } + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_minimal.json new file mode 100644 index 000000000000..bfdfede3c61b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_compute_instance_minimal.json @@ -0,0 +1,16 @@ +{ + "properties": { + "computeType": "ComputeInstance", + "disableLocalAuth": true, + "properties": { + "applicationSharingPolicy": "Shared", + "computeInstanceAuthorizationType": "personal", + "enableNodePublicIp": true, + "enableOSPatching": false, + "enableRootAccess": true, + "enableSSO": true, + "releaseQuotaOnStop": false, + "vmSize": "STANDARD_DS3_V2" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_search.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_search.json new file mode 100644 index 000000000000..319e1135e02c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_search.json @@ -0,0 +1,12 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "CognitiveSearch", + "credentials": { + "key": "smoke-search-api-key" + }, + "isSharedToAll": true, + "metadata": {}, + "target": "https://smoke-search.search.windows.net/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_services.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_services.json new file mode 100644 index 000000000000..40a0741d67a0 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_ai_services.json @@ -0,0 +1,14 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "AIServices", + "credentials": { + "key": "smoke-aiservices-api-key" + }, + "isSharedToAll": true, + "metadata": { + "ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.CognitiveServices/accounts/smoke-aiservices" + }, + "target": "https://smoke-aiservices.cognitiveservices.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_blob_store.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_blob_store.json new file mode 100644 index 000000000000..3dafa8f37629 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_blob_store.json @@ -0,0 +1,15 @@ +{ + "properties": { + "authType": "AccountKey", + "category": "AzureBlob", + "credentials": { + "sas": "smoke-account-key" + }, + "isSharedToAll": true, + "metadata": { + "AccountName": "smokeaccount", + "ContainerName": "smoke-container" + }, + "target": "https://smokeaccount.blob.core.windows.net/smoke-container" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_api_key.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_api_key.json new file mode 100644 index 000000000000..a9a197cc045e --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_api_key.json @@ -0,0 +1,16 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "AzureOpenAi", + "credentials": { + "key": "smoke-aoai-api-key" + }, + "isSharedToAll": true, + "metadata": { + "ApiType": "Azure", + "ApiVersion": "2024-02-01", + "ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.CognitiveServices/accounts/smoke-aoai" + }, + "target": "https://smoke-aoai.openai.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_entra.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_entra.json new file mode 100644 index 000000000000..bbe35c3a40ab --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_azure_open_ai_entra.json @@ -0,0 +1,13 @@ +{ + "properties": { + "authType": "AAD", + "category": "AzureOpenAi", + "isSharedToAll": true, + "metadata": { + "ApiType": "Azure", + "ApiVersion": "2024-02-01", + "ResourceId": null + }, + "target": "https://smoke-aoai-entra.openai.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database.json new file mode 100644 index 000000000000..73108e1d65ab --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database.json @@ -0,0 +1,17 @@ +{ + "assetName": "smoke-data-import", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke/imported/", + "description": "smoke data import", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:my_connection", + "query": "SELECT * FROM my_table", + "sourceType": "database" + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_file_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_file_datastore.json new file mode 100644 index 000000000000..2f04733aed1c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_file_datastore.json @@ -0,0 +1,19 @@ +{ + "properties": { + "accountName": "smokeaccount", + "credentials": { + "credentialsType": "AccountKey", + "secrets": { + "key": "smoke-account-key", + "secretsType": "AccountKey" + } + }, + "datastoreType": "AzureFile", + "endpoint": "core.windows.net", + "fileShareName": "smoke-share", + "protocol": "https", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_database.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_database.json new file mode 100644 index 000000000000..bc0a39dfe539 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_database.json @@ -0,0 +1,31 @@ +{ + "properties": { + "action": { + "actionType": "ImportData", + "dataImportDefinition": { + "assetName": "smoke-azuresqldb-asset", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/{name}", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke_connection", + "query": "select * from region", + "sourceType": "database" + }, + "tags": {} + } + }, + "displayName": "smoke-import-schedule-db-display", + "properties": {}, + "tags": {}, + "trigger": { + "endTime": "2026-12-31T00:00:00", + "expression": "15 10 * * 1", + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Cron" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_file_system.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_file_system.json new file mode 100644 index 000000000000..c8d9710c4753 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_import_data_schedule_file_system.json @@ -0,0 +1,43 @@ +{ + "properties": { + "action": { + "actionType": "ImportData", + "dataImportDefinition": { + "assetName": "smoke-s3-asset", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/{name}", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke_s3_connection", + "path": "test1/*", + "sourceType": "file_system" + }, + "tags": {} + } + }, + "displayName": "smoke-import-schedule-fs-display", + "properties": {}, + "tags": {}, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 10 + ], + "minutes": [ + 15 + ], + "weekDays": [ + "monday", + "wednesday" + ] + }, + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_kubernetes_compute_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_kubernetes_compute_full.json new file mode 100644 index 000000000000..290efe4b4861 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_kubernetes_compute_full.json @@ -0,0 +1,14 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "computeType": "Kubernetes", + "description": "smoke kubernetes compute", + "properties": { + "defaultInstanceType": "defaultInstanceType", + "namespace": "smoke-namespace", + "vcName": "smoke-vc" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_one_lake_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_one_lake_datastore.json new file mode 100644 index 000000000000..6481d3048af0 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_one_lake_datastore.json @@ -0,0 +1,22 @@ +{ + "properties": { + "artifact": { + "artifactName": "smoke-lakehouse", + "artifactType": "LakeHouse" + }, + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "ServicePrincipal", + "secrets": { + "clientSecret": "smoke-secret", + "secretsType": "ServicePrincipal" + }, + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "datastoreType": "OneLake", + "endpoint": "onelake.dfs.fabric.microsoft.com", + "oneLakeWorkspaceName": "smoke-onelake-workspace", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_registry_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_registry_full.json new file mode 100644 index 000000000000..d89afe45415f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_registry_full.json @@ -0,0 +1,22 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "location": "westus", + "properties": { + "managedResourceGroupTags": { + "tag1": "value1" + }, + "publicNetworkAccess": "Enabled", + "regionDetails": [ + { + "acrDetails": [], + "location": "westus", + "storageAccountDetails": [] + } + ] + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_schedule_pipeline.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_schedule_pipeline.json new file mode 100644 index 000000000000..06e5f3a3eb6c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_schedule_pipeline.json @@ -0,0 +1,43 @@ +{ + "properties": { + "action": { + "actionType": "CreateJob", + "jobDefinition": { + "inputs": {}, + "isArchived": false, + "jobType": "Pipeline", + "jobs": { + "node1": { + "_source": "BUILDER", + "componentId": "name: node1\ntype: command\ninputs:\n x:\n type: integer\n default: '1'\ncommand: echo ${{inputs.x}}\nenvironment: azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33\nis_deterministic: true\n", + "computeId": "smoke-compute", + "inputs": { + "x": { + "job_input_type": "literal", + "value": "1" + } + }, + "name": "node1", + "type": "command" + } + }, + "outputs": {}, + "properties": {}, + "settings": { + "_source": "CLASS", + "default_compute": "smoke-compute" + }, + "tags": {} + } + }, + "displayName": "smoke-schedule-pipeline-display", + "properties": {}, + "tags": {}, + "trigger": { + "expression": "15 10 * * 1", + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Cron" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_median_policy.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_median_policy.json new file mode 100644 index 000000000000..4a3e86e6ae85 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_median_policy.json @@ -0,0 +1,45 @@ +{ + "properties": { + "computeId": "smoke-compute", + "earlyTermination": { + "delayEvaluation": 5, + "evaluationInterval": 1, + "policyType": "MedianStopping" + }, + "experimentName": "smoke-experiment", + "inputs": {}, + "isArchived": false, + "jobType": "Sweep", + "limits": { + "jobLimitsType": "Sweep", + "maxConcurrentTrials": 2, + "maxTotalTrials": 4 + }, + "objective": { + "goal": "minimize", + "primaryMetric": "loss" + }, + "outputs": {}, + "properties": {}, + "samplingAlgorithm": { + "samplingAlgorithmType": "Grid" + }, + "searchSpace": { + "learning_rate": [ + "choice", + [ + [ + 0.01, + 0.1 + ] + ] + ] + }, + "tags": {}, + "trial": { + "command": "python train.py --lr ${{search_space.learning_rate}}", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {} + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_truncation_policy.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_truncation_policy.json new file mode 100644 index 000000000000..6bf9d83e07d5 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_sweep_job_truncation_policy.json @@ -0,0 +1,58 @@ +{ + "properties": { + "computeId": "smoke-compute", + "earlyTermination": { + "delayEvaluation": 5, + "evaluationInterval": 2, + "policyType": "TruncationSelection", + "truncationPercentage": 20 + }, + "experimentName": "smoke-experiment", + "inputs": {}, + "isArchived": false, + "jobType": "Sweep", + "limits": { + "jobLimitsType": "Sweep", + "maxConcurrentTrials": 4, + "maxTotalTrials": 8 + }, + "objective": { + "goal": "maximize", + "primaryMetric": "accuracy" + }, + "outputs": {}, + "properties": {}, + "samplingAlgorithm": { + "samplingAlgorithmType": "Bayesian" + }, + "searchSpace": { + "dropout": [ + "quniform", + [ + 0.0, + 0.5, + 1 + ] + ], + "lr": [ + "loguniform", + [ + -6, + -1 + ] + ], + "units": [ + "randint", + [ + 128 + ] + ] + }, + "tags": {}, + "trial": { + "command": "python train.py --lr ${{search_space.lr}} --units ${{search_space.units}}", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {} + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_virtual_machine_compute_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_virtual_machine_compute_full.json new file mode 100644 index 000000000000..d73d988e89e2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_virtual_machine_compute_full.json @@ -0,0 +1,17 @@ +{ + "properties": { + "computeType": "VirtualMachine", + "description": "smoke vm compute", + "properties": { + "administratorAccount": { + "password": "smoke-password", + "username": "azureuser" + }, + "sshPort": 22 + }, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.Compute/virtualMachines/smoke-vm" + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_minimal.json new file mode 100644 index 000000000000..e0ac97baddcc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_minimal.json @@ -0,0 +1,9 @@ +{ + "kind": "default", + "location": "westus", + "properties": { + "enableDataIsolation": false, + "hbiWorkspace": false + }, + "tags": {} +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_connection_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_connection_wire.py new file mode 100644 index 000000000000..ceff4b9ad7bd --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_connection_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for workspace-connection entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_connection import CONNECTION_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(CONNECTION_BUILDERS)) +def test_connection_serializes(case_name): + """The connection rest object must serialize to wire without raising.""" + entity = CONNECTION_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(CONNECTION_BUILDERS)) +def test_connection_wire_matches_expected(case_name): + """The connection wire must be byte-identical to the baseline captured from main.""" + entity = CONNECTION_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_deployment_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_deployment_wire.py new file mode 100644 index 000000000000..a2ff83d5af3c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_deployment_wire.py @@ -0,0 +1,33 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Serialization-guard smoke tests for online/batch DEPLOYMENT entities. + +Unlike the other families, deployments are NOT wire-equivalence tested against a pre-migration +baseline. The reason is intrinsic to the baseline, not the migration: pre-migration the deployment +envelope is a per-version msrest model whose nested children (``ProbeSettings`` etc.) are already +``arm_ml_service`` hybrids, so the baseline literally cannot serialize a deployment offline +(``msrest .serialize()`` raises ``'ProbeSettings' has no _attribute_map``). The real wire was assembled +by the operations layer at send time. There is therefore no offline baseline wire to pin against. + +What we CAN assert -- and what this migration must not break -- is that the branch, having unified the +whole tree on ``arm_ml_service``, serializes a deployment to wire cleanly (no mixed-tree +``TypeError``/``AttributeError``). That is the exact class of regression the client swap risks, so the +guard is valuable even without a golden. Full field-level deployment coverage lives in the +``tests/online_services`` and ``tests/batch_services`` unit suites. +""" +import pytest + +from _builders_deployment import BATCH_DEPLOYMENT_CASES, ONLINE_DEPLOYMENT_CASES +from _wire import assert_serializes + +_ALL = {} +_ALL.update(ONLINE_DEPLOYMENT_CASES) +_ALL.update(BATCH_DEPLOYMENT_CASES) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_deployment_serializes(case_name): + """The deployment rest object must serialize to wire without raising (no mixed tree).""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_model_package_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_model_package_wire.py new file mode 100644 index 000000000000..b1e80bae2982 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_model_package_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for model-package entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_model_package import MODEL_PACKAGE_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(MODEL_PACKAGE_BUILDERS)) +def test_model_package_serializes(case_name): + """The model-package rest object must serialize to wire without raising.""" + entity = MODEL_PACKAGE_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(MODEL_PACKAGE_BUILDERS)) +def test_model_package_wire_matches_expected(case_name): + """The model-package wire must be byte-identical to the baseline captured from main.""" + entity = MODEL_PACKAGE_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_roundtrip_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_roundtrip_wire.py new file mode 100644 index 000000000000..46cba71ab306 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_roundtrip_wire.py @@ -0,0 +1,112 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Round-trip (read-path) smoke tests for the serialization suite. + +The golden-wire tests (``test_*_wire.py``) guard the WRITE path: ``entity._to_rest_object()`` must +produce wire byte-identical to the pre-migration baseline. This module guards the READ path: +``_from_rest_object()`` must faithfully reconstruct the entity from that same rest shape. + +For every auto-discovered builder whose entity class exposes a single-argument ``_from_rest_object``, +this performs:: + + rest1 = entity._to_rest_object() # write + entity2 = EntityClass._from_rest_object(rest1) # read back + wire2 = serialize_wire(entity2._to_rest_object()) # write again + +and asserts ``wire2`` equals the baseline round-trip result committed in +``expected_wire/roundtrip_.json`` (captured from the pre-migration msrest code). + +Note the invariant is NOT "round-trip is a perfect identity" -- some entities legitimately do not +reproduce their write body after a read (readonly/response-only fields, normalization). The invariant +is that the migration did not *change* the round-trip result: ``wire2`` on the arm branch must equal +``wire2`` on the msrest baseline. A read regression (a field silently dropped or camelCase-leaked on +``_from_rest_object``) makes the branch ``wire2`` diverge from the baseline and fails here. + +Cases whose entity has no single-arg ``_from_rest_object`` are skipped with a visible reason; those +read paths are covered by the family unit-test suites. +""" +import os + +import pytest + +from _registry import all_builders +from _wire import EXPECTED_WIRE_DIR, load_expected_wire, serialize_wire + +_BUILDERS = all_builders() + +# Cases whose read->write round-trip differs from the msrest baseline ONLY by a benign arm-vs-msrest +# DESERIALIZATION DEFAULT, not a wire regression. Each entry documents the exact delta. For every one +# of these the DIRECT write path (``test_*_wire.py``) is already byte-identical to the baseline -- the +# delta appears only when a *synthetic write body* (which, unlike a real server response, lacks the +# readonly/server fields) is fed back through ``_from_rest_object``. A real GET response carries these +# fields, so production read+re-PUT is unaffected. Skipped with the reason visible in ``-rs`` output. +_KNOWN_BENIGN_ROUNDTRIP = { + "custom_finetuning_minimal": "arm defaults is_archived=False on read (msrest left None) -> adds isArchived:false", + "workspace_full": "arm reconstructs default identity SystemAssigned on read (msrest left None)", + "automl_classification": "msrest emits empty trainingSettings {}; arm omits the empty dict", + "automl_regression": "msrest emits empty trainingSettings {}; arm omits the empty dict", +} + + +def _roundtrip_case_name(case_name): + """Return the golden case name for a round-trip baseline. + + :param case_name: The builder case name. + :return: The round-trip golden case name. + :rtype: str + """ + return "roundtrip_" + case_name + + +def _read_back(entity, rest1): + """Reconstruct an entity from its own rest object via single-arg ``_from_rest_object``. + + :param entity: The original entity. + :param rest1: The rest object produced by ``entity._to_rest_object()``. + :return: The reconstructed entity. + :rtype: Any + :raises pytest.skip.Exception: if the class has no compatible single-arg ``_from_rest_object``. + """ + cls = type(entity) + from_rest = getattr(cls, "_from_rest_object", None) + if not callable(from_rest): + pytest.skip("{0} has no _from_rest_object (read path covered by family unit tests)".format(cls.__name__)) + try: + return from_rest(rest1) + except pytest.skip.Exception: + raise + except Exception as exc: # noqa: BLE001 - a signature/shape mismatch means "not a single-arg reader" + pytest.skip( + "{0}._from_rest_object not single-arg round-trippable: {1}".format(cls.__name__, type(exc).__name__) + ) + + +def roundtrip_wire(case_name): + """Run the read->write round-trip for a case and return the resulting wire dict. + + :param case_name: The builder case name. + :return: The wire dict after ``_from_rest_object`` -> ``_to_rest_object``. + :rtype: dict + :raises pytest.skip.Exception: if the entity has no compatible single-arg ``_from_rest_object``. + """ + entity = _BUILDERS[case_name]() + rest1 = entity._to_rest_object() + entity2 = _read_back(entity, rest1) + return serialize_wire(entity2._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_BUILDERS)) +def test_roundtrip_wire_matches_baseline(case_name): + """entity -> rest -> entity -> rest must match the pre-migration round-trip baseline.""" + if case_name in _KNOWN_BENIGN_ROUNDTRIP: + pytest.skip("known benign arm-vs-msrest deserialization default: " + _KNOWN_BENIGN_ROUNDTRIP[case_name]) + golden = _roundtrip_case_name(case_name) + if not os.path.exists(os.path.join(EXPECTED_WIRE_DIR, golden + ".json")): + pytest.skip("no round-trip baseline for '{0}' (not single-arg round-trippable on baseline)".format(case_name)) + wire2 = roundtrip_wire(case_name) + expected = load_expected_wire(golden) + assert wire2 == expected, ( + "Round-trip read path changed vs baseline for '{0}'. entity._from_rest_object() dropped or " + "altered a field relative to the pre-migration code (a read-path regression).".format(case_name) + ) From 39b9b68a86b94afea3fa5fe9d827079555764c39 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 11:51:20 +0530 Subject: [PATCH 132/146] ci: skip azureml-dataprep-rslex on macOS arm64 (no wheel available) The macOS PR agent moved to Apple Silicon (macosx_15_0_arm64). azureml-dataprep-rslex>=2.22.0 publishes no arm64 macOS wheel, so 'uv pip install -r dev_requirements.txt' is unsatisfiable and the macos311 lane fails at env setup before any test runs. rslex is a dev/test-only optional-extra dep (the 'mount' feature) that no test imports directly (mount unit tests mock its wrapper), so excluding it on macOS arm64 via a platform marker unblocks the lane without losing coverage. --- sdk/ml/azure-ai-ml/dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/dev_requirements.txt b/sdk/ml/azure-ai-ml/dev_requirements.txt index bc053e008f18..a88a674b7933 100644 --- a/sdk/ml/azure-ai-ml/dev_requirements.txt +++ b/sdk/ml/azure-ai-ml/dev_requirements.txt @@ -21,7 +21,7 @@ azure-mgmt-resourcegraph<9.0.0,>=2.0.0 azure-mgmt-resource<23.0.0,>=3.0.0 pytest-reportlog python-dotenv -azureml-dataprep-rslex>=2.22.0; platform_python_implementation == "CPython" and python_version < "3.13" +azureml-dataprep-rslex>=2.22.0; platform_python_implementation == "CPython" and python_version < "3.13" and (sys_platform != "darwin" or platform_machine != "arm64") azureml-dataprep-rslex>=2.22.0; platform_python_implementation == "PyPy" and python_version < "3.10" pip setuptools==77.0.3 \ No newline at end of file From 0c09a1653f014116b7367f30392ccf95ef1d4059 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 12:00:34 +0530 Subject: [PATCH 133/146] chore: bump api.metadata.yml parserVersion to 0.3.30 (matches upstream #48169 apistub pin) Upstream #48169 bumped apiview-stub-generator 0.3.28->0.3.30. The consistency check regenerates api.metadata.yml with 0.3.30 and gates on parserVersion; the committed 0.3.28 mismatches. api.md content is unchanged (apiMdSha256 identical), so only the parserVersion field is updated. --- sdk/ml/azure-ai-ml/api.metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/api.metadata.yml b/sdk/ml/azure-ai-ml/api.metadata.yml index c6789b6c57f6..d8616c44bd53 100644 --- a/sdk/ml/azure-ai-ml/api.metadata.yml +++ b/sdk/ml/azure-ai-ml/api.metadata.yml @@ -1,3 +1,3 @@ apiMdSha256: cafe2d1eac23a18bf16a585b789ffeeacf37f5606e32cafbe37a5bbca3d33fad -parserVersion: 0.3.28 +parserVersion: 0.3.30 pythonVersion: 3.12.10 From 2671706123417831f2162e3b9fe908f793d6f1e2 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 13:07:57 +0530 Subject: [PATCH 134/146] test: skip rslex-dependent tests on macOS arm64 (matches dev_requirements marker) The macOS arm64 rslex exclusion in dev_requirements.txt means azureml-dataprep-rslex is absent there. Update the tests that assume it is present: the data/datastore mount unit tests (they patch azureml.dataprep.rslex_fuse_subprocess_wrapper, which does not exist without rslex) now also skip on macOS arm64, and the dev_requirements install-matrix guard no longer expects rslex below 3.13 on macOS arm64 (with a new explicit not-installed assertion for that platform). --- .../dataset/unittests/test_data_operations.py | 9 +++++---- .../unittests/test_datastore_operations.py | 9 +++++---- .../unittests/test_dev_requirements.py | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py index 673489569475..a5b74f9e01b5 100644 --- a/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py +++ b/sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py @@ -30,6 +30,7 @@ IS_CPYTHON = platform.python_implementation() == "CPython" IS_PYPY = platform.python_implementation() == "PyPy" +IS_MACOS_ARM64 = sys.platform == "darwin" and platform.machine() == "arm64" @pytest.fixture @@ -569,8 +570,8 @@ def test_create_with_datastore( ) @pytest.mark.skipif( - (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)), - reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it", + (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)) or IS_MACOS_ARM64, + reason="Skipping because azureml.dataprep.rslex is unavailable: CPython>=3.13, PyPy>=3.10, or macOS arm64 (no wheel).", ) def test_mount_persistent( self, @@ -600,8 +601,8 @@ def test_mount_persistent( assert mock_data_operations._service_client.send_request.call_count == 2 @pytest.mark.skipif( - (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)), - reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it", + (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)) or IS_MACOS_ARM64, + reason="Skipping because azureml.dataprep.rslex is unavailable: CPython>=3.13, PyPy>=3.10, or macOS arm64 (no wheel).", ) def test_mount_non_persistent( self, diff --git a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py index b7cd643b6513..5256bd2b353f 100644 --- a/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py @@ -12,6 +12,7 @@ IS_CPYTHON = platform.python_implementation() == "CPython" IS_PYPY = platform.python_implementation() == "PyPy" +IS_MACOS_ARM64 = sys.platform == "darwin" and platform.machine() == "arm64" @pytest.fixture @@ -102,8 +103,8 @@ def test_create_body_is_json_serializable( json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) @pytest.mark.skipif( - (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)), - reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it", + (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)) or IS_MACOS_ARM64, + reason="Skipping because azureml.dataprep.rslex is unavailable: CPython>=3.13, PyPy>=3.10, or macOS arm64 (no wheel).", ) def test_mount_persistent( self, @@ -134,8 +135,8 @@ def test_mount_persistent( assert mock_datastore_operation._service_client.send_request.call_count == 2 @pytest.mark.skipif( - (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)), - reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it", + (IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)) or IS_MACOS_ARM64, + reason="Skipping because azureml.dataprep.rslex is unavailable: CPython>=3.13, PyPy>=3.10, or macOS arm64 (no wheel).", ) def test_mount_non_persistent( self, diff --git a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_dev_requirements.py b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_dev_requirements.py index efc6747d6bc8..1fdf2e8d1422 100644 --- a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_dev_requirements.py +++ b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_dev_requirements.py @@ -8,6 +8,8 @@ PACKAGE_NAME_SCIKIT_IMAGE = "scikit-image" IS_CPYTHON = platform.python_implementation() == "CPython" IS_PYPY = platform.python_implementation() == "PyPy" +# azureml-dataprep-rslex publishes no macOS arm64 wheel, so dev_requirements.txt excludes it there. +IS_MACOS_ARM64 = sys.platform == "darwin" and platform.machine() == "arm64" def is_package_installed(package_name): @@ -33,14 +35,23 @@ def test_package_not_installed_in_cpython_3_13(self): ), f"{PACKAGE_NAME_AZURE_ML_DATAPREP_RSLEX} should not be installed in CPython 3.13 or above environment." @pytest.mark.skipif( - not (IS_CPYTHON and sys.version_info < (3, 13)), - reason="Skipping because environment is not below cpython 3.13", + not (IS_CPYTHON and sys.version_info < (3, 13) and not IS_MACOS_ARM64), + reason="Skipping because environment is not below cpython 3.13, or is macOS arm64 (no rslex wheel)", ) def test_package_installed_below_cpython_3_13(self): assert is_package_installed( PACKAGE_NAME_AZURE_ML_DATAPREP_RSLEX ), f"{PACKAGE_NAME_AZURE_ML_DATAPREP_RSLEX} should be installed in CPython < 3.13." + @pytest.mark.skipif( + not IS_MACOS_ARM64, + reason="Skipping because environment is not macOS arm64", + ) + def test_package_not_installed_on_macos_arm64(self): + assert not is_package_installed( + PACKAGE_NAME_AZURE_ML_DATAPREP_RSLEX + ), f"{PACKAGE_NAME_AZURE_ML_DATAPREP_RSLEX} should not be installed on macOS arm64 (no wheel available)." + @pytest.mark.skipif( not (IS_CPYTHON and sys.version_info < (3, 14)), reason="Skipping because environment is not below cpython 3.14", From 516c24d00c0cd7b38d384fe530a73b32271cc8b0 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 14:58:27 +0530 Subject: [PATCH 135/146] test(smoke): add pipeline_job write + round-trip wire coverage Pins the full pipeline request body (envelope + node graph) byte-for-byte vs the pre-migration baseline. Loaded via the real load_job from a dedicated registry-component pipeline YAML (no inline components, so it serializes offline without a client and without mocking). --- .../smoke_serialization/_builders_pipeline.py | 30 +++++++++++++ .../smoke_serialization/_pipeline_smoke.yml | 33 ++++++++++++++ .../pipeline_job_registry_components.json | 44 +++++++++++++++++++ ...trip_pipeline_job_registry_components.json | 44 +++++++++++++++++++ .../smoke_serialization/test_pipeline_wire.py | 25 +++++++++++ 5 files changed, 176 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_pipeline.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_pipeline_smoke.yml create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/pipeline_job_registry_components.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_pipeline_job_registry_components.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_pipeline_wire.py diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_pipeline.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_pipeline.py new file mode 100644 index 000000000000..64a14418832f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_pipeline.py @@ -0,0 +1,30 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builder for a pipeline job (smoke serialization suite). + +The pipeline envelope (``JobBase`` with ``PipelineJob`` properties) and its node subtree were migrated +to ``arm_ml_service`` together with the shared job boundary (``_input_output_helpers``, the DSL node +serializer ``get_rest_dict_for_node_attrs``, etc.). This pins the full pipeline request body -- the +envelope plus the serialized node graph -- byte-for-byte against the pre-migration baseline. + +The pipeline is loaded from ``_pipeline_smoke.yml`` whose nodes reference REGISTERED components by ARM +id (no inline/anonymous components), so ``_to_rest_object()`` serializes cleanly offline without a +client to resolve component ids and without any mocking (inline components only stringify at real +submit time). ``load_job`` is the real public loader -- no test doubles. +""" +import os + +from azure.ai.ml import load_job + +_THIS_DIR = os.path.dirname(__file__) + + +def build_pipeline_job_registry_components(): + """PipelineJob with two registry-component nodes, pipeline inputs, tags and settings.""" + return load_job(os.path.join(_THIS_DIR, "_pipeline_smoke.yml")) + + +PIPELINE_BUILDERS = { + "pipeline_job_registry_components": build_pipeline_job_registry_components, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_pipeline_smoke.yml b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_pipeline_smoke.yml new file mode 100644 index 000000000000..c2a4bed19608 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_pipeline_smoke.yml @@ -0,0 +1,33 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +# Deterministic pipeline job for the offline serialization smoke suite. +# +# Nodes reference REGISTERED components by ARM id (no inline/anonymous components), so the whole +# pipeline serializes cleanly offline via entity._to_rest_object() -> wire without needing a client +# to resolve component ids (inline components only stringify at real submit time). This keeps the +# smoke test fully offline and mock-free while pinning the pipeline envelope + node wire byte-for-byte. +type: pipeline +name: smoke_pipeline_job +display_name: smoke pipeline job +description: smoke pipeline job built from registry components +experiment_name: smoke-experiment +compute: azureml:cpu-cluster +tags: + tag1: value1 + owner: smoke +inputs: + pipeline_input_string: "hello smoke" +settings: + default_compute: azureml:cpu-cluster + continue_on_step_failure: true + force_rerun: false +jobs: + node_a: + type: command + component: azureml://registries/smoke-registry/components/smoke_component_a/versions/1 + compute: azureml:cpu-cluster + node_b: + type: command + component: azureml://registries/smoke-registry/components/smoke_component_b/versions/2 + compute: azureml:gpu-cluster diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/pipeline_job_registry_components.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/pipeline_job_registry_components.json new file mode 100644 index 000000000000..28a08d7eee75 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/pipeline_job_registry_components.json @@ -0,0 +1,44 @@ +{ + "properties": { + "computeId": "cpu-cluster", + "description": "smoke pipeline job built from registry components", + "displayName": "smoke pipeline job", + "experimentName": "smoke-experiment", + "inputs": { + "pipeline_input_string": { + "jobInputType": "literal", + "value": "hello smoke" + } + }, + "isArchived": false, + "jobType": "Pipeline", + "jobs": { + "node_a": { + "_source": "REMOTE.REGISTRY", + "componentId": "azureml://registries/smoke-registry/components/smoke_component_a/versions/1", + "computeId": "cpu-cluster", + "name": "node_a", + "type": "command" + }, + "node_b": { + "_source": "REMOTE.REGISTRY", + "componentId": "azureml://registries/smoke-registry/components/smoke_component_b/versions/2", + "computeId": "gpu-cluster", + "name": "node_b", + "type": "command" + } + }, + "outputs": {}, + "properties": {}, + "settings": { + "_source": "YAML.JOB", + "continue_on_step_failure": true, + "default_compute": "cpu-cluster", + "force_rerun": false + }, + "tags": { + "owner": "smoke", + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_pipeline_job_registry_components.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_pipeline_job_registry_components.json new file mode 100644 index 000000000000..28a08d7eee75 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_pipeline_job_registry_components.json @@ -0,0 +1,44 @@ +{ + "properties": { + "computeId": "cpu-cluster", + "description": "smoke pipeline job built from registry components", + "displayName": "smoke pipeline job", + "experimentName": "smoke-experiment", + "inputs": { + "pipeline_input_string": { + "jobInputType": "literal", + "value": "hello smoke" + } + }, + "isArchived": false, + "jobType": "Pipeline", + "jobs": { + "node_a": { + "_source": "REMOTE.REGISTRY", + "componentId": "azureml://registries/smoke-registry/components/smoke_component_a/versions/1", + "computeId": "cpu-cluster", + "name": "node_a", + "type": "command" + }, + "node_b": { + "_source": "REMOTE.REGISTRY", + "componentId": "azureml://registries/smoke-registry/components/smoke_component_b/versions/2", + "computeId": "gpu-cluster", + "name": "node_b", + "type": "command" + } + }, + "outputs": {}, + "properties": {}, + "settings": { + "_source": "YAML.JOB", + "continue_on_step_failure": true, + "default_compute": "cpu-cluster", + "force_rerun": false + }, + "tags": { + "owner": "smoke", + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_pipeline_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_pipeline_wire.py new file mode 100644 index 000000000000..ae0fa8e9b47f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_pipeline_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for the pipeline job entity. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_pipeline import PIPELINE_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(PIPELINE_BUILDERS)) +def test_pipeline_serializes(case_name): + """The pipeline rest object must serialize to wire without raising.""" + entity = PIPELINE_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(PIPELINE_BUILDERS)) +def test_pipeline_wire_matches_expected(case_name): + """The pipeline wire must be byte-identical to the baseline captured from main.""" + entity = PIPELINE_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) From bcc59075f17abfa18f28f533aea298ed7c5a15e3 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 15:04:22 +0530 Subject: [PATCH 136/146] fix(distillation): stringify properties bag + emit isArchived to match legacy wire The pre-migration msrest FineTuningJob.properties was typed Dict[str,str] and coerced every value to a string on the wire; the arm model preserves native types, so DistillationJob emitted native bool/int/float (enable_chain_of_thought: true vs 'True', min_endpoint_success_ratio: 0.8 vs '0.8', max_tokens: 100 vs '100') - a wire regression on distillation submit. Stringify the whole properties bag at the wire boundary (in-memory entity keeps native values; _from_rest_object restores them via _coerce_property_value) and set is_archived=False like the finetuning family. Adds a distillation smoke case (write + round-trip) that catches this. Found by the offline golden-wire smoke suite. --- .../_job/distillation/distillation_job.py | 14 +++++- .../_builders_distillation.py | 49 +++++++++++++++++++ .../distillation_label_generation.json | 45 +++++++++++++++++ ...undtrip_distillation_label_generation.json | 45 +++++++++++++++++ .../test_distillation_wire.py | 25 ++++++++++ 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_distillation.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/distillation_label_generation.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_distillation_label_generation.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_distillation_wire.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py index 1dcfb012ffd4..5c1ff7b59c24 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py @@ -417,15 +417,27 @@ def _to_rest_object(self) -> "RestFineTuningJob": self._add_distillation_properties(self.properties) + # The v2024_01 msrest FineTuningJob typed ``properties`` as Dict[str, str] and coerced every value + # to a string on the wire (e.g. True -> "True", 0.8 -> "0.8", 100 -> "100"). The shared + # arm_ml_service model preserves native value types, so stringify the whole bag here to keep the + # serialized body byte-identical. The in-memory entity keeps the native values; ``_from_rest_object`` + # restores them via ``_coerce_property_value``. + rest_properties = ( + {key: str(value) for key, value in self.properties.items()} if self.properties else self.properties + ) + finetuning_job = RestFineTuningJob( display_name=self.display_name, description=self.description, experiment_name=self.experiment_name, services=self.services, tags=self.tags, - properties=self.properties, + properties=rest_properties, fine_tuning_details=distillation, outputs=to_rest_data_outputs(self.outputs), + # The shared arm_ml_service model defaults is_archived to None (omitted on the wire), but the + # pre-migration msrest model emitted ``isArchived: false``; set it to stay byte-identical. + is_archived=False, ) result = RestJobBase(properties=finetuning_job) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_distillation.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_distillation.py new file mode 100644 index 000000000000..a2e322aee7aa --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_distillation.py @@ -0,0 +1,49 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builder for the distillation job entity (smoke serialization suite). + +``DistillationJob`` is a private-preview model-customization job whose ``_to_rest_object()`` returns an +``arm_ml_service`` hybrid ``RestFineTuningJob`` (distillation rides the fine-tuning wire envelope). It +was migrated together with the fine-tuning family off the versioned msrest clients. + +This case specifically guards the ``properties`` bag: the pre-migration msrest ``FineTuningJob.properties`` +was typed ``Dict[str, str]`` and stringified every value on the wire; the arm model preserves native +types, so the entity must stringify the bag itself to stay byte-identical (True -> "True", 0.8 -> "0.8"). +""" +from azure.ai.ml.constants import DataGenerationTaskType, DataGenerationType +from azure.ai.ml.entities._inputs_outputs import Input, Output +from azure.ai.ml.entities._job.distillation.endpoint_request_settings import EndpointRequestSettings +from azure.ai.ml.entities._job.distillation.prompt_settings import PromptSettings +from azure.ai.ml.entities._workspace.connections.connection_subtypes import ServerlessConnection +from azure.ai.ml.model_customization import distillation + + +def build_distillation_job(): + """DistillationJob (label-generation, MATH) with teacher/prompt/finetuning settings.""" + job = distillation( + experiment_name="smoke-distillation", + data_generation_type=DataGenerationType.LABEL_GENERATION, + data_generation_task_type=DataGenerationTaskType.MATH, + teacher_model_endpoint_connection=ServerlessConnection( + name="smoke-teacher-conn", + endpoint="https://smoke-teacher.eastus.models.ai.azure.com", + api_key="smoke-teacher-key", + ), + student_model="azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/2", + training_data=Input(type="uri_file", path="azureml://datastores/workspaceblobstore/paths/train.jsonl"), + validation_data=Input(type="uri_file", path="azureml://datastores/workspaceblobstore/paths/valid.jsonl"), + outputs={"registered_model": Output(type="mlflow_model", name="smoke-distilled-model")}, + ) + job.set_teacher_model_settings( + inference_parameters={"max_tokens": 100, "temperature": "0.7"}, + endpoint_request_settings=EndpointRequestSettings(min_endpoint_success_ratio=0.8), + ) + job.set_prompt_settings(prompt_settings=PromptSettings(enable_chain_of_thought=True)) + job.set_finetuning_settings(hyperparameters={"learning_rate_multiplier": "0.1"}) + return job + + +DISTILLATION_BUILDERS = { + "distillation_label_generation": build_distillation_job, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/distillation_label_generation.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/distillation_label_generation.json new file mode 100644 index 000000000000..c68377b07e09 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/distillation_label_generation.json @@ -0,0 +1,45 @@ +{ + "properties": { + "experimentName": "smoke-distillation", + "fineTuningDetails": { + "hyperParameters": { + "learning_rate_multiplier": "0.1" + }, + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/2" + }, + "modelProvider": "Custom", + "taskType": "ChatCompletion", + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/train.jsonl" + }, + "validationData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/valid.jsonl" + } + }, + "isArchived": false, + "jobType": "FineTuning", + "outputs": { + "registered_model": { + "assetName": "smoke-distilled-model", + "jobOutputType": "mlflow_model" + } + }, + "properties": { + "azureml.connection_information": "{\"name\": \"smoke-teacher-conn\", \"tags\": {}, \"type\": \"serverless\", \"target\": \"https://smoke-teacher.eastus.models.ai.azure.com\", \"credentials\": {\"type\": \"api_key\", \"key\": \"smoke-teacher-key\"}, \"is_shared\": true, \"metadata\": {}, \"api_key\": \"smoke-teacher-key\", \"endpoint\": \"https://smoke-teacher.eastus.models.ai.azure.com\"}", + "azureml.data_generation_task_type": "MATH", + "azureml.data_generation_type": "label_generation", + "azureml.enable_chain_of_density": "False", + "azureml.enable_chain_of_thought": "True", + "azureml.enable_distillation": "True", + "azureml.min_endpoint_success_ratio": "0.8", + "azureml.teacher_model.endpoint_name": "smoke-teacher-conn", + "azureml.teacher_model.max_tokens": "100", + "azureml.teacher_model.temperature": "0.7" + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_distillation_label_generation.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_distillation_label_generation.json new file mode 100644 index 000000000000..c68377b07e09 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_distillation_label_generation.json @@ -0,0 +1,45 @@ +{ + "properties": { + "experimentName": "smoke-distillation", + "fineTuningDetails": { + "hyperParameters": { + "learning_rate_multiplier": "0.1" + }, + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/2" + }, + "modelProvider": "Custom", + "taskType": "ChatCompletion", + "trainingData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/train.jsonl" + }, + "validationData": { + "jobInputType": "uri_file", + "uri": "azureml://datastores/workspaceblobstore/paths/valid.jsonl" + } + }, + "isArchived": false, + "jobType": "FineTuning", + "outputs": { + "registered_model": { + "assetName": "smoke-distilled-model", + "jobOutputType": "mlflow_model" + } + }, + "properties": { + "azureml.connection_information": "{\"name\": \"smoke-teacher-conn\", \"tags\": {}, \"type\": \"serverless\", \"target\": \"https://smoke-teacher.eastus.models.ai.azure.com\", \"credentials\": {\"type\": \"api_key\", \"key\": \"smoke-teacher-key\"}, \"is_shared\": true, \"metadata\": {}, \"api_key\": \"smoke-teacher-key\", \"endpoint\": \"https://smoke-teacher.eastus.models.ai.azure.com\"}", + "azureml.data_generation_task_type": "MATH", + "azureml.data_generation_type": "label_generation", + "azureml.enable_chain_of_density": "False", + "azureml.enable_chain_of_thought": "True", + "azureml.enable_distillation": "True", + "azureml.min_endpoint_success_ratio": "0.8", + "azureml.teacher_model.endpoint_name": "smoke-teacher-conn", + "azureml.teacher_model.max_tokens": "100", + "azureml.teacher_model.temperature": "0.7" + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_distillation_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_distillation_wire.py new file mode 100644 index 000000000000..1285e39734b9 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_distillation_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for the distillation job entity. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_distillation import DISTILLATION_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(DISTILLATION_BUILDERS)) +def test_distillation_serializes(case_name): + """The distillation rest object must serialize to wire without raising.""" + entity = DISTILLATION_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(DISTILLATION_BUILDERS)) +def test_distillation_wire_matches_expected(case_name): + """The distillation wire must be byte-identical to the baseline captured from main.""" + entity = DISTILLATION_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) From 2a9b88c6f45477e4df9a564c7f4e0aa9e5ae967b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 15:08:39 +0530 Subject: [PATCH 137/146] test(smoke): add serverless_endpoint + marketplace_subscription wire coverage Pins the request bodies of the _autogen_entities ServerlessEndpoint and MarketplaceSubscription byte-for-byte vs the pre-migration baseline. Their REST types were migrated off v2024_01/v2024_04 msrest onto arm_ml_service (and the silently-ignored auth_mode='key' kwarg was dropped), so this guards that swap. No mocking - real entity construction + real _to_rest_object. --- .../_builders_serverless.py | 38 +++++++++++++++++++ .../marketplace_subscription.json | 5 +++ .../roundtrip_serverless_endpoint.json | 15 ++++++++ .../expected_wire/serverless_endpoint.json | 15 ++++++++ .../test_serverless_wire.py | 25 ++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_serverless.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/marketplace_subscription.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_serverless_endpoint.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/serverless_endpoint.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_serverless_wire.py diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_serverless.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_serverless.py new file mode 100644 index 000000000000..3d595115fa3b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_serverless.py @@ -0,0 +1,38 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for serverless-endpoint and marketplace-subscription entities. + +These ``_autogen_entities`` models had their REST types migrated off the versioned msrest clients +(``ServerlessEndpoint``/``MarketplaceSubscription``/``ModelSettings``/``Sku`` from v2024_01 and the +openai-deployment types from v2024_04) onto ``arm_ml_service``. The migration also dropped the +``auth_mode="key"`` kwarg the old msrest model silently ignored. This pins their request bodies +byte-for-byte across the swap. ``_to_rest_object()`` is a no-arg method matching the suite contract. +""" +from azure.ai.ml.entities import MarketplaceSubscription, ServerlessEndpoint + +_MODEL_ID = "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1" + + +def build_serverless_endpoint(): + """ServerlessEndpoint with model id, location and tags.""" + return ServerlessEndpoint( + name="smoke-serverless-endpoint", + model_id=_MODEL_ID, + location="westus", + tags={"tag1": "value1", "team": "smoke"}, + ) + + +def build_marketplace_subscription(): + """MarketplaceSubscription for a marketplace model.""" + return MarketplaceSubscription( + name="smoke-marketplace-sub", + model_id=_MODEL_ID, + ) + + +SERVERLESS_BUILDERS = { + "serverless_endpoint": build_serverless_endpoint, + "marketplace_subscription": build_marketplace_subscription, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/marketplace_subscription.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/marketplace_subscription.json new file mode 100644 index 000000000000..72180e0bf110 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/marketplace_subscription.json @@ -0,0 +1,5 @@ +{ + "properties": { + "modelId": "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_serverless_endpoint.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_serverless_endpoint.json new file mode 100644 index 000000000000..d9b57833852e --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_serverless_endpoint.json @@ -0,0 +1,15 @@ +{ + "location": "westus", + "properties": { + "modelSettings": { + "modelId": "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1" + } + }, + "sku": { + "name": "Consumption" + }, + "tags": { + "tag1": "value1", + "team": "smoke" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/serverless_endpoint.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/serverless_endpoint.json new file mode 100644 index 000000000000..d9b57833852e --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/serverless_endpoint.json @@ -0,0 +1,15 @@ +{ + "location": "westus", + "properties": { + "modelSettings": { + "modelId": "azureml://registries/azureml-meta/models/Meta-Llama-3.1-8B-Instruct/versions/1" + } + }, + "sku": { + "name": "Consumption" + }, + "tags": { + "tag1": "value1", + "team": "smoke" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_serverless_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_serverless_wire.py new file mode 100644 index 000000000000..dc5543d73636 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_serverless_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for serverless-endpoint and marketplace-subscription entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_serverless import SERVERLESS_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(SERVERLESS_BUILDERS)) +def test_serverless_serializes(case_name): + """The rest object must serialize to wire without raising.""" + entity = SERVERLESS_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(SERVERLESS_BUILDERS)) +def test_serverless_wire_matches_expected(case_name): + """The wire must be byte-identical to the baseline captured from main.""" + entity = SERVERLESS_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) From d12555631ef89d46eb6666004d3c350d31325d42 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 15:53:11 +0530 Subject: [PATCH 138/146] test(smoke): cover remaining connection subtypes (7 more category/auth-type enums) Adds APIKey, OpenAI, Serp, Serverless, ContentSafety, SpeechServices and OneLake connections. Each exercises a distinct migrated ConnectionCategory/ConnectionAuthType enum, pinning its wire byte-for-byte vs the pre-migration baseline (write + round-trip). No mocking. --- .../_builders_connection.py | 78 ++++++++++++++++++- .../expected_wire/connection_api_key.json | 12 +++ .../connection_content_safety.json | 14 ++++ .../expected_wire/connection_one_lake.json | 9 +++ .../expected_wire/connection_open_ai.json | 11 +++ .../expected_wire/connection_serp.json | 11 +++ .../expected_wire/connection_serverless.json | 12 +++ .../connection_speech_services.json | 14 ++++ .../roundtrip_connection_api_key.json | 12 +++ .../roundtrip_connection_content_safety.json | 14 ++++ .../roundtrip_connection_one_lake.json | 9 +++ .../roundtrip_connection_open_ai.json | 11 +++ .../roundtrip_connection_serp.json | 11 +++ .../roundtrip_connection_serverless.json | 12 +++ .../roundtrip_connection_speech_services.json | 14 ++++ 15 files changed, 242 insertions(+), 2 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_api_key.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_content_safety.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_one_lake.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_open_ai.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serp.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serverless.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_speech_services.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_api_key.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_content_safety.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_one_lake.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_open_ai.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serp.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serverless.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_speech_services.json diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py index 721981bd3abe..4265c0a1fc69 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_connection.py @@ -16,8 +16,18 @@ AzureAISearchConnection, AzureAIServicesConnection, ) -from azure.ai.ml.entities._credentials import AccountKeyConfiguration -from azure.ai.ml.entities._workspace.connections.connection_subtypes import AzureBlobStoreConnection +from azure.ai.ml.entities._credentials import AadCredentialConfiguration, AccountKeyConfiguration +from azure.ai.ml.entities._workspace.connections.connection_subtypes import ( + APIKeyConnection, + AzureBlobStoreConnection, + AzureContentSafetyConnection, + AzureSpeechServicesConnection, + MicrosoftOneLakeConnection, + OpenAIConnection, + SerpConnection, + ServerlessConnection, +) +from azure.ai.ml.entities._workspace.connections.one_lake_artifacts import OneLakeConnectionArtifact def build_azure_open_ai_connection_api_key(): @@ -76,10 +86,74 @@ def build_azure_blob_store_connection(): ) +def build_api_key_connection(): + """APIKeyConnection to a generic API base.""" + return APIKeyConnection( + name="smoke-apikey-conn", + api_base="https://smoke-api.example.com/v1", + api_key="smoke-generic-api-key", + ) + + +def build_open_ai_connection(): + """OpenAIConnection (non-Azure OpenAI) with an API key.""" + return OpenAIConnection(name="smoke-openai-conn", api_key="smoke-openai-api-key") + + +def build_serp_connection(): + """SerpConnection with an API key.""" + return SerpConnection(name="smoke-serp-conn", api_key="smoke-serp-api-key") + + +def build_serverless_connection(): + """ServerlessConnection to a MaaS endpoint with an API key.""" + return ServerlessConnection( + name="smoke-serverless-conn", + endpoint="https://smoke-maas.eastus.models.ai.azure.com", + api_key="smoke-serverless-api-key", + ) + + +def build_content_safety_connection(): + """AzureContentSafetyConnection with an API key.""" + return AzureContentSafetyConnection( + name="smoke-contentsafety-conn", + endpoint="https://smoke-contentsafety.cognitiveservices.azure.com/", + api_key="smoke-contentsafety-api-key", + ) + + +def build_speech_services_connection(): + """AzureSpeechServicesConnection with an API key.""" + return AzureSpeechServicesConnection( + name="smoke-speech-conn", + endpoint="https://smoke-speech.cognitiveservices.azure.com/", + api_key="smoke-speech-api-key", + ) + + +def build_one_lake_connection(): + """MicrosoftOneLakeConnection with a OneLake artifact.""" + return MicrosoftOneLakeConnection( + name="smoke-onelake-conn", + endpoint="https://onelake.dfs.fabric.microsoft.com", + one_lake_workspace_name="smoke-onelake-workspace", + artifact=OneLakeConnectionArtifact(name="smoke-lakehouse.Lakehouse"), + credentials=AadCredentialConfiguration(), + ) + + CONNECTION_BUILDERS = { "connection_azure_open_ai_api_key": build_azure_open_ai_connection_api_key, "connection_azure_open_ai_entra": build_azure_open_ai_connection_entra, "connection_azure_ai_search": build_azure_ai_search_connection, "connection_azure_ai_services": build_azure_ai_services_connection, "connection_azure_blob_store": build_azure_blob_store_connection, + "connection_api_key": build_api_key_connection, + "connection_open_ai": build_open_ai_connection, + "connection_serp": build_serp_connection, + "connection_serverless": build_serverless_connection, + "connection_content_safety": build_content_safety_connection, + "connection_speech_services": build_speech_services_connection, + "connection_one_lake": build_one_lake_connection, } diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_api_key.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_api_key.json new file mode 100644 index 000000000000..c17b4112b5d4 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_api_key.json @@ -0,0 +1,12 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "ApiKey", + "credentials": { + "key": "smoke-generic-api-key" + }, + "isSharedToAll": true, + "metadata": {}, + "target": "https://smoke-api.example.com/v1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_content_safety.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_content_safety.json new file mode 100644 index 000000000000..9e7e25f89c9f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_content_safety.json @@ -0,0 +1,14 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "CognitiveService", + "credentials": { + "key": "smoke-contentsafety-api-key" + }, + "isSharedToAll": true, + "metadata": { + "Kind": "Content Safety" + }, + "target": "https://smoke-contentsafety.cognitiveservices.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_one_lake.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_one_lake.json new file mode 100644 index 000000000000..cb570d913555 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_one_lake.json @@ -0,0 +1,9 @@ +{ + "properties": { + "authType": "AAD", + "category": "AzureOneLake", + "isSharedToAll": true, + "metadata": {}, + "target": "https://https://onelake.dfs.fabric.microsoft.com/smoke-onelake-workspace/smoke-lakehouse.Lakehouse.Lakehouse" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_open_ai.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_open_ai.json new file mode 100644 index 000000000000..61c535dc90ea --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_open_ai.json @@ -0,0 +1,11 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "OpenAi", + "credentials": { + "key": "smoke-openai-api-key" + }, + "isSharedToAll": true, + "metadata": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serp.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serp.json new file mode 100644 index 000000000000..40b03778cedc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serp.json @@ -0,0 +1,11 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "Serp", + "credentials": { + "key": "smoke-serp-api-key" + }, + "isSharedToAll": true, + "metadata": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serverless.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serverless.json new file mode 100644 index 000000000000..7a470220e3eb --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_serverless.json @@ -0,0 +1,12 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "Serverless", + "credentials": { + "key": "smoke-serverless-api-key" + }, + "isSharedToAll": true, + "metadata": {}, + "target": "https://smoke-maas.eastus.models.ai.azure.com" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_speech_services.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_speech_services.json new file mode 100644 index 000000000000..32b819c20bd9 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/connection_speech_services.json @@ -0,0 +1,14 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "CognitiveService", + "credentials": { + "key": "smoke-speech-api-key" + }, + "isSharedToAll": true, + "metadata": { + "Kind": "speech" + }, + "target": "https://smoke-speech.cognitiveservices.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_api_key.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_api_key.json new file mode 100644 index 000000000000..c17b4112b5d4 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_api_key.json @@ -0,0 +1,12 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "ApiKey", + "credentials": { + "key": "smoke-generic-api-key" + }, + "isSharedToAll": true, + "metadata": {}, + "target": "https://smoke-api.example.com/v1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_content_safety.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_content_safety.json new file mode 100644 index 000000000000..9e7e25f89c9f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_content_safety.json @@ -0,0 +1,14 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "CognitiveService", + "credentials": { + "key": "smoke-contentsafety-api-key" + }, + "isSharedToAll": true, + "metadata": { + "Kind": "Content Safety" + }, + "target": "https://smoke-contentsafety.cognitiveservices.azure.com/" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_one_lake.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_one_lake.json new file mode 100644 index 000000000000..cb570d913555 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_one_lake.json @@ -0,0 +1,9 @@ +{ + "properties": { + "authType": "AAD", + "category": "AzureOneLake", + "isSharedToAll": true, + "metadata": {}, + "target": "https://https://onelake.dfs.fabric.microsoft.com/smoke-onelake-workspace/smoke-lakehouse.Lakehouse.Lakehouse" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_open_ai.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_open_ai.json new file mode 100644 index 000000000000..61c535dc90ea --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_open_ai.json @@ -0,0 +1,11 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "OpenAi", + "credentials": { + "key": "smoke-openai-api-key" + }, + "isSharedToAll": true, + "metadata": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serp.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serp.json new file mode 100644 index 000000000000..40b03778cedc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serp.json @@ -0,0 +1,11 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "Serp", + "credentials": { + "key": "smoke-serp-api-key" + }, + "isSharedToAll": true, + "metadata": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serverless.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serverless.json new file mode 100644 index 000000000000..7a470220e3eb --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_serverless.json @@ -0,0 +1,12 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "Serverless", + "credentials": { + "key": "smoke-serverless-api-key" + }, + "isSharedToAll": true, + "metadata": {}, + "target": "https://smoke-maas.eastus.models.ai.azure.com" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_speech_services.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_speech_services.json new file mode 100644 index 000000000000..32b819c20bd9 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_connection_speech_services.json @@ -0,0 +1,14 @@ +{ + "properties": { + "authType": "ApiKey", + "category": "CognitiveService", + "credentials": { + "key": "smoke-speech-api-key" + }, + "isSharedToAll": true, + "metadata": { + "Kind": "speech" + }, + "target": "https://smoke-speech.cognitiveservices.azure.com/" + } +} From 6f2c6abec581e6566f77dea42eaf78b640e79bba Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 15:57:09 +0530 Subject: [PATCH 139/146] test(smoke): add certificate + none-credential datastore variants Covers the certificate datastore credential (guards the cert credential wire; resource_url intentionally omitted since its migration fix is a latent bug-fix, documented in the builder) and the credential-less (identity-based) datastore path. Byte-identical vs baseline, no mocking. --- .../_builders_datastore.py | 36 +++++++++++++++++++ .../adls_gen2_datastore_certificate.json | 21 +++++++++++ .../blob_datastore_none_credential.json | 13 +++++++ ...ndtrip_blob_datastore_none_credential.json | 13 +++++++ 4 files changed, 83 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore_certificate.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_none_credential.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_none_credential.json diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py index 09337dcd3e81..9c3b6c413c3a 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py @@ -12,6 +12,8 @@ AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, + CertificateConfiguration, + NoneCredentialConfiguration, SasTokenConfiguration, ServicePrincipalConfiguration, ) @@ -98,11 +100,45 @@ def build_one_lake_datastore(): ) +def build_adls_gen2_datastore_certificate(): + """AzureDataLakeGen2Datastore with a certificate credential. + + NOTE: ``resource_url``/``authority_url`` are intentionally NOT set. Pre-migration the entity passed + ``resource_uri`` to the msrest ``CertificateDatastoreCredentials``, which silently dropped it (not a + known attribute), so it never reached the wire. The migration fixed this to the correct ``resource_url`` + (wire key ``resourceUrl``) so it is now honored -- a latent bug-fix that changes the wire only when the + value is set. Omitting it here keeps the guard on the substantive cert wire (tenant/client/cert/thumbprint). + """ + return AzureDataLakeGen2Datastore( + name="smoke-gen2-cert-ds", + account_name="smokeaccount", + filesystem="smoke-filesystem", + credentials=CertificateConfiguration( + tenant_id="00000000-0000-0000-0000-000000000000", + client_id="11111111-1111-1111-1111-111111111111", + certificate="smoke-certificate-pem", + thumbprint="SMOKE-THUMBPRINT", + ), + ) + + +def build_blob_datastore_none_credential(): + """AzureBlobDatastore with no credential (credential-less / identity-based access).""" + return AzureBlobDatastore( + name="smoke-blob-none-ds", + account_name="smokeaccount", + container_name="smoke-container", + credentials=NoneCredentialConfiguration(), + ) + + DATASTORE_BUILDERS = { "blob_datastore_account_key": build_blob_datastore_account_key, "blob_datastore_sas": build_blob_datastore_sas, + "blob_datastore_none_credential": build_blob_datastore_none_credential, "file_datastore": build_file_datastore, "adls_gen1_datastore": build_adls_gen1_datastore, "adls_gen2_datastore": build_adls_gen2_datastore, + "adls_gen2_datastore_certificate": build_adls_gen2_datastore_certificate, "one_lake_datastore": build_one_lake_datastore, } diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore_certificate.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore_certificate.json new file mode 100644 index 000000000000..56ba2962b2fc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore_certificate.json @@ -0,0 +1,21 @@ +{ + "properties": { + "accountName": "smokeaccount", + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "Certificate", + "secrets": { + "certificate": "smoke-certificate-pem", + "secretsType": "Certificate" + }, + "tenantId": "00000000-0000-0000-0000-000000000000", + "thumbprint": "SMOKE-THUMBPRINT" + }, + "datastoreType": "AzureDataLakeGen2", + "endpoint": "core.windows.net", + "filesystem": "smoke-filesystem", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_none_credential.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_none_credential.json new file mode 100644 index 000000000000..02c295e01b64 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_none_credential.json @@ -0,0 +1,13 @@ +{ + "properties": { + "accountName": "smokeaccount", + "containerName": "smoke-container", + "credentials": { + "credentialsType": "None" + }, + "datastoreType": "AzureBlob", + "endpoint": "core.windows.net", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_none_credential.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_none_credential.json new file mode 100644 index 000000000000..02c295e01b64 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_blob_datastore_none_credential.json @@ -0,0 +1,13 @@ +{ + "properties": { + "accountName": "smokeaccount", + "containerName": "smoke-container", + "credentials": { + "credentialsType": "None" + }, + "datastoreType": "AzureBlob", + "endpoint": "core.windows.net", + "protocol": "https", + "tags": {} + } +} From 2431f86810dc4bb595e66fa737de29a474e9b84f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 16:06:32 +0530 Subject: [PATCH 140/146] test(smoke): cover arm-absent families (HDFS datastore, data_import, Ray distribution) Adds the arm-absent, hand-built JSON-direct families that are the highest regression risk (the same class as the distillation properties-bag bug): HdfsDatastore with Kerberos password creds, DataImport with Database and FileSystem sources, and a Ray-distribution CommandJob. Byte-identical vs baseline, no mocking. --- .../tests/smoke_serialization/_builders.py | 14 +++++++ .../_builders_data_import.py | 42 +++++++++++++++++++ .../_builders_datastore.py | 18 ++++++++ .../expected_wire/command_job_ray.json | 23 ++++++++++ .../data_import_database_entity.json | 14 +++++++ .../data_import_file_system_entity.json | 14 +++++++ .../hdfs_datastore_kerberos_password.json | 18 ++++++++ ...roundtrip_data_import_database_entity.json | 14 +++++++ ...ndtrip_data_import_file_system_entity.json | 14 +++++++ ...trip_hdfs_datastore_kerberos_password.json | 18 ++++++++ .../test_data_import_wire.py | 25 +++++++++++ 11 files changed, 214 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_data_import.py create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_ray.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database_entity.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_file_system_entity.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/hdfs_datastore_kerberos_password.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database_entity.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_file_system_entity.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_hdfs_datastore_kerberos_password.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_data_import_wire.py diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py index 2c60cec4bd77..87cd31ac9892 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py @@ -12,6 +12,7 @@ children, and a regression typically hides in exactly one child. """ from azure.ai.ml import Input, Output, MpiDistribution, PyTorchDistribution, TensorFlowDistribution +from azure.ai.ml.entities._job.distribution import RayDistribution from azure.ai.ml import command from datetime import datetime from azure.ai.ml.constants._common import AssetTypes @@ -276,6 +277,18 @@ def build_command_job_tensorflow(): ) +def build_command_job_ray(): + """A CommandJob with a Ray distribution (arm-absent Ray subtype -> JSON-direct wire).""" + return CommandJob( + name="smoke-command-ray", + command="python train.py", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + distribution=RayDistribution(port=6379, address="127.0.0.1", num_cpus=4, num_gpus=1), + resources=JobResourceConfiguration(instance_count=2), + ) + + COMMAND_JOB_BUILDERS.update( { "command_job_minimal": build_command_job_minimal, @@ -287,6 +300,7 @@ def build_command_job_tensorflow(): "command_job_docker_args_list": build_command_job_docker_args_list, "command_job_pytorch": build_command_job_pytorch, "command_job_tensorflow": build_command_job_tensorflow, + "command_job_ray": build_command_job_ray, } ) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_data_import.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_data_import.py new file mode 100644 index 000000000000..c2c2e92b24fc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_data_import.py @@ -0,0 +1,42 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for data-import entities (smoke serialization suite). + +``DataImport`` with ``Database``/``FileSystem`` sources are arm-absent models: the migration builds +their wire body hand (JSON-direct) rather than through a generated model, which is exactly the class of +change where an implicit serializer behavior can drift (see the distillation properties-bag finding). +This pins their request bodies byte-for-byte vs the pre-migration baseline. No mocking. +""" +from azure.ai.ml.entities._data_import.data_import import DataImport +from azure.ai.ml.entities._inputs_outputs.external_data import Database, FileSystem + + +def build_data_import_database(): + """DataImport from a Database source (SQL query).""" + return DataImport( + name="smoke-data-import-db", + path="azureml://datastores/workspaceblobstore/paths/smoke-import/", + source=Database( + query="SELECT * FROM smoke_table WHERE region = 'westus'", + connection="azureml:smoke-sql-connection", + ), + ) + + +def build_data_import_file_system(): + """DataImport from a FileSystem source (external S3-style path).""" + return DataImport( + name="smoke-data-import-fs", + path="azureml://datastores/workspaceblobstore/paths/smoke-import-fs/", + source=FileSystem( + path="test1/*", + connection="azureml:smoke-s3-connection", + ), + ) + + +DATA_IMPORT_BUILDERS = { + "data_import_database_entity": build_data_import_database, + "data_import_file_system_entity": build_data_import_file_system, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py index 9c3b6c413c3a..897df669e794 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py @@ -18,6 +18,8 @@ ServicePrincipalConfiguration, ) from azure.ai.ml.entities._datastore.one_lake import LakeHouseArtifact, OneLakeDatastore +from azure.ai.ml.entities._datastore._on_prem import HdfsDatastore +from azure.ai.ml.entities._datastore._on_prem_credentials import KerberosPasswordCredentials def build_blob_datastore_account_key(): @@ -132,6 +134,21 @@ def build_blob_datastore_none_credential(): ) +def build_hdfs_datastore_kerberos_password(): + """HdfsDatastore (arm-absent, hand-built JSON-direct wire) with Kerberos password credentials.""" + return HdfsDatastore( + name="smoke-hdfs-ds", + name_node_address="hdfs-namenode.smoke.local", + protocol="https", + credentials=KerberosPasswordCredentials( + kerberos_realm="SMOKE.LOCAL", + kerberos_kdc_address="kdc.smoke.local", + kerberos_principal="smoke@SMOKE.LOCAL", + kerberos_password="smoke-kerberos-password", + ), + ) + + DATASTORE_BUILDERS = { "blob_datastore_account_key": build_blob_datastore_account_key, "blob_datastore_sas": build_blob_datastore_sas, @@ -141,4 +158,5 @@ def build_blob_datastore_none_credential(): "adls_gen2_datastore": build_adls_gen2_datastore, "adls_gen2_datastore_certificate": build_adls_gen2_datastore_certificate, "one_lake_datastore": build_one_lake_datastore, + "hdfs_datastore_kerberos_password": build_hdfs_datastore_kerberos_password, } diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_ray.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_ray.json new file mode 100644 index 000000000000..b639003dcdd0 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_ray.json @@ -0,0 +1,23 @@ +{ + "properties": { + "command": "python train.py", + "computeId": "smoke-compute", + "distribution": { + "address": "127.0.0.1", + "distributionType": "Ray", + "port": 6379 + }, + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "resources": { + "instanceCount": 2, + "properties": {} + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database_entity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database_entity.json new file mode 100644 index 000000000000..1e7b75c0cc97 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database_entity.json @@ -0,0 +1,14 @@ +{ + "assetName": "smoke-data-import-db", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke-import/", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke-sql-connection", + "query": "SELECT * FROM smoke_table WHERE region = 'westus'", + "sourceType": "database" + }, + "tags": {} +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_file_system_entity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_file_system_entity.json new file mode 100644 index 000000000000..f8d2159654c3 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_file_system_entity.json @@ -0,0 +1,14 @@ +{ + "assetName": "smoke-data-import-fs", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke-import-fs/", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke-s3-connection", + "path": "test1/*", + "sourceType": "file_system" + }, + "tags": {} +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/hdfs_datastore_kerberos_password.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/hdfs_datastore_kerberos_password.json new file mode 100644 index 000000000000..8754b1453504 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/hdfs_datastore_kerberos_password.json @@ -0,0 +1,18 @@ +{ + "properties": { + "credentials": { + "credentialsType": "KerberosPassword", + "kerberosKdcAddress": "kdc.smoke.local", + "kerberosPrincipal": "smoke@SMOKE.LOCAL", + "kerberosRealm": "SMOKE.LOCAL", + "secrets": { + "kerberosPassword": "smoke-kerberos-password", + "secretsType": "KerberosPassword" + } + }, + "datastoreType": "Hdfs", + "nameNodeAddress": "hdfs-namenode.smoke.local", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database_entity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database_entity.json new file mode 100644 index 000000000000..1e7b75c0cc97 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_database_entity.json @@ -0,0 +1,14 @@ +{ + "assetName": "smoke-data-import-db", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke-import/", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke-sql-connection", + "query": "SELECT * FROM smoke_table WHERE region = 'westus'", + "sourceType": "database" + }, + "tags": {} +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_file_system_entity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_file_system_entity.json new file mode 100644 index 000000000000..f8d2159654c3 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_data_import_file_system_entity.json @@ -0,0 +1,14 @@ +{ + "assetName": "smoke-data-import-fs", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke-import-fs/", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke-s3-connection", + "path": "test1/*", + "sourceType": "file_system" + }, + "tags": {} +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_hdfs_datastore_kerberos_password.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_hdfs_datastore_kerberos_password.json new file mode 100644 index 000000000000..8754b1453504 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_hdfs_datastore_kerberos_password.json @@ -0,0 +1,18 @@ +{ + "properties": { + "credentials": { + "credentialsType": "KerberosPassword", + "kerberosKdcAddress": "kdc.smoke.local", + "kerberosPrincipal": "smoke@SMOKE.LOCAL", + "kerberosRealm": "SMOKE.LOCAL", + "secrets": { + "kerberosPassword": "smoke-kerberos-password", + "secretsType": "KerberosPassword" + } + }, + "datastoreType": "Hdfs", + "nameNodeAddress": "hdfs-namenode.smoke.local", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_data_import_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_data_import_wire.py new file mode 100644 index 000000000000..6de3bb0ddee2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_data_import_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for data-import entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_data_import import DATA_IMPORT_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(DATA_IMPORT_BUILDERS)) +def test_data_import_serializes(case_name): + """The data-import rest object must serialize to wire without raising.""" + entity = DATA_IMPORT_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(DATA_IMPORT_BUILDERS)) +def test_data_import_wire_matches_expected(case_name): + """The data-import wire must be byte-identical to the baseline captured from main.""" + entity = DATA_IMPORT_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) From b507adcd8693580e3c00a6fa268fed4e83699f2b Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 16:08:46 +0530 Subject: [PATCH 141/146] test(smoke): cover model deployment-templates + WorkspaceAssetReference Adds a Model with default/allowed deployment templates (arm-absent template fields with special wire-keying and the msrest stage-drop) and a WorkspaceAssetReference (arm-absent registry copy, hand-built JSON-direct wire). Byte-identical vs baseline, no mocking. --- .../smoke_serialization/_builders_asset.py | 34 +++++++++++++++++++ .../model_with_deployment_template.json | 21 ++++++++++++ .../roundtrip_workspace_asset_reference.json | 8 +++++ .../workspace_asset_reference.json | 8 +++++ 4 files changed, 71 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_with_deployment_template.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_asset_reference.json create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_asset_reference.json diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py index a3ba1c31f049..0aee51fffed6 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py @@ -8,7 +8,9 @@ from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities import Data, Environment, Model from azure.ai.ml.entities._assets._artifacts.code import Code +from azure.ai.ml.entities._assets.default_deployment_template import DeploymentTemplateReference from azure.ai.ml.entities._assets.environment import BuildContext +from azure.ai.ml.entities._assets.workspace_asset_reference import WorkspaceAssetReference _REMOTE = "azureml://datastores/workspaceblobstore/paths/smoke/" @@ -105,9 +107,41 @@ def build_code_full(): ) +def build_model_with_deployment_template(): + """Model with default + allowed deployment templates (arm-absent template fields, special wire-keying).""" + return Model( + name="smoke-model-template", + version="1", + type=AssetTypes.CUSTOM_MODEL, + path=_REMOTE + "model-template/", + default_deployment_template=DeploymentTemplateReference(asset_id="azureml:smoke-default-template:1"), + allowed_deployment_templates=[ + DeploymentTemplateReference(asset_id="azureml:smoke-allowed-template-a:1"), + DeploymentTemplateReference(asset_id="azureml:smoke-allowed-template-b:2"), + ], + ) + + +def build_workspace_asset_reference(): + """WorkspaceAssetReference (arm-absent registry copy; hand-built JSON-direct wire).""" + return WorkspaceAssetReference( + name="smoke-shared-model", + version="3", + asset_id=( + "azureml://subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg" + "/providers/Microsoft.MachineLearningServices/workspaces/smoke-ws/models/smoke-model/versions/1" + ), + ) + + MODEL_BUILDERS = { "model_full": build_model_full, "model_mlflow": build_model_mlflow, + "model_with_deployment_template": build_model_with_deployment_template, +} + +WORKSPACE_ASSET_REFERENCE_BUILDERS = { + "workspace_asset_reference": build_workspace_asset_reference, } ENVIRONMENT_BUILDERS = { diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_with_deployment_template.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_with_deployment_template.json new file mode 100644 index 000000000000..2e42dadc6979 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_with_deployment_template.json @@ -0,0 +1,21 @@ +{ + "properties": { + "allowedDeploymentTemplates": [ + { + "assetId": "azureml:smoke-allowed-template-a:1" + }, + { + "assetId": "azureml:smoke-allowed-template-b:2" + } + ], + "defaultDeploymentTemplate": { + "assetId": "azureml:smoke-default-template:1" + }, + "isAnonymous": false, + "isArchived": false, + "modelType": "custom_model", + "modelUri": "azureml://datastores/workspaceblobstore/paths/smoke/model-template/", + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_asset_reference.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_asset_reference.json new file mode 100644 index 000000000000..fd883bc24e7d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/roundtrip_workspace_asset_reference.json @@ -0,0 +1,8 @@ +{ + "properties": { + "destinationName": "smoke-shared-model", + "destinationVersion": "3", + "referenceType": "Id", + "sourceAssetId": "azureml://subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.MachineLearningServices/workspaces/smoke-ws/models/smoke-model/versions/1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_asset_reference.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_asset_reference.json new file mode 100644 index 000000000000..fd883bc24e7d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_asset_reference.json @@ -0,0 +1,8 @@ +{ + "properties": { + "destinationName": "smoke-shared-model", + "destinationVersion": "3", + "referenceType": "Id", + "sourceAssetId": "azureml://subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.MachineLearningServices/workspaces/smoke-ws/models/smoke-model/versions/1" + } +} From 61ffbaf3edb1e23830c57013136d5e1703cc760f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 19:59:00 +0530 Subject: [PATCH 142/146] fix(environment): preserve inference_config route wire + guard registry-create None Two notebook-caught regressions in the Environment migration: 1. inference_config passed as a raw snake_case dict (direct Environment(...) construction) was serialized verbatim by the arm hybrid encoder, so the server rejected it ('must specify all three of: liveness, readiness and scoring routes'). msrest's typed field mapped it snake->camel. Now convert the dict to an arm InferenceContainerProperties (livenessRoute/readinessRoute/scoringRoute); already-model inputs pass through unchanged. 2. Registry environment create wrapped the LRO result in EnvironmentVersion._deserialize eagerly; the registry create can return an empty (None) body, causing 'NoneType has no attribute items'. Only deserialize non-None; otherwise fall through to the existing _get re-fetch guard. --- .../ai/ml/entities/_assets/environment.py | 29 +++++++++++++++++- .../ml/operations/_environment_operations.py | 30 +++++++++---------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index a333a868ff3e..7abe44547dec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -16,6 +16,8 @@ EnvironmentContainer, EnvironmentVersion, EnvironmentVersionProperties, + InferenceContainerProperties, + Route, ) from azure.ai.ml._schema import EnvironmentSchema from azure.ai.ml._utils._arm_id_utils import AMLVersionedArmId @@ -30,6 +32,31 @@ from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException +def _to_rest_route(route: Any) -> Any: + if route is None or not isinstance(route, dict): + return route + return Route(**route) + + +def _to_rest_inference_config(inference_config: Any) -> Any: + """Normalize ``inference_config`` for the arm_ml_service wire. + + When an ``Environment`` is constructed directly in Python (not loaded via the schema), the + ``inference_config`` is a raw snake_case dict. The legacy msrest typed field implicitly mapped + such a dict to camelCase wire keys (``livenessRoute``/``readinessRoute``/``scoringRoute``); the + arm hybrid model serializes a plain dict verbatim, so the routes must be wrapped in the arm + ``InferenceContainerProperties`` model to preserve the wire. If it is already an arm model + (e.g. produced by ``InferenceConfigSchema``), it is returned unchanged. + """ + if inference_config is None or not isinstance(inference_config, dict): + return inference_config + return InferenceContainerProperties( + liveness_route=_to_rest_route(inference_config.get("liveness_route")), + readiness_route=_to_rest_route(inference_config.get("readiness_route")), + scoring_route=_to_rest_route(inference_config.get("scoring_route")), + ) + + class BuildContext: """Docker build context for Environment. @@ -230,7 +257,7 @@ def _to_rest_object(self) -> EnvironmentVersion: environment_version.is_anonymous = self._is_anonymous or False environment_version.is_archived = False if self.inference_config: - environment_version.inference_config = self.inference_config + environment_version.inference_config = _to_rest_inference_config(self.inference_config) if self.description: environment_version.description = self.description if self.properties: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index 118b9209aa1c..794fad1c648e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -188,21 +188,22 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig show_progress=self._show_progress, ) env_version_resource = environment._to_rest_object() - env_rest_obj = ( - EnvironmentVersion._deserialize( - begin_create_or_update_registry_versioned_asset( - self._registry_service_client, - "environments", - environment.name, - environment.version, - self._operation_scope.resource_group_name, - self._registry_name, - env_version_resource, - ), - [], + if self._registry_name: + registry_rest_obj = begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "environments", + environment.name, + environment.version, + self._operation_scope.resource_group_name, + self._registry_name, + env_version_resource, ) - if self._registry_name - else self._version_operations.create_or_update( + # The registry create LRO can complete with an empty body; only deserialize a + # non-None result, otherwise fall through to the re-fetch guard below (a bare + # ``_deserialize(None, [])`` would raise ``'NoneType' object has no attribute 'items'``). + env_rest_obj = EnvironmentVersion._deserialize(registry_rest_obj, []) if registry_rest_obj else None + else: + env_rest_obj = self._version_operations.create_or_update( name=environment.name, version=environment.version, workspace_name=self._workspace_name, @@ -210,7 +211,6 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig **self._scope_kwargs, **self._kwargs, ) - ) if not env_rest_obj and self._registry_name: env_rest_obj = self._get(name=str(environment.name), version=environment.version) return Environment._from_rest_object(env_rest_obj) From 6a0d85898741c3d6cdca76c519993dac46eb0786 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 20:23:44 +0530 Subject: [PATCH 143/146] test(environment): cover inference_config route wire + registry-create None guard Regression coverage for the two notebook-caught Environment bugs: - smoke: Environment(inference_config={raw dict}) and the arm-model path must both emit camelCase livenessRoute/readinessRoute/scoringRoute (explicit assertion; baseline cannot serialize the raw-dict input). - unit: registry create returning an empty (None) LRO body must re-fetch via _get instead of crashing in _deserialize(None). --- .../test_environment_operations_registry.py | 30 +++++++++ .../test_environment_inference_config_wire.py | 63 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/tests/smoke_serialization/test_environment_inference_config_wire.py diff --git a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py index fcb286c97bdb..c0bf12c9b5ed 100644 --- a/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py +++ b/sdk/ml/azure-ai-ml/tests/environment/unittests/test_environment_operations_registry.py @@ -80,3 +80,33 @@ def test_create_or_update_sas_uri_failure(self, mock_environment_operation: Envi ): mock_environment_operation.create_or_update(env) check_upload.assert_not_called() + + def test_create_or_update_registry_empty_lro_body_refetches( + self, mock_environment_operation: EnvironmentOperations + ): + """A registry create that completes with an empty (None) LRO body must not crash. + + The arm registry create LRO can return ``None``; deserializing it eagerly raised + ``'NoneType' object has no attribute 'items'``. The op must skip the deserialize and fall + through to the ``_get`` re-fetch guard instead. ``_deserialize`` is intentionally NOT patched + so a reverted guard would surface the real crash. + """ + env = load_environment(source="./tests/test_configs/environment/environment_conda.yml") + refetched = Mock() + with patch( + "azure.ai.ml.operations._environment_operations.get_sas_uri_for_registry_asset", return_value="some_sas_uri" + ), patch( + "azure.ai.ml.operations._environment_operations._check_and_upload_env_build_context", return_value=env + ), patch( + "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset", + return_value=None, + ), patch.object( + mock_environment_operation, "_get", return_value=refetched + ) as mock_get, patch( + "azure.ai.ml.operations._environment_operations.Environment._from_rest_object", return_value=None + ) as mock_from_rest: + mock_environment_operation.create_or_update(env) + + mock_get.assert_called_once() + # The re-fetched object (not None) must be what is handed to _from_rest_object. + mock_from_rest.assert_called_once_with(refetched) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_environment_inference_config_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_environment_inference_config_wire.py new file mode 100644 index 000000000000..2fdaefa17ebe --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_environment_inference_config_wire.py @@ -0,0 +1,63 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Guard for the ``Environment.inference_config`` route wire (regression from the arm migration). + +The custom-container online-endpoint samples construct ``Environment(inference_config={raw dict})`` +directly in Python (not via YAML). The legacy msrest typed field implicitly mapped that snake_case +dict to camelCase wire keys (``livenessRoute``/``readinessRoute``/``scoringRoute``); the arm hybrid +encoder serializes a plain dict verbatim, so without conversion the server rejects it with +"You must specify all three of: liveness, readiness and scoring routes". + +This case CANNOT use a baseline-captured golden: main's bare ``.serialize()`` raises on a raw-dict +typed field (``'dict' object has no attribute '_attribute_map'``), so the expected wire is asserted +explicitly here. That also makes the test fail loudly if the fix is ever reverted (the raw dict +would serialize back to snake_case keys). +""" +import pytest + +from azure.ai.ml._restclient.arm_ml_service.models import InferenceContainerProperties, Route +from azure.ai.ml.entities import Environment + +from _wire import serialize_wire + +_LIVENESS = {"port": 8501, "path": "/v1/models/half_plus_two"} +_READINESS = {"port": 8501, "path": "/v1/models/half_plus_two"} +_SCORING = {"port": 8501, "path": "/v1/models/half_plus_two:predict"} + +_EXPECTED_INFERENCE_CONFIG = { + "livenessRoute": _LIVENESS, + "readinessRoute": _READINESS, + "scoringRoute": _SCORING, +} + + +def _env_from_raw_dict(): + """Environment built exactly like the custom-container sample notebook (raw snake_case dict).""" + return Environment( + image="docker.io/tensorflow/serving:latest", + inference_config={ + "liveness_route": dict(_LIVENESS), + "readiness_route": dict(_READINESS), + "scoring_route": dict(_SCORING), + }, + ) + + +def _env_from_arm_model(): + """Environment built the way ``InferenceConfigSchema`` produces it (arm model).""" + return Environment( + image="docker.io/tensorflow/serving:latest", + inference_config=InferenceContainerProperties( + liveness_route=Route(port=_LIVENESS["port"], path=_LIVENESS["path"]), + readiness_route=Route(port=_READINESS["port"], path=_READINESS["path"]), + scoring_route=Route(port=_SCORING["port"], path=_SCORING["path"]), + ), + ) + + +@pytest.mark.parametrize("builder", [_env_from_raw_dict, _env_from_arm_model], ids=["raw_dict", "arm_model"]) +def test_environment_inference_config_routes_wire(builder): + """Both construction paths must emit the three camelCase routes the server requires.""" + wire = serialize_wire(builder()._to_rest_object()) + assert wire["properties"]["inferenceConfig"] == _EXPECTED_INFERENCE_CONFIG From 4902c2d629ce06fd87a7884c8838d90682ea9bcb Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 20:27:19 +0530 Subject: [PATCH 144/146] fix(code,data): guard registry-create None LRO body (same class as environment fix) Static audit of _deserialize() sites found the same latent bug as the environment registry create: code and data registry create wrapped begin_create_or_update_registry_versioned_asset in _deserialize eagerly, so an empty (None) LRO body would raise 'NoneType' object has no attribute 'items' before the existing 'if not result: re-fetch' guard could run. Only deserialize non-None results. --- .../ai/ml/operations/_code_operations.py | 30 +++++++++---------- .../ai/ml/operations/_data_operations.py | 30 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index 1756ab42fc01..18c1a7d675a1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -174,21 +174,22 @@ def create_or_update(self, code: Code) -> Code: code_version_resource = code._to_rest_object() - result = ( - CodeVersionData._deserialize( - begin_create_or_update_registry_versioned_asset( - self._registry_service_client, - "codes", - name, - version, - self._operation_scope.resource_group_name, - self._registry_name, - code_version_resource, - ), - [], + if self._registry_name: + registry_rest_obj = begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "codes", + name, + version, + self._operation_scope.resource_group_name, + self._registry_name, + code_version_resource, ) - if self._registry_name - else self._version_operation.create_or_update( + # The registry create LRO can complete with an empty body; only deserialize a + # non-None result, otherwise fall through to the re-fetch guard below (a bare + # ``_deserialize(None, [])`` would raise ``'NoneType' object has no attribute 'items'``). + result = CodeVersionData._deserialize(registry_rest_obj, []) if registry_rest_obj else None + else: + result = self._version_operation.create_or_update( name=name, version=version, workspace_name=self._workspace_name, @@ -196,7 +197,6 @@ def create_or_update(self, code: Code) -> Code: body=code_version_resource, **self._init_kwargs, ) - ) if not result: return self.get(name=name, version=version) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 7f1368661033..530b9abce350 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -405,28 +405,28 @@ def create_or_update(self, data: Data) -> Data: **self._init_kwargs, ) else: - result = ( - DataVersionBase._deserialize( - begin_create_or_update_registry_versioned_asset( - self._registry_service_client, - "data", - name, - version, - self._operation_scope.resource_group_name, - self._registry_name, - data_version_resource, - ), - [], + if self._registry_name: + registry_rest_obj = begin_create_or_update_registry_versioned_asset( + self._registry_service_client, + "data", + name, + version, + self._operation_scope.resource_group_name, + self._registry_name, + data_version_resource, ) - if self._registry_name - else self._operation.create_or_update( + # The registry create LRO can complete with an empty body; only deserialize a + # non-None result, otherwise fall through to the re-fetch guard below (a bare + # ``_deserialize(None, [])`` would raise ``'NoneType' object has no attribute 'items'``). + result = DataVersionBase._deserialize(registry_rest_obj, []) if registry_rest_obj else None + else: + result = self._operation.create_or_update( name=name, version=version, workspace_name=self._workspace_name, body=data_version_resource, **self._scope_kwargs, ) - ) if not result and self._registry_name: result = self._get(name=name, version=version) From adf137ad17010bd65dfebe34e57b581b100d4d37 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 22:41:14 +0530 Subject: [PATCH 145/146] fix: arm-migration read regressions caught by notebook samples + pylint docstring Fixes several AttributeError regressions where migrated read paths call msrest-only APIs on arm_ml_service hybrid models (which are MutableMappings without those attributes): - kubernetes_compute._load_from_rest: prop.additional_properties.get(createdOn) -> mapping-safe read (like aml_compute already does). - pipeline_component_batch_deployment._from_rest_object: deployment.properties.additional_properties[deploymentConfiguration] -> mapping-safe read. - _model_operations package(): additional_properties[targetEnvironmentId] else-branch made mapping-safe. - Registry create (code/data/environment): the create LRO body can be incomplete (missing the asset id, which _from_rest_object parses via AMLVersionedArmId -> 'no attribute asset_name'); re-fetch via get() when the id is missing. - environment: add pylint docstring param/return/rtype to _to_rest_inference_config (fixes Build Analyze C4739/C4741/C4742). --- .../azure/ai/ml/entities/_assets/environment.py | 5 +++++ .../ai/ml/entities/_compute/kubernetes_compute.py | 6 +++++- .../pipeline_component_batch_deployment.py | 11 +++++++++-- .../azure/ai/ml/operations/_code_operations.py | 4 +++- .../azure/ai/ml/operations/_data_operations.py | 4 +++- .../azure/ai/ml/operations/_environment_operations.py | 4 +++- .../azure/ai/ml/operations/_model_operations.py | 6 +++++- 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index 7abe44547dec..cbb668e2e56c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -47,6 +47,11 @@ def _to_rest_inference_config(inference_config: Any) -> Any: arm hybrid model serializes a plain dict verbatim, so the routes must be wrapped in the arm ``InferenceContainerProperties`` model to preserve the wire. If it is already an arm model (e.g. produced by ``InferenceConfigSchema``), it is returned unchanged. + + :param inference_config: The environment's inference config as a raw dict or an arm model. + :type inference_config: Any + :return: An arm ``InferenceContainerProperties`` model, or the input returned unchanged. + :rtype: Any """ if inference_config is None or not isinstance(inference_config, dict): return inference_config diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py index 7b9874f3d868..af8ef0d54018 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py @@ -67,7 +67,11 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "KubernetesCompute": if (prop.provisioning_errors and len(prop.provisioning_errors) > 0) else None ), - created_on=prop.additional_properties.get("createdOn", None), + created_on=( + prop.additional_properties.get("createdOn", None) + if hasattr(prop, "additional_properties") + else prop.get("createdOn") if hasattr(prop, "get") else None + ), properties=prop.properties.as_dict() if prop.properties else None, namespace=prop.properties.namespace, identity=IdentityConfiguration._from_compute_rest_object(rest_obj.identity) if rest_obj.identity else None, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py index 6c88137c6de8..10ab1349ae76 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py @@ -129,11 +129,18 @@ def _load( @classmethod def _from_rest_object(cls, deployment: RestBatchDeployment) -> "PipelineComponentBatchDeployment": + # The arm_ml_service model is a MutableMapping and exposes untyped wire keys via ``.get``; the + # legacy msrest model exposed the same extra keys via ``additional_properties``. + deployment_config = ( + deployment.properties.additional_properties.get("deploymentConfiguration", {}) + if hasattr(deployment.properties, "additional_properties") + else deployment.properties.get("deploymentConfiguration", {}) + ) return PipelineComponentBatchDeployment( name=deployment.name, tags=deployment.tags, - component=deployment.properties.additional_properties["deploymentConfiguration"]["componentId"]["assetId"], - settings=deployment.properties.additional_properties["deploymentConfiguration"]["settings"], + component=deployment_config["componentId"]["assetId"], + settings=deployment_config["settings"], endpoint_name=_parse_endpoint_name_from_deployment_id(deployment.id), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index 18c1a7d675a1..9a2f8cc846f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -198,7 +198,9 @@ def create_or_update(self, code: Code) -> Code: **self._init_kwargs, ) - if not result: + if not result or getattr(result, "id", None) is None: + # The registry create LRO body can be incomplete (missing the asset id, which + # ``_from_rest_object`` parses via AMLVersionedArmId); re-fetch the full resource. return self.get(name=name, version=version) return Code._from_rest_object(result) except Exception as ex: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py index 530b9abce350..7a22b8b7e1da 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py @@ -428,7 +428,9 @@ def create_or_update(self, data: Data) -> Data: **self._scope_kwargs, ) - if not result and self._registry_name: + if self._registry_name and (result is None or getattr(result, "id", None) is None): + # The registry create LRO body can be incomplete (missing the asset id, which + # ``_from_rest_object`` parses via AMLVersionedArmId); re-fetch the full resource. result = self._get(name=name, version=version) return Data._from_rest_object(result) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py index 794fad1c648e..53c97a1bb798 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @@ -211,7 +211,9 @@ def create_or_update(self, environment: Environment) -> Environment: # type: ig **self._scope_kwargs, **self._kwargs, ) - if not env_rest_obj and self._registry_name: + if self._registry_name and (env_rest_obj is None or getattr(env_rest_obj, "id", None) is None): + # The registry create LRO body can be incomplete (missing the asset id, which + # ``_from_rest_object`` parses via AMLVersionedArmId); re-fetch the full resource. env_rest_obj = self._get(name=str(environment.name), version=environment.version) return Environment._from_rest_object(env_rest_obj) except Exception as ex: # pylint: disable=W0718 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py index 33647db02658..625aa837fcda 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @@ -880,7 +880,11 @@ def package(self, name: str, version: str, package_request: ModelPackage, **kwar elif hasattr(package_out, "target_environment_id"): environment_id = package_out.target_environment_id else: - environment_id = package_out.additional_properties["targetEnvironmentId"] + environment_id = ( + package_out.additional_properties["targetEnvironmentId"] + if hasattr(package_out, "additional_properties") + else package_out.get("targetEnvironmentId") + ) pattern = r"azureml://locations/(\w+)/workspaces/([\w-]+)/environments/([\w.-]+)/versions/(\d+)" parsed_id: Any = re.search(pattern, environment_id) # type: ignore[arg-type] From cea341127bec1b318a71b41dba085cd3f15d4739 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 24 Jul 2026 23:08:08 +0530 Subject: [PATCH 146/146] test: registry env-create mock must return an id (matches the real LRO response) The registry create re-fetch guard (adf137ad17) re-fetches via get() when the create result lacks an id. test_show_progress_disabled_env mocked begin_create_or_update_registry_versioned_asset to return {properties:{}} (no id), which triggered a _get on the None mock registry client. The real registry create LRO returns the resource with its id; make the mock realistic so the guard is a no-op and the test exercises show_progress passthrough as intended. --- .../tests/internal_utils/unittests/test_storage_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py index f0ae3a4b520d..7ac91362f918 100644 --- a/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py +++ b/sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_storage_utils.py @@ -267,7 +267,10 @@ def test_show_progress_disabled_env( return_value="mocksasuri", ), patch( "azure.ai.ml.operations._environment_operations.begin_create_or_update_registry_versioned_asset", - return_value={"properties": {}}, + return_value={ + "id": "azureml://registries/test_registry_name/environments/name/versions/16", + "properties": {}, + }, ): mock_environment_operation.create_or_update(environment) mock_thing.assert_called_once_with(